We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8067d60 commit 81a5090Copy full SHA for 81a5090
nitorch/core/utils.py
@@ -637,7 +637,10 @@ def explore_dtype(x, n_pass=1):
637
def same_storage(x, y):
638
# type: (torch.Tensor, torch.Tensor) -> bool
639
"""Return true if `x` and `y` share the same underlying storage."""
640
- return x.storage().data_ptr() == y.storage().data_ptr()
+ if hasattr(x, 'untyped_storage'):
641
+ return x.untyped_storage().data_ptr() == y.untyped_storage().data_ptr()
642
+ else:
643
+ return x.storage().data_ptr() == y.storage().data_ptr()
644
645
646
def all_resident_tensors(no_duplicates=True):
0 commit comments