pytorch
012c38e0 - Add contiguous_strides as a correct replacement of defaultStride (#67789)

Commit
3 years ago
Add contiguous_strides as a correct replacement of defaultStride (#67789) Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/67789 `at::defaultStride` was added in https://github.com/pytorch/pytorch/pull/18779. As it was noted in that PR, it differs from the actual computation of the default strides when one or more of the dimensions of the tensor are zero. See https://github.com/pytorch/pytorch/pull/18779#discussion_r272296140 We add two functions, `contiguous_strides` and `contiguous_strides_vec` which correct this issue and we replace the previous (wrong) uses of `defaultStride`. cc jianyuh nikitaved pearu mruberry walterddr IvanYashchuk xwang233 Lezcano Test Plan: Imported from OSS Reviewed By: ngimel Differential Revision: D32684852 Pulled By: mruberry fbshipit-source-id: 62997a5a97a4241a12e73e2be2e192b80b491cb1
Author
Parents
Loading