[ML] ensure quantization is applied (#472)

This commit is contained in:
Benjamin Trent 2022-06-15 09:23:24 -04:00 committed by GitHub
parent 07af00c741
commit ec041ffdfd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -41,7 +41,7 @@ class TraceableModel(ABC):
def quantize(self) -> None:
torch.quantization.quantize_dynamic(
self._model, {torch.nn.Linear}, dtype=torch.qint8
self._model, {torch.nn.Linear}, dtype=torch.qint8, inplace=True
)
def trace(self) -> TracedModelTypes: