Skip to content

Commit

Permalink
Merge pull request asyml#9 from ZhitingHu/bugfix_pengzhi
Browse files Browse the repository at this point in the history
fix bug in get_rank()
  • Loading branch information
gpengzhi authored May 8, 2019
2 parents 2a0e630 + 04a2a46 commit e01e6c6
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 e01e6c6

Please sign in to comment.