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 f1ed689 commit 7494652Copy full SHA for 7494652
tsensor/analysis.py
@@ -455,8 +455,8 @@ def istensor(x):
455
456
def _shape(v):
457
# do we have a shape and it answers len()? Should get stuff right.
458
- if hasattr(v, "shape") and hasattr(v.shape,"__len__"):
459
- if type(v.shape).__name__ == "Size":
+ if hasattr(v, "shape") and hasattr(v.shape, "__len__"):
+ if v.shape.__class__.__module__ == "torch" and v.shape.__class__.__name__ == "Size":
460
if len(v.shape)==0:
461
return None
462
return list(v.shape)
0 commit comments