Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Giuseppe5 committed Feb 23, 2024
1 parent 2241c24 commit f106c7b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/brevitas/proxy/parameter_quant.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,13 @@ def forward(self, x: Tensor, input_scale: Optional[Tensor] = None) -> Union[Ten
impl = self.export_handler if self.export_mode else self.tensor_quant
if self.requires_input_scale and input_scale is None:
raise RuntimeError("Input scale required")

if self.requires_input_scale:
input_scale = input_scale.view(-1)
out, out_scale, out_zp, out_bit_width = impl(x, input_scale)
elif not self.requires_input_scale:
out, out_scale, out_zp, out_bit_width = impl(x)
else:
raise RuntimeError("Internally defined bit-width required")
out, out_scale, out_zp, out_bit_width = impl(x)

return QuantTensor(out, out_scale, out_zp, out_bit_width, self.is_signed, self.training)
else:
return x

0 comments on commit f106c7b

Please sign in to comment.