Skip to content
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

[JIT] Nested fix #79480

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion aten/src/ATen/core/tensor_type.cpp
Expand Up @@ -253,7 +253,7 @@ TensorTypePtr TensorType::create(const at::Tensor& t) {
VaryingShape<size_t> stride_indices;
VaryingShape<int64_t> strides;
VaryingShape<int64_t> sizes;
if (t.layout() == at::kStrided) {
if (t.layout() == at::kStrided && !t.is_nested()) {
sizes = VaryingShape<int64_t>{t.sizes().vec()};
strides = VaryingShape<int64_t>{t.strides().vec()};
return TensorType::create(
Expand Down
2 changes: 1 addition & 1 deletion torch/csrc/jit/ir/constants.cpp
Expand Up @@ -12,7 +12,7 @@ namespace jit {
bool insertableTensor(const at::Tensor& ten) {
// bail if tensor has no storage i.e. opaque tensor used in MKLdnn.
// or gradients because we have no way of serializing them & are mutable
return !ten.requires_grad() && ten.has_storage();
return !ten.requires_grad() && ten.has_storage() && !ten.is_nested();
}

bool insertableIValue(const IValue& ivalue) {
Expand Down
3 changes: 3 additions & 0 deletions torch/csrc/jit/ir/node_hashing.cpp
Expand Up @@ -23,6 +23,9 @@ bool tensorEqual(const at::Tensor& lhs, const at::Tensor& rhs) {
if (lhs.is_mkldnn() || rhs.is_mkldnn()) {
return false;
}
if (lhs.is_nested() || rhs.is_nested()) {
return false;
}
// If device is not equal, lhs.equal(rhs) would throw an error.
if (lhs.device() != rhs.device()) {
return false;
Expand Down