Skip to content

Commit cec8fb6

Browse files
committed
Merge branch 'noklam-master' into master
2 parents f2e89ed + 2c46a54 commit cec8fb6

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

tsensor/analysis.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import os
2525
import sys
2626
import traceback
27-
import torch
2827
import inspect
2928
import hashlib
3029

@@ -456,8 +455,8 @@ def istensor(x):
456455

457456
def _shape(v):
458457
# do we have a shape and it answers len()? Should get stuff right.
459-
if hasattr(v, "shape") and hasattr(v.shape,"__len__"):
460-
if isinstance(v.shape, torch.Size):
458+
if hasattr(v, "shape") and hasattr(v.shape, "__len__"):
459+
if v.shape.__class__.__module__ == "torch" and v.shape.__class__.__name__ == "Size":
461460
if len(v.shape)==0:
462461
return None
463462
return list(v.shape)

0 commit comments

Comments
 (0)