Skip to content

Commit

Permalink
[converter] same q_params for neg in mul_scalar
Browse files Browse the repository at this point in the history
  • Loading branch information
peterjc123 committed Sep 25, 2024
1 parent ba14f63 commit 557ac91
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tinynn/converter/operators/torch/quantized.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,16 @@ class QuantizedMulScalarOperator(QuantizedMulScalarSchema):
def parse(self, node, attrs, args, graph_converter):
super().parse(node, attrs, args, graph_converter)

is_neg = False
if self.input_tensors[1] in (-1, -1.0):
self.input_tensors[1] *= -1
is_neg = True

self.run(node)

if is_neg:
self.input_tensors[1] *= -1

QuantizedMulOperator.parse_common(self, node, attrs, args, graph_converter)


Expand Down

0 comments on commit 557ac91

Please sign in to comment.