[pt] add share_memory_ to aten TensorBase (#95557)
Summary:
This is the part 2 of adding `share_memory_()` support to C++ ATen lib.
See inline comments for API considerations and current behavior rationale.
Test Plan:
Since https://github.com/pytorch/pytorch/pull/95228 already adds the UT, this is not repeating it.
Github CI
Differential Revision: D43575383
Pull Request resolved: https://github.com/pytorch/pytorch/pull/95557
Approved by: https://github.com/ezyang