Skip to content

Commit

Permalink
[converter] fix inhashable keys for group_tensors_pass (#348)
Browse files Browse the repository at this point in the history
  • Loading branch information
peterjc123 authored Aug 20, 2024
1 parent 7cc3d2e commit 345c1cd
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tinynn/converter/operators/optimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -928,12 +928,18 @@ def group_tensors_pass(self):
if tensor.quantization is None:
t_idx = (tensor.buffer.data, tensor.dtype, tensor.shape)
else:
scale = tensor.quantization.scale
zero_point = tensor.quantization.zero_point
if isinstance(scale, list):
scale = tuple(scale)
if isinstance(zero_point, list):
zero_point = tuple(zero_point)
t_idx = (
tensor.buffer.data,
tensor.dtype,
tensor.shape,
tensor.quantization.scale,
tensor.quantization.zero_point,
scale,
zero_point,
tensor.quantization.dim,
)

Expand Down

0 comments on commit 345c1cd

Please sign in to comment.