Skip to content
This repository was archived by the owner on Jun 3, 2025. It is now read-only.

Commit 985079c

Browse files
authored
delete unused initializers in ONNX Quant conversion (#331)
1 parent 41573e8 commit 985079c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/sparseml/pytorch/utils/quantization/quantize_qat_export.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -972,7 +972,10 @@ def quantize_torch_qat_export(
972972
quantized_residual_add_optim(model)
973973
_remove_duplicate_quantize_ops(model)
974974
_cleanup_unused_quants(model)
975-
ONNXGraph(model).sort_nodes_topologically()
975+
976+
graph = ONNXGraph(model)
977+
graph.sort_nodes_topologically()
978+
graph.delete_unused_initializers()
976979

977980
if output_file_path:
978981
onnx.save(model, output_file_path)

0 commit comments

Comments
 (0)