Skip to content

Commit

Permalink
[Frontend][TFLite] Use axis.size instead of len(axis) (apache#8060)
Browse files Browse the repository at this point in the history
The variable axis is an ndarray.
  • Loading branch information
Krzysztof Parzyszek authored and trevor-m committed Jun 17, 2021
1 parent 2e4618a commit 8b5c062
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/tvm/relay/frontend/tflite.py
Original file line number Diff line number Diff line change
Expand Up @@ -3148,7 +3148,7 @@ def convert_expand_dims(self, op):
input_expr = self.get_tensor_expr(input_tensors[0])
axis = self.get_tensor_value(input_tensors[1])
if isinstance(axis, np.ndarray):
assert len(axis) == 1, "only one value is expected."
assert axis.size == 1, "only one value is expected."
axis = int(axis)

ndims = len(input_tensors[0].tensor.ShapeAsNumpy())
Expand Down

0 comments on commit 8b5c062

Please sign in to comment.