We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0482662 commit 8041ebaCopy full SHA for 8041eba
onnxscript/optimizer/__init__.py
@@ -56,9 +56,15 @@ def optimize(
56
)
57
for _ in range(num_iterations):
58
if onnx_shape_inference:
59
- model = onnx.shape_inference.infer_shapes(
60
- model, check_type=True, strict_mode=True, data_prop=True
61
- )
+ if model.ByteSize() < 1024 * 1024 * 1024 * 2:
+ model = onnx.shape_inference.infer_shapes(
+ model, check_type=True, strict_mode=True, data_prop=True
62
+ )
63
+ else:
64
+ logger.warning(
65
+ "The model size is too large for full model shape inference. "
66
+ "Skipping this step."
67
68
69
inline_simple_functions(model)
70
modified = fold_constants(
0 commit comments