Skip to content

Commit

Permalink
Merge branch 'noklam-master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
parrt committed Oct 10, 2020
2 parents f2e89ed + 2c46a54 commit cec8fb6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tsensor/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import os
import sys
import traceback
import torch
import inspect
import hashlib

Expand Down Expand Up @@ -456,8 +455,8 @@ def istensor(x):

def _shape(v):
# do we have a shape and it answers len()? Should get stuff right.
if hasattr(v, "shape") and hasattr(v.shape,"__len__"):
if isinstance(v.shape, torch.Size):
if hasattr(v, "shape") and hasattr(v.shape, "__len__"):
if v.shape.__class__.__module__ == "torch" and v.shape.__class__.__name__ == "Size":
if len(v.shape)==0:
return None
return list(v.shape)
Expand Down

0 comments on commit cec8fb6

Please sign in to comment.