From 78ec9be3bf3cf55d8bf186a661ed4aa5a6850ca5 Mon Sep 17 00:00:00 2001 From: icolbert Date: Tue, 10 Oct 2023 14:45:28 -0700 Subject: [PATCH] Fixing backwards compatibility --- src/brevitas_examples/super_resolution/models/common.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/brevitas_examples/super_resolution/models/common.py b/src/brevitas_examples/super_resolution/models/common.py index d3022d089..124ba93e9 100644 --- a/src/brevitas_examples/super_resolution/models/common.py +++ b/src/brevitas_examples/super_resolution/models/common.py @@ -7,6 +7,7 @@ import torch.nn as nn from brevitas.core.restrict_val import RestrictValueType +from brevitas.core.restrict_val import FloatRestrictValue from brevitas.core.scaling import ScalingImplType import brevitas.nn as qnn from brevitas.nn.quant_layer import WeightQuantType @@ -25,6 +26,7 @@ class CommonIntWeightPerChannelQuant(Int8WeightPerTensorFloat): class CommonIntAccumulatorAwareWeightQuant(Int8AccumulatorAwareWeightQuant): + restrict_scaling_impl = FloatRestrictValue # backwards compatibility pre_scaling_min_val = 1e-10 scaling_min_val = 1e-10