onnxscript 0.7.2.dev20260903__tar.gz → 0.7.2.dev20260905__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {onnxscript-0.7.2.dev20260903/onnxscript.egg-info → onnxscript-0.7.2.dev20260905}/PKG-INFO +2 -2
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/function_libs/torch_lib/ops/core.py +147 -85
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905/onnxscript.egg-info}/PKG-INFO +2 -2
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/LICENSE +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/MANIFEST.in +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/README.md +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/VERSION +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/__init__.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/_framework_apis/__init__.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/_framework_apis/torch_2_11.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/_framework_apis/torch_2_5.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/_framework_apis/torch_2_6.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/_framework_apis/torch_2_7.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/_framework_apis/torch_2_8.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/_framework_apis/torch_2_9.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/_internal/__init__.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/_internal/_inference.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/_internal/_inliner.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/_internal/analysis.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/_internal/ast_utils.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/_internal/autocast.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/_internal/builder.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/_internal/converter.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/_internal/deprecation.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/_internal/evaluator.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/_internal/irbuilder.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/_internal/main.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/_internal/param_manipulation.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/_internal/sourceinfo.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/_internal/tape_builder.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/_internal/type_annotation.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/_internal/utils.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/_internal/values.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/_internal/version_utils.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/backend/__init__.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/backend/onnx_backend.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/backend/onnx_export.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/evaluator.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/function_libs/tools/torch_lib/deduce_type_constraints.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/function_libs/tools/torch_lib/generate_aten_signatures.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/function_libs/tools/torch_lib/generate_prims_signatures.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/function_libs/torch_lib/__init__.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/function_libs/torch_lib/_constants.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/function_libs/torch_lib/_flags.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/function_libs/torch_lib/graph_building/__init__.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/function_libs/torch_lib/ops/__init__.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/function_libs/torch_lib/ops/common.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/function_libs/torch_lib/ops/fft.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/function_libs/torch_lib/ops/linalg.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/function_libs/torch_lib/ops/nested.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/function_libs/torch_lib/ops/nn.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/function_libs/torch_lib/ops/prims.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/function_libs/torch_lib/ops/quantized_decomposed.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/function_libs/torch_lib/ops/sparse.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/function_libs/torch_lib/ops/special.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/function_libs/torch_lib/ops/vision.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/function_libs/torch_lib/registration.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/function_libs/torch_lib/tensor_typing.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/ir/__init__.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/ir/_schemas.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/ir/convenience.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/ir/passes/__init__.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/ir/passes/common/__init__.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/nn/__init__.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/nn/_module.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/nn/_module_list.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/nn/_parameter.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/nn/_sequential.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/onnx_opset/__init__.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/onnx_opset/_impl/opset1.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/onnx_opset/_impl/opset10.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/onnx_opset/_impl/opset11.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/onnx_opset/_impl/opset12.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/onnx_opset/_impl/opset13.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/onnx_opset/_impl/opset14.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/onnx_opset/_impl/opset15.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/onnx_opset/_impl/opset16.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/onnx_opset/_impl/opset17.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/onnx_opset/_impl/opset18.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/onnx_opset/_impl/opset19.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/onnx_opset/_impl/opset2.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/onnx_opset/_impl/opset20.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/onnx_opset/_impl/opset21.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/onnx_opset/_impl/opset22.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/onnx_opset/_impl/opset23.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/onnx_opset/_impl/opset24.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/onnx_opset/_impl/opset25.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/onnx_opset/_impl/opset26.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/onnx_opset/_impl/opset27.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/onnx_opset/_impl/opset3.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/onnx_opset/_impl/opset4.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/onnx_opset/_impl/opset5.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/onnx_opset/_impl/opset6.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/onnx_opset/_impl/opset7.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/onnx_opset/_impl/opset8.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/onnx_opset/_impl/opset9.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/onnx_opset/_impl/opset_ai_onnx_ml1.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/onnx_opset/_impl/opset_ai_onnx_ml2.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/onnx_opset/_impl/opset_ai_onnx_ml3.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/onnx_opset/_impl/opset_ai_onnx_ml4.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/onnx_opset/_impl/opset_ai_onnx_ml5.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/onnx_opset/_impl/opset_ai_onnx_preview1.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/onnx_types.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/optimizer/__init__.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/optimizer/_constant_folding.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/optimizer/_optimizer.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/py.typed +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/__init__.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/_basics.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/_context.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/_fusion_utils.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/_ir_utils.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/_matcher.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/_pattern_ir.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/_rewrite_rule.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/models/_bart_encoder.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/models/_phi2lm.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/models/_phi4lm.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/models/_rotary_embedding_models.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/models/_smollm_1.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/models/_smollm_2.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/models/_test_models.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/models/_whisper_decoder.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/models/_whisper_encoder.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/onnx_fusions/__init__.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/onnx_fusions/_onnx_fusions.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/onnxruntime/__init__.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/onnxruntime/bfloat16_utils/bfloat16_converter.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/ort_fusions/__init__.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/ort_fusions/_core.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/ort_fusions/_test_utils.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/ort_fusions/attention.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/ort_fusions/bias_gelu.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/ort_fusions/cos_sin_cache.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/ort_fusions/erfgelu.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/ort_fusions/fused_matmul_rule_sets.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/ort_fusions/gelu.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/ort_fusions/gqa.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/ort_fusions/gqa_packed_qkv.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/ort_fusions/group_normalization_merge_silu.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/ort_fusions/instance_to_group_normalization.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/ort_fusions/mha.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/ort_fusions/mha_bias.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/ort_fusions/mha_scale.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/ort_fusions/rms_normalization.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/ort_fusions/rotary_embedding.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/ort_fusions/sdpa.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/ort_fusions/sdpa_via_mha.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/ort_fusions/shape_optimization.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/ort_fusions/skip_normalization.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/ort_fusions/softmax.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/pattern.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/rules/__init__.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/rules/common/__init__.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/rules/common/_basic_rules.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/rules/common/_broadcast_to_matmul.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/rules/common/_cast_constant_of_shape.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/rules/common/_collapse_slices.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/rules/common/_fuse_batchnorm.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/rules/common/_fuse_conv_affine.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/rules/common/_fuse_hardswish.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/rules/common/_fuse_pad_into_conv.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/rules/common/_fuse_relus_clips.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/rules/common/_gemm_to_matmul_add.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/rules/common/_materialize_reshape_shape.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/rules/common/_matmul_add_to_gemm.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/rules/common/_min_max_to_clip.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/rules/common/_no_op.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/rules/common/_redundant_scatter_nd.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/rules/common/_remove_expand_before_binary_op.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/rules/common/_remove_optional_bias.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/rules/fusion/__init__.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/rules/fusion/_gqa.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/rules/fusion/_layer_norm.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/rules/fusion/_rms_normalization.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/rules/fusion/_rotary_embedding.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/rewriter/testing.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/tensor.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/testing/__init__.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/tools/__init__.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/tools/memory_peak.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/tools/transformers_models/__init__.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/tools/transformers_models/llama.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/tools/transformers_models/mistral.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/tools/transformers_models/phi.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/tools/transformers_models/phi3.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/utils/__init__.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/utils/evaluation_utils.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/utils/metadata_merger.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/utils/replace.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/utils/timing_utils.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/utils/utils.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/values.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/version_converter/__init__.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/version_converter/_c_api_utils.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/version_converter/_version_converter.py +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript.egg-info/SOURCES.txt +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript.egg-info/dependency_links.txt +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript.egg-info/requires.txt +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript.egg-info/top_level.txt +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/pyproject.toml +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/setup.cfg +0 -0
- {onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: onnxscript
|
|
3
|
-
Version: 0.7.2.
|
|
3
|
+
Version: 0.7.2.dev20260905
|
|
4
4
|
Summary: Naturally author ONNX functions and models using a subset of Python
|
|
5
5
|
Author-email: Microsoft Corporation <onnx@microsoft.com>
|
|
6
6
|
License: MIT License
|
|
@@ -27,7 +27,7 @@ License: MIT License
|
|
|
27
27
|
|
|
28
28
|
Project-URL: Homepage, https://microsoft.github.io/onnxscript/
|
|
29
29
|
Project-URL: Repository, https://github.com/microsoft/onnxscript
|
|
30
|
-
Project-URL: Commit, https://github.com/microsoft/onnxscript/tree/
|
|
30
|
+
Project-URL: Commit, https://github.com/microsoft/onnxscript/tree/d1c005d158f40020597a0b35fd681c4f5286378f
|
|
31
31
|
Classifier: Development Status :: 4 - Beta
|
|
32
32
|
Classifier: Environment :: Console
|
|
33
33
|
Classifier: Intended Audience :: Developers
|
|
@@ -57,6 +57,7 @@ _INT32_MAX = 2147483647
|
|
|
57
57
|
_INT64_MAX = 9223372036854775807
|
|
58
58
|
_INT64_MIN = -9223372036854775808
|
|
59
59
|
_MATH_PI = math.pi
|
|
60
|
+
_AS_STRIDED_STATIC_INDEX_SIZE_LIMIT = 512 * 512
|
|
60
61
|
|
|
61
62
|
|
|
62
63
|
@functools.lru_cache(maxsize=None)
|
|
@@ -900,76 +901,92 @@ def aten_argwhere(self: TensorType) -> TensorType:
|
|
|
900
901
|
|
|
901
902
|
@torch_op("aten::as_strided", trace_only=True)
|
|
902
903
|
def aten_as_strided(
|
|
903
|
-
self: TTensor,
|
|
904
|
+
self: TTensor,
|
|
905
|
+
size: Sequence[INT64],
|
|
906
|
+
stride: Sequence[INT64],
|
|
907
|
+
storage_offset: Optional[INT64] = None,
|
|
904
908
|
) -> TTensor:
|
|
905
909
|
"""as_strided(Tensor(a) self, SymInt[] size, SymInt[] stride, SymInt? storage_offset=None) -> Tensor(a)"""
|
|
906
910
|
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
#
|
|
916
|
-
|
|
917
|
-
#
|
|
918
|
-
#
|
|
919
|
-
#
|
|
920
|
-
# i = 1
|
|
921
|
-
# indices=[0,3,6,9], add_value=[0,1,2]
|
|
922
|
-
# expand(shape=[3,4] to [[0,3,6,9],[0,3,6,9],[0,3,6,9]]
|
|
923
|
-
# indices + add_value = [[0,3,6,9],[1,3,7,10],[2,5,8,11]]
|
|
924
|
-
# i = 2
|
|
925
|
-
# indices = [[0,3,6,9],[1,3,7,10],[2,5,8,11]], add_value=[0,2]
|
|
926
|
-
# expand(shape=[2,3,4]) to [[[0,3,6,9],[1,3,7,10],[2,5,8,11]]],[[0,3,6,9],[1,3,7,10],[2,5,8,11]]]
|
|
927
|
-
# indices + add_value = [[[0,3,6,9],[1,3,7,10],[2,5,8,11]]],[[2,5,8,11],[3,5,9,12],[4,7,10,13]]]
|
|
928
|
-
neg_1 = op.Constant(value_ints=[-1])
|
|
929
|
-
rank_tensor = op.Reshape(rank, neg_1) # should be 3
|
|
930
|
-
# The final indices for op.Gather(data, indices), will be continually changed during the loop
|
|
931
|
-
indices = op.Constant(value_int=0)
|
|
932
|
-
one_seq = op.SequenceEmpty()
|
|
933
|
-
for i in range(rank):
|
|
934
|
-
# Get the index from back to front, should be 2,1,0 when to i=0,1,2
|
|
935
|
-
j = rank - i - 1
|
|
936
|
-
j_tensor = op.Reshape(j, neg_1)
|
|
937
|
-
# Get size according to index_j, should be 4,3,2 when i=0,1,2
|
|
938
|
-
size_dim_j = op.Gather(size, j_tensor, axis=0)
|
|
939
|
-
# Get right size according to index_j, should be [4],[3,4],[2,3,4] when i=0,1,2
|
|
940
|
-
size_after_j = op.Slice(size, j_tensor, rank_tensor)
|
|
941
|
-
# Get stride according to index_j, should be 3,1,2 when i=0,1,2
|
|
942
|
-
stride_dim_j = op.Gather(stride, j_tensor, axis=0)
|
|
943
|
-
indices = op.Expand(indices, size_after_j)
|
|
944
|
-
# When size[j]=4, stride[j]=3, then add_value = [0,1,2,3] * 3 = [0,3,6,9]
|
|
945
|
-
# When size[j]=3, stride[j]=1, then add_value = [0,1,2] * 1 = [0,1,2]
|
|
946
|
-
# When size[j]=2, stride[j]=2, then add_value = [0,1] * 2 = [0,2]
|
|
947
|
-
add_value = op.Range(0, size_dim_j, 1) * stride_dim_j
|
|
948
|
-
# Compute the shape for add_value for correct broadcasting
|
|
949
|
-
if i == 0:
|
|
950
|
-
# shape = [dim_size]
|
|
951
|
-
shape = size_dim_j
|
|
952
|
-
else:
|
|
953
|
-
# shape = [dim_size, 1, 1, ...], the count of 1 euqal to i
|
|
954
|
-
ones = op.ConcatFromSequence(one_seq, axis=0)
|
|
955
|
-
shape = op.Concat(op.Cast(size_dim_j, to=FLOAT.dtype), ones, axis=0)
|
|
956
|
-
shape = op.Cast(shape, to=INT64.dtype)
|
|
957
|
-
|
|
958
|
-
add_value = op.Reshape(add_value, shape)
|
|
959
|
-
# Broadcasting add value to indices according to size and stride value
|
|
960
|
-
indices = indices + add_value
|
|
961
|
-
# Dims after dim_size to reshape(add_value), should be [1],[1,1],[1,1,1] when i=0,1,2
|
|
962
|
-
one_seq = op.SequenceInsert(one_seq, op.Constant(value_floats=[1.0]))
|
|
963
|
-
|
|
911
|
+
# torch.as_strided produces a view of `self`'s underlying linear storage
|
|
912
|
+
# with the requested `size` (the output shape) and `stride` (the step, in
|
|
913
|
+
# elements of storage, taken along each output dimension), starting at
|
|
914
|
+
# `storage_offset` elements into the storage. For an output element at
|
|
915
|
+
# position (i_0, ..., i_{n-1}) the element read from storage lives at the flat
|
|
916
|
+
# index storage_offset + sum_d i_d * stride[d]. So if we flatten `self` to 1-D
|
|
917
|
+
# and gather it with a tensor of those flat indices shaped like the output, we
|
|
918
|
+
# reproduce the view as a single Gather. This avoids the hard-to-fold loop of
|
|
919
|
+
# the previous implementation.
|
|
920
|
+
rank = len(size)
|
|
921
|
+
# ONNX exposes logical values, not backing storage. Flattening is correct only
|
|
922
|
+
# when logical row-major order matches storage order; non-contiguous views remain
|
|
923
|
+
# unsupported, as they were in the previous lowering.
|
|
964
924
|
self_flatten = op.Reshape(self, op.Constant(value_ints=[-1]))
|
|
965
|
-
indices = op.Add(indices, storage_offset)
|
|
966
|
-
result = op.Gather(self_flatten, indices)
|
|
967
925
|
|
|
968
|
-
|
|
926
|
+
# A missing storage_offset means "start at the beginning of the storage".
|
|
927
|
+
if storage_offset is None:
|
|
928
|
+
storage_offset = 0
|
|
929
|
+
|
|
930
|
+
static_inputs = (
|
|
931
|
+
all(isinstance(s, int) for s in size)
|
|
932
|
+
and all(isinstance(s, int) for s in stride)
|
|
933
|
+
and isinstance(storage_offset, int)
|
|
934
|
+
)
|
|
935
|
+
static_index_count = math.prod(size) if static_inputs else None
|
|
936
|
+
if (
|
|
937
|
+
static_index_count is not None
|
|
938
|
+
and static_index_count <= _AS_STRIDED_STATIC_INDEX_SIZE_LIMIT
|
|
939
|
+
):
|
|
940
|
+
# Static fast path: every size/stride/offset is known at trace time, so we
|
|
941
|
+
# compute the full index tensor with NumPy and emit it as a single
|
|
942
|
+
# constant that downstream passes can fold trivially.
|
|
943
|
+
# Start from the storage_offset; the per-dimension contributions are added in.
|
|
944
|
+
indices = np.array(storage_offset, dtype=np.int64)
|
|
945
|
+
for dim, (dim_size, dim_stride) in enumerate(zip(size, stride)):
|
|
946
|
+
# Contribution of dimension `dim`: index i_dim contributes i_dim * stride[dim].
|
|
947
|
+
add_value = np.arange(dim_size, dtype=np.int64) * dim_stride
|
|
948
|
+
# Reshape that 1-D contribution so it broadcasts along `dim` only
|
|
949
|
+
# (length dim_size at position `dim`, length 1 everywhere else), which
|
|
950
|
+
# lets the running sum build the full n-D index grid.
|
|
951
|
+
broadcast_shape = [1] * rank
|
|
952
|
+
broadcast_shape[dim] = dim_size
|
|
953
|
+
indices = indices + add_value.reshape(broadcast_shape)
|
|
954
|
+
indices = op.Constant(value=ir.tensor(indices))
|
|
955
|
+
else:
|
|
956
|
+
# Build runtime indices when a SymInt is dynamic or a static index tensor
|
|
957
|
+
# would exceed the optimizer's default folded-output size limit. The loop
|
|
958
|
+
# is unrolled at trace time because rank is static, so no Loop/Scan is emitted.
|
|
959
|
+
zero = op.Constant(value_int=0)
|
|
960
|
+
one = op.Constant(value_int=1)
|
|
961
|
+
# `scalar_shape` reshapes a value to a 0-D scalar (shape []).
|
|
962
|
+
scalar_shape = op.Constant(value=ir.tensor(np.array([], dtype=np.int64)))
|
|
963
|
+
# Start the running index from storage_offset as an INT64 scalar; SymInt
|
|
964
|
+
# runtime values are assumed to be INT64.
|
|
965
|
+
indices = op.Reshape(storage_offset, scalar_shape)
|
|
966
|
+
for dim in range(rank):
|
|
967
|
+
# Reshape this dimension's size and stride to INT64 scalars.
|
|
968
|
+
dim_size = op.Reshape(size[dim], scalar_shape)
|
|
969
|
+
dim_stride = op.Reshape(stride[dim], scalar_shape)
|
|
970
|
+
# add_value = arange(dim_size) * dim_stride, a 1-D tensor of length dim_size
|
|
971
|
+
# holding the storage offsets contributed by index 0..dim_size-1 along `dim`.
|
|
972
|
+
add_value = op.Mul(op.Range(zero, dim_size, one), dim_stride)
|
|
973
|
+
# Insert singleton axes everywhere except `dim` so this 1-D contribution
|
|
974
|
+
# broadcasts along dimension `dim` only when added to the running index,
|
|
975
|
+
# matching the NumPy `reshape(broadcast_shape)` in the static path.
|
|
976
|
+
unsqueeze_axes = [axis for axis in range(rank) if axis != dim]
|
|
977
|
+
if unsqueeze_axes:
|
|
978
|
+
add_value = op.Unsqueeze(add_value, op.Constant(value_ints=unsqueeze_axes))
|
|
979
|
+
indices = op.Add(indices, add_value)
|
|
980
|
+
|
|
981
|
+
# `indices` now has shape `size`; gathering yields the strided view.
|
|
982
|
+
return op.Gather(self_flatten, indices)
|
|
969
983
|
|
|
970
984
|
|
|
971
985
|
def aten_as_strided_copy(
|
|
972
|
-
self: TensorType,
|
|
986
|
+
self: TensorType,
|
|
987
|
+
size: Sequence[INT64],
|
|
988
|
+
stride: Sequence[INT64],
|
|
989
|
+
storage_offset: Optional[INT64] = None,
|
|
973
990
|
) -> TensorType:
|
|
974
991
|
"""as_strided_copy(Tensor self, SymInt[] size, SymInt[] stride, SymInt? storage_offset=None) -> Tensor"""
|
|
975
992
|
|
|
@@ -979,8 +996,8 @@ def aten_as_strided_copy(
|
|
|
979
996
|
def aten_as_strided_scatter(
|
|
980
997
|
self: TensorType,
|
|
981
998
|
src: TensorType,
|
|
982
|
-
size: INT64,
|
|
983
|
-
stride: INT64,
|
|
999
|
+
size: Sequence[INT64],
|
|
1000
|
+
stride: Sequence[INT64],
|
|
984
1001
|
storage_offset: Optional[INT64] = None,
|
|
985
1002
|
) -> TensorType:
|
|
986
1003
|
"""as_strided_scatter(Tensor self, Tensor src, SymInt[] size, SymInt[] stride, SymInt? storage_offset=None) -> Tensor"""
|
|
@@ -3724,7 +3741,7 @@ def aten_empty_quantized(
|
|
|
3724
3741
|
@torch_op("aten::empty_strided", trace_only=True)
|
|
3725
3742
|
def aten_empty_strided(
|
|
3726
3743
|
size: Sequence[INT64],
|
|
3727
|
-
stride: INT64,
|
|
3744
|
+
stride: Sequence[INT64],
|
|
3728
3745
|
layout: str = "",
|
|
3729
3746
|
dtype: int = FLOAT.dtype,
|
|
3730
3747
|
device: str = "",
|
|
@@ -4673,6 +4690,27 @@ def aten_grid_sampler_3d_backward(
|
|
|
4673
4690
|
raise NotImplementedError()
|
|
4674
4691
|
|
|
4675
4692
|
|
|
4693
|
+
@torch_op("aten::_grouped_mm", trace_only=True)
|
|
4694
|
+
def aten_grouped_mm(
|
|
4695
|
+
self: TFloat,
|
|
4696
|
+
mat2: TFloat,
|
|
4697
|
+
offs: Optional[TInt] = None,
|
|
4698
|
+
bias: Optional[TFloat] = None,
|
|
4699
|
+
out_dtype: int = -1,
|
|
4700
|
+
) -> TFloat:
|
|
4701
|
+
"""_grouped_mm(Tensor self, Tensor mat2, *, Tensor? offs=None, Tensor? bias=None, int? out_dtype=None) -> Tensor"""
|
|
4702
|
+
|
|
4703
|
+
if offs is not None:
|
|
4704
|
+
raise NotImplementedError("Grouped matmul with offsets (ragged/MoE) is not supported.")
|
|
4705
|
+
|
|
4706
|
+
res = op.MatMul(self, mat2)
|
|
4707
|
+
if bias is not None:
|
|
4708
|
+
res = op.Add(res, bias)
|
|
4709
|
+
if out_dtype is not None and out_dtype != -1:
|
|
4710
|
+
res = op.Cast(res, to=out_dtype)
|
|
4711
|
+
return res
|
|
4712
|
+
|
|
4713
|
+
|
|
4676
4714
|
def aten_gru_cell(
|
|
4677
4715
|
input: TensorType,
|
|
4678
4716
|
hx: TensorType,
|
|
@@ -7560,8 +7598,8 @@ def aten_new_empty(
|
|
|
7560
7598
|
@torch_op("aten::new_empty_strided", trace_only=True)
|
|
7561
7599
|
def aten_new_empty_strided(
|
|
7562
7600
|
self: TTensor,
|
|
7563
|
-
size: INT64,
|
|
7564
|
-
stride: INT64,
|
|
7601
|
+
size: Sequence[INT64],
|
|
7602
|
+
stride: Sequence[INT64],
|
|
7565
7603
|
dtype: int = -1,
|
|
7566
7604
|
layout: str = "",
|
|
7567
7605
|
device: str = "",
|
|
@@ -7570,6 +7608,7 @@ def aten_new_empty_strided(
|
|
|
7570
7608
|
"""new_empty_strided(Tensor self, SymInt[] size, SymInt[] stride, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None) -> Tensor"""
|
|
7571
7609
|
|
|
7572
7610
|
# using zero to simulate empty array
|
|
7611
|
+
size = common_ops.merge_dims(size)
|
|
7573
7612
|
zero = op.ConstantOfShape(size)
|
|
7574
7613
|
if dtype == -1:
|
|
7575
7614
|
return op.CastLike(zero, self)
|
|
@@ -8751,7 +8790,9 @@ def aten_roll(self: TTensor, shifts: Sequence[int], dims: Sequence[int] = ()) ->
|
|
|
8751
8790
|
self_rank = len(self.shape)
|
|
8752
8791
|
if self_rank == 0:
|
|
8753
8792
|
return op.Identity(self)
|
|
8754
|
-
elif self.shape
|
|
8793
|
+
elif 0 in self.shape:
|
|
8794
|
+
# A tensor with no elements rolls to itself, which is what torch returns. It is
|
|
8795
|
+
# also what keeps a zero length out of the modulo in the helpers below.
|
|
8755
8796
|
return op.Identity(self)
|
|
8756
8797
|
|
|
8757
8798
|
# NOTE: In pytorch, default value of dims is an empty list.
|
|
@@ -8763,6 +8804,9 @@ def aten_roll(self: TTensor, shifts: Sequence[int], dims: Sequence[int] = ()) ->
|
|
|
8763
8804
|
result = self
|
|
8764
8805
|
for i, shift in enumerate(shifts):
|
|
8765
8806
|
dim = dims[i]
|
|
8807
|
+
# PyTorch accepts negative dim as reversed counting
|
|
8808
|
+
if dim < 0:
|
|
8809
|
+
dim = self_rank + dim
|
|
8766
8810
|
result = _aten_roll_shift_and_dim_onnx(result, shift, dim)
|
|
8767
8811
|
return result
|
|
8768
8812
|
|
|
@@ -8783,7 +8827,10 @@ def aten_roll_complex(
|
|
|
8783
8827
|
if self_rank == 1:
|
|
8784
8828
|
return op.Identity(self)
|
|
8785
8829
|
|
|
8786
|
-
if self.shape
|
|
8830
|
+
if 0 in self.shape:
|
|
8831
|
+
# Same as aten_roll: a tensor with no elements rolls to itself. The trailing
|
|
8832
|
+
# dimension that carries the real and imaginary parts is never zero, so this
|
|
8833
|
+
# only ever sees a dimension torch can see.
|
|
8787
8834
|
return op.Identity(self)
|
|
8788
8835
|
|
|
8789
8836
|
self_real = op.Slice(self, [0], [1], axes=[-1])
|
|
@@ -8798,6 +8845,9 @@ def aten_roll_complex(
|
|
|
8798
8845
|
else:
|
|
8799
8846
|
assert len(shifts) == len(dims)
|
|
8800
8847
|
for i, dim in enumerate(dims):
|
|
8848
|
+
if dim < 0:
|
|
8849
|
+
# Account for the complex dimension in ONNX
|
|
8850
|
+
dim = self_rank + dim - 1
|
|
8801
8851
|
self_real = _aten_roll_shift_and_dim_onnx(self_real, shifts[i], dim)
|
|
8802
8852
|
self_imag = _aten_roll_shift_and_dim_onnx(self_imag, shifts[i], dim)
|
|
8803
8853
|
|
|
@@ -8806,36 +8856,48 @@ def aten_roll_complex(
|
|
|
8806
8856
|
|
|
8807
8857
|
|
|
8808
8858
|
def _aten_roll_shift_no_dim_onnx(self: TTensor, shift: int) -> TTensor:
|
|
8859
|
+
# The element count is the divisor of the Mod below, and Mod by zero is undefined in
|
|
8860
|
+
# ONNX. Both callers return a tensor with no elements unchanged before reaching here.
|
|
8861
|
+
assert self.shape is None or 0 not in self.shape, (
|
|
8862
|
+
"the element count must not be zero because Mod by zero is undefined"
|
|
8863
|
+
)
|
|
8864
|
+
|
|
8809
8865
|
neg_1 = op.Constant(value_ints=[-1])
|
|
8810
8866
|
# flatten the self tensor: from [[A,B],[C,D]] to [A,B,C,D]
|
|
8811
8867
|
self_flatten = op.Reshape(self, neg_1)
|
|
8812
|
-
|
|
8813
|
-
|
|
8814
|
-
|
|
8815
|
-
|
|
8816
|
-
|
|
8817
|
-
# For [A,B,C,D], if shift is 1, slice_length = 4 - 1 = 3, means move [A,B,C] to the end
|
|
8818
|
-
# The effect equals to move [D] to the beginning
|
|
8819
|
-
slice_length = op.Size(self_flatten) - op.Constant(value_ints=[shift])
|
|
8868
|
+
total_length = op.Shape(self_flatten)
|
|
8869
|
+
# Compute slice length. roll is circular, so the shift is taken modulo the number
|
|
8870
|
+
# of elements. For [A,B,C,D], if shift is 1, slice_length = 3, means move [A,B,C]
|
|
8871
|
+
# to the end. The effect equals to move [D] to the beginning.
|
|
8872
|
+
slice_length = op.Mod(op.Constant(value_ints=[-shift]), total_length)
|
|
8820
8873
|
# Get second part of the tensor, e.g. [A,B,C]
|
|
8821
8874
|
suffix = op.Slice(self_flatten, op.Constant(value_ints=[0]), slice_length)
|
|
8822
8875
|
# Get first part of the tensor, e.g. [D]
|
|
8823
|
-
prefix = op.Slice(self_flatten, slice_length,
|
|
8876
|
+
prefix = op.Slice(self_flatten, slice_length, total_length)
|
|
8824
8877
|
# Concat first+second together, e.g. [D,A,B,C]
|
|
8825
8878
|
result = op.Concat(prefix, suffix, axis=0)
|
|
8826
|
-
|
|
8879
|
+
# allowzero so a dimension that is only zero at run time stays zero here, rather than
|
|
8880
|
+
# being read as "copy the input dimension" against a flattened tensor.
|
|
8881
|
+
return op.Reshape(result, op.Shape(self), allowzero=True)
|
|
8827
8882
|
|
|
8828
8883
|
|
|
8829
8884
|
def _aten_roll_shift_and_dim_onnx(self: TTensor, shift: int, dim: int) -> TTensor:
|
|
8830
|
-
|
|
8885
|
+
# dim must already be normalized to a nonnegative axis, because Shape below
|
|
8886
|
+
# reads an empty range when start is negative and end is zero.
|
|
8887
|
+
# The length of that dimension is the divisor of the Mod below, and Mod by zero is
|
|
8888
|
+
# undefined in ONNX. Both callers return a tensor with no elements unchanged before
|
|
8889
|
+
# reaching here.
|
|
8890
|
+
assert self.shape is None or self.shape[dim] != 0, (
|
|
8891
|
+
"the dimension length must not be zero because Mod by zero is undefined"
|
|
8892
|
+
)
|
|
8893
|
+
|
|
8831
8894
|
dim_tensor = op.Constant(value_ints=[dim])
|
|
8832
|
-
|
|
8833
|
-
|
|
8834
|
-
|
|
8835
|
-
slice_length = op.Shape(self, start=dim, end=dim + 1) - op.Constant(value_ints=[shift])
|
|
8895
|
+
dim_length = op.Shape(self, start=dim, end=dim + 1)
|
|
8896
|
+
# roll is circular, so the shift is taken modulo the length of the dimension
|
|
8897
|
+
slice_length = op.Mod(op.Constant(value_ints=[-shift]), dim_length)
|
|
8836
8898
|
# from [A,B,C,D] -> [D,A,B,C], [D] is prefix, [A,B,C] is suffix
|
|
8837
8899
|
suffix = op.Slice(self, op.Constant(value_ints=[0]), slice_length, axes=dim_tensor)
|
|
8838
|
-
prefix = op.Slice(self, slice_length,
|
|
8900
|
+
prefix = op.Slice(self, slice_length, dim_length, axes=dim_tensor)
|
|
8839
8901
|
result = op.Concat(prefix, suffix, axis=dim)
|
|
8840
8902
|
return result
|
|
8841
8903
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: onnxscript
|
|
3
|
-
Version: 0.7.2.
|
|
3
|
+
Version: 0.7.2.dev20260905
|
|
4
4
|
Summary: Naturally author ONNX functions and models using a subset of Python
|
|
5
5
|
Author-email: Microsoft Corporation <onnx@microsoft.com>
|
|
6
6
|
License: MIT License
|
|
@@ -27,7 +27,7 @@ License: MIT License
|
|
|
27
27
|
|
|
28
28
|
Project-URL: Homepage, https://microsoft.github.io/onnxscript/
|
|
29
29
|
Project-URL: Repository, https://github.com/microsoft/onnxscript
|
|
30
|
-
Project-URL: Commit, https://github.com/microsoft/onnxscript/tree/
|
|
30
|
+
Project-URL: Commit, https://github.com/microsoft/onnxscript/tree/d1c005d158f40020597a0b35fd681c4f5286378f
|
|
31
31
|
Classifier: Development Status :: 4 - Beta
|
|
32
32
|
Classifier: Environment :: Console
|
|
33
33
|
Classifier: Intended Audience :: Developers
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/_framework_apis/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/_internal/__init__.py
RENAMED
|
File without changes
|
{onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/_internal/_inference.py
RENAMED
|
File without changes
|
{onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/_internal/_inliner.py
RENAMED
|
File without changes
|
{onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/_internal/analysis.py
RENAMED
|
File without changes
|
{onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/_internal/ast_utils.py
RENAMED
|
File without changes
|
{onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/_internal/autocast.py
RENAMED
|
File without changes
|
{onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/_internal/builder.py
RENAMED
|
File without changes
|
{onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/_internal/converter.py
RENAMED
|
File without changes
|
{onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/_internal/deprecation.py
RENAMED
|
File without changes
|
{onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/_internal/evaluator.py
RENAMED
|
File without changes
|
{onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/_internal/irbuilder.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/_internal/sourceinfo.py
RENAMED
|
File without changes
|
{onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/_internal/tape_builder.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/_internal/values.py
RENAMED
|
File without changes
|
{onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/_internal/version_utils.py
RENAMED
|
File without changes
|
{onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/backend/__init__.py
RENAMED
|
File without changes
|
{onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/backend/onnx_backend.py
RENAMED
|
File without changes
|
{onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/backend/onnx_export.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/ir/passes/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/onnx_opset/__init__.py
RENAMED
|
File without changes
|
{onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/onnx_opset/_impl/opset1.py
RENAMED
|
File without changes
|
{onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/onnx_opset/_impl/opset10.py
RENAMED
|
File without changes
|
{onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/onnx_opset/_impl/opset11.py
RENAMED
|
File without changes
|
{onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/onnx_opset/_impl/opset12.py
RENAMED
|
File without changes
|
{onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/onnx_opset/_impl/opset13.py
RENAMED
|
File without changes
|
{onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/onnx_opset/_impl/opset14.py
RENAMED
|
File without changes
|
{onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/onnx_opset/_impl/opset15.py
RENAMED
|
File without changes
|
{onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/onnx_opset/_impl/opset16.py
RENAMED
|
File without changes
|
{onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/onnx_opset/_impl/opset17.py
RENAMED
|
File without changes
|
{onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/onnx_opset/_impl/opset18.py
RENAMED
|
File without changes
|
{onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/onnx_opset/_impl/opset19.py
RENAMED
|
File without changes
|
{onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/onnx_opset/_impl/opset2.py
RENAMED
|
File without changes
|
{onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/onnx_opset/_impl/opset20.py
RENAMED
|
File without changes
|
{onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/onnx_opset/_impl/opset21.py
RENAMED
|
File without changes
|
{onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/onnx_opset/_impl/opset22.py
RENAMED
|
File without changes
|
{onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/onnx_opset/_impl/opset23.py
RENAMED
|
File without changes
|
{onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/onnx_opset/_impl/opset24.py
RENAMED
|
File without changes
|
{onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/onnx_opset/_impl/opset25.py
RENAMED
|
File without changes
|
{onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/onnx_opset/_impl/opset26.py
RENAMED
|
File without changes
|
{onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/onnx_opset/_impl/opset27.py
RENAMED
|
File without changes
|
{onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/onnx_opset/_impl/opset3.py
RENAMED
|
File without changes
|
{onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/onnx_opset/_impl/opset4.py
RENAMED
|
File without changes
|
{onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/onnx_opset/_impl/opset5.py
RENAMED
|
File without changes
|
{onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/onnx_opset/_impl/opset6.py
RENAMED
|
File without changes
|
{onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/onnx_opset/_impl/opset7.py
RENAMED
|
File without changes
|
{onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/onnx_opset/_impl/opset8.py
RENAMED
|
File without changes
|
{onnxscript-0.7.2.dev20260903 → onnxscript-0.7.2.dev20260905}/onnxscript/onnx_opset/_impl/opset9.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|