Skip to content

Commit

Permalink
correct implementation of ndim in order to work in compile mode with …
Browse files Browse the repository at this point in the history
…tensorflow (see issue tensorflow/tensorflow#48612 and jonasrauber#36)
  • Loading branch information
eserie committed Apr 21, 2021
1 parent 4656839 commit 7ce3ceb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion eagerpy/tensor/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,4 @@ def __pow__(self: TensorType, exponent: TensorOrScalar) -> TensorType:
@final
@property
def ndim(self: TensorType) -> int:
return cast(int, self.raw.ndim)
return len(self.raw.shape)

0 comments on commit 7ce3ceb

Please sign in to comment.