pytorch/c10
Driss Guessous 4b597019b7 [Nested Tensor] Created Nested Tensor to Nested Tensor Views (#82658)
# Summary
This is PR is pulling out all the changes from #81838 specific to properly creating nested_tensor views. I will update this comment with a design doc once that has been made.  This should enable proper creation of NestedTensor views, two nested_tensors sharing the same buffer_ but with different NestedTensor meta data.

The function `create_nested_tensor_view` is a helper function for creating a new nested tensor whose storage aliases the base causing the underlying storage to be shared - and is therefore a view.

This function by itself is not differentiable and therefore autograd does not track its uses. If a nested tensor function implementation uses this helper in its implementation the aten_op must meet two requirements:
- The function must return a view of the input
- The function must be explicit and defines its backward

## Testing
A bug was found when creating a base tensor out of inference mode and then creating a view in inference mode. This test has been aded to this PR in order to show the effect of the change.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/82658
Approved by: https://github.com/albanD
2022-08-16 20:22:21 +00:00
..
benchmark [PyTorch] add intrusive_ptr exclusive ownership benchmark 2022-06-10 19:26:28 +00:00
core [Nested Tensor] Created Nested Tensor to Nested Tensor Views (#82658) 2022-08-16 20:22:21 +00:00
cuda Fix building with Werror (#83275) 2022-08-12 22:36:15 +00:00
hip
macros [ROCm] Fixes the kernel asserts API declaration mismatch error (#81790) 2022-08-16 19:22:31 +00:00
mobile
test Delete SymInt::data() in favor of as_int_unchecked() (#82477) 2022-08-01 15:07:22 +00:00
util Propagate CUDAOutOfMemoryError to Python. (#83146) 2022-08-11 21:32:11 +00:00
BUCK.oss rename BUILD.buck to BUCK.oss (#78792) 2022-06-03 07:23:16 +00:00
BUILD.bazel
build.bzl
c10_defs.bzl Add all bzl files per D36874458 2022-06-06 09:40:19 -07:00
CMakeLists.txt Make language std configurable. (#75519) 2022-07-13 14:21:27 +00:00
defs_hip.bzl Add all bzl files per D36874458 2022-06-06 09:40:19 -07:00
ovrsource_defs.bzl Add all bzl files per D36874458 2022-06-06 09:40:19 -07:00