Skip to content

Commit

Permalink
[quantizer] set int16 scale for cell act (#338)
Browse files Browse the repository at this point in the history
  • Loading branch information
peterjc123 authored Jul 5, 2024
1 parent 3307632 commit 6d0bfb5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tinynn/converter/operators/hybrid_quantizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def int16_lstm_pass(self):

cell_state_indices = CELL_STATE_MAPPING.get(node['node_type'])
for cell_state_idx in cell_state_indices:
node['op'].inputs[cell_state_idx].quantization = tfl.QuantizationParameters(0.00048828125, 0)
node['op'].inputs[cell_state_idx].quantization = tfl.QuantizationParameters(1 / 32768, 0)
node['op'].inputs[cell_state_idx].tensor = (
node['op'].inputs[cell_state_idx].tensor.astype(np.int16)
)
Expand Down

0 comments on commit 6d0bfb5

Please sign in to comment.