Make SizesAndStrides able to handle nontrivial objects (#82467)
This involved replacing a pile of mallocs with new[], etc.
Halfway through I discovered I could have used std::copy. Ah well, the
loops are pretty clear IMO.
Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Pull Request resolved: https://github.com/pytorch/pytorch/pull/82467
Approved by: https://github.com/albanD