-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Remove tensorFromBlob() from Type #18779
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Remove tensorFromBlob() from Type gh-metadata: pytorch pytorch 18779 gh/li-roy/2/head
Remove tensorFromBlob() from Type gh-metadata: pytorch pytorch 18779 gh/li-roy/2/head
Remove tensorFromBlob() from Type gh-metadata: pytorch pytorch 18779 gh/li-roy/2/head
stride *= sizes[i-1]; | ||
} | ||
return strides; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is duplicate with this method in TensorImpl.h
inline void update_to_contiguous_strides(size_t old_dim) {
strides_.resize(sizes_.size(), 0);
if (dim() > 0) {
int last_idx = dim() - 1;
strides_[last_idx] = 1;
for (auto i = last_idx - 1; i >= 0; --i) {
strides_[i] = strides_[i + 1] * std::max<int64_t>(sizes_[i + 1], 1);
}
}
is_contiguous_ = true;
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see the code existed from before. I'll accept the movement as long a we hide these methods in a private namespace (e.g., impl)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM modulo some naming comments.
Remove tensorFromBlob() from Type gh-metadata: pytorch pytorch 18779 gh/li-roy/2/head
Remove tensorFromBlob() from Type gh-metadata: pytorch pytorch 18779 gh/li-roy/2/head
Remove tensorFromBlob() from Type gh-metadata: pytorch pytorch 18779 gh/li-roy/2/head
Remove tensorFromBlob() from Type gh-metadata: pytorch pytorch 18779 gh/li-roy/2/head
Remove tensorFromBlob() from Type gh-metadata: pytorch pytorch 18779 gh/li-roy/2/head
Remove tensorFromBlob() from Type gh-metadata: pytorch pytorch 18779 gh/li-roy/2/head
Remove tensorFromBlob() from Type gh-metadata: pytorch pytorch 18779 gh/li-roy/2/head
Remove tensorFromBlob() from Type gh-metadata: pytorch pytorch 18779 gh/li-roy/2/head
Summary: Pull Request resolved: pytorch/pytorch#18779 ghimport-source-id: e7453b74fcce0e4f4a9cbce0324992a85272a426 Stack from [ghstack](https://github.com/ezyang/ghstack): * #18780 Remove tensorWithAllocator() from Type * **#18779 Remove tensorFromBlob() from Type** Differential Revision: D14739335 fbshipit-source-id: 8a0619a5b412332efa3b2d60c1edebd53d089d50
This pull request has been merged in f6af76e. |
Summary: Pull Request resolved: #18780 ghimport-source-id: 7d18a11 Stack from [ghstack](https://github.com/ezyang/ghstack): * **#18780 Remove tensorWithAllocator() from Type** * #18779 Remove tensorFromBlob() from Type Differential Revision: D14739336 fbshipit-source-id: 429ab10bb9f6ac9f97b5a11c7a836b6b6336cb2d
Summary: Pull Request resolved: pytorch#18779 ghimport-source-id: e7453b7 Stack from [ghstack](https://github.com/ezyang/ghstack): * pytorch#18780 Remove tensorWithAllocator() from Type * **pytorch#18779 Remove tensorFromBlob() from Type** Differential Revision: D14739335 fbshipit-source-id: 8a0619a5b412332efa3b2d60c1edebd53d089d50
Summary: Pull Request resolved: pytorch#18780 ghimport-source-id: 7d18a11 Stack from [ghstack](https://github.com/ezyang/ghstack): * **pytorch#18780 Remove tensorWithAllocator() from Type** * pytorch#18779 Remove tensorFromBlob() from Type Differential Revision: D14739336 fbshipit-source-id: 429ab10bb9f6ac9f97b5a11c7a836b6b6336cb2d
`at::defaultStride` was added in #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 #18779 (comment) We add two functions, `contiguous_strides` and `contiguous_strides_vec` which correct this issue and we replace the previous (wrong) uses of `defaultStride`. [ghstack-poisoned]
…Stride" `at::defaultStride` was added in #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 #18779 (comment) 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 [ghstack-poisoned]
…Stride" `at::defaultStride` was added in #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 #18779 (comment) 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 Differential Revision: [D32684852](https://our.internmc.facebook.com/intern/diff/D32684852) [ghstack-poisoned]
…ement of defaultStride" `at::defaultStride` was added in #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 #18779 (comment) 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 Differential Revision: [D32684852](https://our.internmc.facebook.com/intern/diff/D32684852) [ghstack-poisoned]
…Stride" `at::defaultStride` was added in #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 #18779 (comment) 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 Differential Revision: [D32684852](https://our.internmc.facebook.com/intern/diff/D32684852) [ghstack-poisoned]
…ement of defaultStride" `at::defaultStride` was added in #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 #18779 (comment) 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 Differential Revision: [D32684852](https://our.internmc.facebook.com/intern/diff/D32684852) [ghstack-poisoned]
…Stride" `at::defaultStride` was added in #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 #18779 (comment) 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 Differential Revision: [D32684852](https://our.internmc.facebook.com/intern/diff/D32684852) [ghstack-poisoned]
…ement of defaultStride" `at::defaultStride` was added in #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 #18779 (comment) 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 Differential Revision: [D32684852](https://our.internmc.facebook.com/intern/diff/D32684852) [ghstack-poisoned]
…Stride" `at::defaultStride` was added in #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 #18779 (comment) 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 Differential Revision: [D32684852](https://our.internmc.facebook.com/intern/diff/D32684852) [ghstack-poisoned]
…ement of defaultStride" `at::defaultStride` was added in #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 #18779 (comment) 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 Differential Revision: [D32684852](https://our.internmc.facebook.com/intern/diff/D32684852) [ghstack-poisoned]
…Stride" `at::defaultStride` was added in #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 #18779 (comment) 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 Differential Revision: [D32684852](https://our.internmc.facebook.com/intern/diff/D32684852) [ghstack-poisoned]
…ement of defaultStride" `at::defaultStride` was added in #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 #18779 (comment) 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 Differential Revision: [D32684852](https://our.internmc.facebook.com/intern/diff/D32684852) [ghstack-poisoned]
…Stride" `at::defaultStride` was added in #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 #18779 (comment) 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 Differential Revision: [D32684852](https://our.internmc.facebook.com/intern/diff/D32684852) [ghstack-poisoned]
…ement of defaultStride" `at::defaultStride` was added in #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 #18779 (comment) 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 Differential Revision: [D32684852](https://our.internmc.facebook.com/intern/diff/D32684852) [ghstack-poisoned]
…Stride" `at::defaultStride` was added in #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 #18779 (comment) 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 Differential Revision: [D32684852](https://our.internmc.facebook.com/intern/diff/D32684852) [ghstack-poisoned]
…ement of defaultStride" `at::defaultStride` was added in #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 #18779 (comment) 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 Differential Revision: [D32684852](https://our.internmc.facebook.com/intern/diff/D32684852) [ghstack-poisoned]
…Stride" `at::defaultStride` was added in #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 #18779 (comment) 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 Differential Revision: [D32684852](https://our.internmc.facebook.com/intern/diff/D32684852) [ghstack-poisoned]
…ement of defaultStride" `at::defaultStride` was added in #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 #18779 (comment) 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 Differential Revision: [D32684852](https://our.internmc.facebook.com/intern/diff/D32684852) [ghstack-poisoned]
…Stride" `at::defaultStride` was added in #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 #18779 (comment) 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 Differential Revision: [D32684852](https://our.internmc.facebook.com/intern/diff/D32684852) [ghstack-poisoned]
…ement of defaultStride" `at::defaultStride` was added in #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 #18779 (comment) 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 Differential Revision: [D32684852](https://our.internmc.facebook.com/intern/diff/D32684852) [ghstack-poisoned]
…Stride" `at::defaultStride` was added in #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 #18779 (comment) 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 Differential Revision: [D32684852](https://our.internmc.facebook.com/intern/diff/D32684852) [ghstack-poisoned]
…ement of defaultStride" `at::defaultStride` was added in #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 #18779 (comment) 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 Differential Revision: [D32684852](https://our.internmc.facebook.com/intern/diff/D32684852) [ghstack-poisoned]
…Stride" `at::defaultStride` was added in #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 #18779 (comment) 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 Differential Revision: [D32684852](https://our.internmc.facebook.com/intern/diff/D32684852) [ghstack-poisoned]
…ement of defaultStride" `at::defaultStride` was added in #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 #18779 (comment) 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 Differential Revision: [D32684852](https://our.internmc.facebook.com/intern/diff/D32684852) [ghstack-poisoned]
…Stride" `at::defaultStride` was added in #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 #18779 (comment) 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 Differential Revision: [D32684852](https://our.internmc.facebook.com/intern/diff/D32684852) [ghstack-poisoned]
…ement of defaultStride" `at::defaultStride` was added in #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 #18779 (comment) 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 Differential Revision: [D32684852](https://our.internmc.facebook.com/intern/diff/D32684852) [ghstack-poisoned]
…Stride" `at::defaultStride` was added in #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 #18779 (comment) 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 Differential Revision: [D32684852](https://our.internmc.facebook.com/intern/diff/D32684852) [ghstack-poisoned]
…ement of defaultStride" `at::defaultStride` was added in #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 #18779 (comment) 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 Differential Revision: [D32684852](https://our.internmc.facebook.com/intern/diff/D32684852) [ghstack-poisoned]
…Stride" `at::defaultStride` was added in #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 #18779 (comment) 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 Differential Revision: [D32684852](https://our.internmc.facebook.com/intern/diff/D32684852) [ghstack-poisoned]
…ement of defaultStride" `at::defaultStride` was added in #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 #18779 (comment) 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 Differential Revision: [D32684852](https://our.internmc.facebook.com/intern/diff/D32684852) [ghstack-poisoned]
…Stride" `at::defaultStride` was added in #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 #18779 (comment) 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 Differential Revision: [D32684852](https://our.internmc.facebook.com/intern/diff/D32684852) [ghstack-poisoned]
) Summary: Pull Request resolved: #67789 `at::defaultStride` was added in #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 #18779 (comment) 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
Stack from ghstack:
Removes tensorFromBlob() and puts equivalent functionality in at::from_blob().
Differential Revision: D14739335