Skip to content

Commit

Permalink
[Frontend][TFLite] fix apache#9078 (apache#9099)
Browse files Browse the repository at this point in the history
Co-authored-by: sunway <wei.sun@hexintek.com>
  • Loading branch information
2 people authored and ylc committed Jan 13, 2022
1 parent 97d642f commit d784f8c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions 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 @@ -775,7 +775,7 @@ def convert_softmax(self, op):
assert len(output_tensors) == 1, "output tensors length should be 1"
output_tensor = output_tensors[0]

params = {"axis": 1} # 1 is channel
params = {"axis": -1} # -1 is channel
in_expr = self.get_expr(input_tensor_idx)

# TODO - Naive softmax int8 implementation leads to bad accuracy. Currently, we can
Expand Down
1 change: 1 addition & 0 deletions tests/python/frontend/tflite/test_forward.py
Original file line number Diff line number Diff line change
Expand Up @@ -3286,6 +3286,7 @@ def _test_softmax(data):
def test_forward_softmax():
"""Softmax"""
_test_softmax(np.arange(6.0, dtype=np.float32).reshape((1, 6)))
_test_softmax(np.arange(6.0, dtype=np.float32).reshape((1, 2, 3)))


######################################################################
Expand Down

0 comments on commit d784f8c

Please sign in to comment.