[Nested Tensor] Make offset copy and move assignment more explicit. (#83488)
Currently the nested tensor construction for the offset_ parameter takes in references and in the chain of delegation uses value. This could lead to unnecessary copies. Whenever a nested tensor impl is constructed it should take ownership of all its metadata. The only non-trivially copyable metadata associated with the class is `offsets_`.
The goal of this PR is to make sure that consumers of nested_tensor_impl constructors ensure that they are passing offsets as a temporary - either buy explicitly copying a reference, or by constructing the offsets vector in the scope of construction.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/83488
Approved by: https://github.com/albanD, https://github.com/bdhirsh