Skip to content

Commit

Permalink
fix bug in get_rank()
Browse files Browse the repository at this point in the history
  • Loading branch information
gpengzhi committed May 8, 2019
1 parent 2a0e630 commit 04a2a46
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion texar/utils/shapes.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def get_rank(tensor: torch.Tensor) -> int:
`None` if the rank cannot be determined.
"""
if torch.is_tensor(tensor):
rank = len(tensor.dim())
rank = tensor.dim()
else:
array = np.asarray(tensor)
rank = array.ndim
Expand Down

0 comments on commit 04a2a46

Please sign in to comment.