onnxscript 0.1.0.dev20231129__tar.gz → 0.1.0.dev20231201__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.1.0.dev20231129/onnxscript.egg-info → onnxscript-0.1.0.dev20231201}/PKG-INFO +2 -3
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/README.md +1 -2
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/__init__.py +1 -2
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/_internal/utils.py +0 -10
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/backend/onnx_export_test.py +3 -2
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/evaluator.py +1 -1
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/function_libs/torch_lib/graph_building.py +58 -1
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/function_libs/torch_lib/ops/core.py +130 -32
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/tests/function_libs/torch_lib/ops_test_common.py +2 -2
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/tests/function_libs/torch_lib/ops_test_data.py +44 -10
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201/onnxscript.egg-info}/PKG-INFO +2 -3
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/LICENSE +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/MANIFEST.in +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/VERSION +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/_internal/__init__.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/_internal/analysis.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/_internal/analysis_test.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/_internal/ast_utils.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/_internal/autocast.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/_internal/deprecation.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/_internal/param_manipulation.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/_internal/param_manipulation_test.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/_internal/runtime_typing.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/_internal/version_utils.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/backend/__init__.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/backend/onnx_backend.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/backend/onnx_backend_test.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/backend/onnx_export.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/converter.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/converter_test.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/diagnostics/infra/__init__.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/diagnostics/infra/_infra.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/diagnostics/infra/context.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/diagnostics/infra/decorator.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/diagnostics/infra/formatter.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/diagnostics/infra/sarif/__init__.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/diagnostics/infra/sarif/_address.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/diagnostics/infra/sarif/_artifact.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/diagnostics/infra/sarif/_artifact_change.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/diagnostics/infra/sarif/_artifact_content.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/diagnostics/infra/sarif/_artifact_location.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/diagnostics/infra/sarif/_attachment.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/diagnostics/infra/sarif/_code_flow.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/diagnostics/infra/sarif/_configuration_override.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/diagnostics/infra/sarif/_conversion.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/diagnostics/infra/sarif/_edge.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/diagnostics/infra/sarif/_edge_traversal.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/diagnostics/infra/sarif/_exception.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/diagnostics/infra/sarif/_external_properties.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/diagnostics/infra/sarif/_external_property_file_reference.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/diagnostics/infra/sarif/_external_property_file_references.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/diagnostics/infra/sarif/_fix.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/diagnostics/infra/sarif/_graph.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/diagnostics/infra/sarif/_graph_traversal.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/diagnostics/infra/sarif/_invocation.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/diagnostics/infra/sarif/_location.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/diagnostics/infra/sarif/_location_relationship.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/diagnostics/infra/sarif/_logical_location.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/diagnostics/infra/sarif/_message.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/diagnostics/infra/sarif/_multiformat_message_string.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/diagnostics/infra/sarif/_node.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/diagnostics/infra/sarif/_notification.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/diagnostics/infra/sarif/_physical_location.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/diagnostics/infra/sarif/_property_bag.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/diagnostics/infra/sarif/_rectangle.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/diagnostics/infra/sarif/_region.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/diagnostics/infra/sarif/_replacement.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/diagnostics/infra/sarif/_reporting_configuration.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/diagnostics/infra/sarif/_reporting_descriptor.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/diagnostics/infra/sarif/_reporting_descriptor_reference.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/diagnostics/infra/sarif/_reporting_descriptor_relationship.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/diagnostics/infra/sarif/_result.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/diagnostics/infra/sarif/_result_provenance.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/diagnostics/infra/sarif/_run.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/diagnostics/infra/sarif/_run_automation_details.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/diagnostics/infra/sarif/_sarif_log.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/diagnostics/infra/sarif/_special_locations.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/diagnostics/infra/sarif/_stack.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/diagnostics/infra/sarif/_stack_frame.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/diagnostics/infra/sarif/_suppression.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/diagnostics/infra/sarif/_thread_flow.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/diagnostics/infra/sarif/_thread_flow_location.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/diagnostics/infra/sarif/_tool.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/diagnostics/infra/sarif/_tool_component.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/diagnostics/infra/sarif/_tool_component_reference.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/diagnostics/infra/sarif/_translation_metadata.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/diagnostics/infra/sarif/_version_control_details.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/diagnostics/infra/sarif/_web_request.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/diagnostics/infra/sarif/_web_response.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/diagnostics/infra/sarif/version.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/diagnostics/infra/utils.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/evaluator_test.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/function_libs/tools/torch_lib/deduce_type_constraints.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/function_libs/tools/torch_lib/deduce_type_constraints_test.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/function_libs/tools/torch_lib/generate_aten_signatures.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/function_libs/tools/torch_lib/generate_prims_signatures.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/function_libs/torch_lib/__init__.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/function_libs/torch_lib/_constants.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/function_libs/torch_lib/_flags.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/function_libs/torch_lib/graph_building_test.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/function_libs/torch_lib/ops/__init__.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/function_libs/torch_lib/ops/common.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/function_libs/torch_lib/ops/fft.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/function_libs/torch_lib/ops/linalg.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/function_libs/torch_lib/ops/nested.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/function_libs/torch_lib/ops/nn.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/function_libs/torch_lib/ops/prims.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/function_libs/torch_lib/ops/sparse.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/function_libs/torch_lib/ops/special.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/function_libs/torch_lib/registration.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/function_libs/torch_lib/tensor_typing.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/irbuilder.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/main.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/onnx_opset/__init__.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/onnx_opset/_impl/opset1.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/onnx_opset/_impl/opset10.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/onnx_opset/_impl/opset11.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/onnx_opset/_impl/opset12.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/onnx_opset/_impl/opset13.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/onnx_opset/_impl/opset14.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/onnx_opset/_impl/opset15.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/onnx_opset/_impl/opset16.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/onnx_opset/_impl/opset17.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/onnx_opset/_impl/opset18.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/onnx_opset/_impl/opset19.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/onnx_opset/_impl/opset2.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/onnx_opset/_impl/opset3.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/onnx_opset/_impl/opset4.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/onnx_opset/_impl/opset5.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/onnx_opset/_impl/opset6.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/onnx_opset/_impl/opset7.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/onnx_opset/_impl/opset8.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/onnx_opset/_impl/opset9.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/onnx_opset/_impl/opset_ai_onnx_ml1.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/onnx_opset/_impl/opset_ai_onnx_ml2.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/onnx_opset/_impl/opset_ai_onnx_ml3.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/onnx_opset/_impl/opset_ai_onnx_preview_training1.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/onnx_types.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/py.typed +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/sourceinfo.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/tensor.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/tensor_test.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/testing.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/tests/__init__.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/tests/common/__init__.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/tests/common/onnx_script_test_case.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/tests/common/testutils.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/tests/eager_mode_test.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/tests/eager_test.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/tests/external_tensor_test.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/tests/function_libs/torch_lib/error_reproduction.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/tests/function_libs/torch_lib/extra_opinfo.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/tests/function_libs/torch_lib/ops_test.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/tests/functions/attr_test.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/tests/functions/gemmgelu.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/tests/functions/gemmgelu_test.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/tests/functions/if_test.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/tests/functions/onnxfns1A_test.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/tests/functions/onnxfns2_test.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/tests/functions/onnxfns_test.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/tests/functions/ort_custom_ops.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/tests/if_test.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/tests/loop_test.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/tests/models/__init__.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/tests/models/attrref.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/tests/models/cast_like.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/tests/models/different_opset.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/tests/models/dropout.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/tests/models/eager_op.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/tests/models/eg1.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/tests/models/getitem.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/tests/models/graph_attr.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/tests/models/identity.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/tests/models/if_statement.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/tests/models/loops_break.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/tests/models/loops_while.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/tests/models/m1.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/tests/models/multi.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/tests/models/onnxfns1.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/tests/models/onnxfns1A.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/tests/models/onnxfns2.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/tests/models/opt_input.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/tests/models/opt_output.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/tests/models/renaming.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/tests/models/sequences.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/tests/models/signal_dft.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/tests/models/subfunction.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/tests/models/type_double.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/tests/onnx_types_test.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/tests/operator_test.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/type_annotation.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/type_annotation_test.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/values.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/values_test.py +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript.egg-info/SOURCES.txt +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript.egg-info/dependency_links.txt +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript.egg-info/requires.txt +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript.egg-info/top_level.txt +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/pyproject.toml +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/setup.cfg +0 -0
- {onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: onnxscript
|
|
3
|
-
Version: 0.1.0.
|
|
3
|
+
Version: 0.1.0.dev20231201
|
|
4
4
|
Summary: Naturally author ONNX functions and models using a subset of Python
|
|
5
5
|
Home-page: https://onnxscript.ai/
|
|
6
6
|
Author-email: Microsoft Corporation <onnx@microsoft.com>
|
|
@@ -111,9 +111,8 @@ pytest onnxscript
|
|
|
111
111
|
import onnx
|
|
112
112
|
|
|
113
113
|
# We use ONNX opset 15 to define the function below.
|
|
114
|
-
from onnxscript import FLOAT
|
|
114
|
+
from onnxscript import FLOAT, script
|
|
115
115
|
from onnxscript import opset15 as op
|
|
116
|
-
from onnxscript import script
|
|
117
116
|
|
|
118
117
|
|
|
119
118
|
# We use the script decorator to indicate that
|
|
@@ -65,9 +65,8 @@ pytest onnxscript
|
|
|
65
65
|
import onnx
|
|
66
66
|
|
|
67
67
|
# We use ONNX opset 15 to define the function below.
|
|
68
|
-
from onnxscript import FLOAT
|
|
68
|
+
from onnxscript import FLOAT, script
|
|
69
69
|
from onnxscript import opset15 as op
|
|
70
|
-
from onnxscript import script
|
|
71
70
|
|
|
72
71
|
|
|
73
72
|
# We use the script decorator to indicate that
|
|
@@ -58,7 +58,7 @@ from .onnx_types import (
|
|
|
58
58
|
|
|
59
59
|
# isort: on
|
|
60
60
|
|
|
61
|
-
from ._internal.utils import external_tensor
|
|
61
|
+
from ._internal.utils import external_tensor
|
|
62
62
|
from .values import OnnxFunction, TracedOnnxFunction
|
|
63
63
|
|
|
64
64
|
try:
|
|
@@ -73,7 +73,6 @@ __all__ = [
|
|
|
73
73
|
"OnnxFunction",
|
|
74
74
|
"TracedOnnxFunction",
|
|
75
75
|
"proto2python",
|
|
76
|
-
"proto2text",
|
|
77
76
|
"external_tensor",
|
|
78
77
|
"graph",
|
|
79
78
|
"BFLOAT16",
|
|
@@ -14,16 +14,6 @@ from onnx import FunctionProto, ModelProto, TensorProto, ValueInfoProto
|
|
|
14
14
|
|
|
15
15
|
from onnxscript import tensor
|
|
16
16
|
|
|
17
|
-
# print utility unavailable in ONNX 1.12 or earlier:
|
|
18
|
-
# pylint: disable=unused-import, ungrouped-imports
|
|
19
|
-
try:
|
|
20
|
-
from onnx.printer import to_text as proto2text
|
|
21
|
-
except ImportError:
|
|
22
|
-
|
|
23
|
-
def proto2text(_: Any) -> str: # type: ignore[misc]
|
|
24
|
-
return "<print utility unavailable>"
|
|
25
|
-
|
|
26
|
-
|
|
27
17
|
# pylint: enable=unused-import, ungrouped-imports
|
|
28
18
|
|
|
29
19
|
|
{onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/backend/onnx_export_test.py
RENAMED
|
@@ -11,6 +11,7 @@ import re
|
|
|
11
11
|
import unittest
|
|
12
12
|
from typing import Pattern
|
|
13
13
|
|
|
14
|
+
import onnx
|
|
14
15
|
import onnxruntime as ort
|
|
15
16
|
import parameterized
|
|
16
17
|
from onnxruntime.capi import onnxruntime_pybind11_state
|
|
@@ -273,7 +274,7 @@ class TestOnnxBackEnd(unittest.TestCase):
|
|
|
273
274
|
except Exception as e:
|
|
274
275
|
raise AssertionError(
|
|
275
276
|
f"Unable to load onnx for test {backend_test.name!r}.\n"
|
|
276
|
-
f"{
|
|
277
|
+
f"{onnx.printer.to_text(proto)}\n"
|
|
277
278
|
f"-----\n"
|
|
278
279
|
f"{backend_test.onnx_model}"
|
|
279
280
|
) from e
|
|
@@ -298,7 +299,7 @@ class TestOnnxBackEnd(unittest.TestCase):
|
|
|
298
299
|
except Exception as e:
|
|
299
300
|
raise AssertionError(
|
|
300
301
|
f"Unable to run test {backend_test.name!r} after conversion.\n"
|
|
301
|
-
f"{
|
|
302
|
+
f"{onnx.printer.to_text(proto)}"
|
|
302
303
|
) from e
|
|
303
304
|
|
|
304
305
|
backend_test.run(_load_function, _run_function)
|
|
@@ -480,7 +480,7 @@ def _call_ort(
|
|
|
480
480
|
raise EagerModeError(
|
|
481
481
|
f"Unable to create onnxruntime InferenceSession "
|
|
482
482
|
f"for executing {schema.domain}.{schema.name} op "
|
|
483
|
-
f"with onnx model\n{
|
|
483
|
+
f"with onnx model\n{onnx.printer.to_text(model)}"
|
|
484
484
|
) from e
|
|
485
485
|
|
|
486
486
|
try:
|
|
@@ -294,6 +294,29 @@ class TorchScriptTracingEvaluator(evaluator.Evaluator):
|
|
|
294
294
|
return self._graph
|
|
295
295
|
|
|
296
296
|
def eval(self, schema, inputs, attributes):
|
|
297
|
+
if _flags.EXPERIMENTAL_PREFER_TRACING:
|
|
298
|
+
if schema.name == "CastLike":
|
|
299
|
+
assert len(inputs) == 2
|
|
300
|
+
# Skip CastLike if the input and output types are the same
|
|
301
|
+
src_input = inputs[0]
|
|
302
|
+
target_input = inputs[1]
|
|
303
|
+
dtypes_available = (
|
|
304
|
+
isinstance(src_input, TorchScriptTensor)
|
|
305
|
+
and isinstance(target_input, TorchScriptTensor)
|
|
306
|
+
and src_input.dtype is not None
|
|
307
|
+
and target_input.dtype is not None
|
|
308
|
+
)
|
|
309
|
+
if dtypes_available:
|
|
310
|
+
if src_input.dtype == target_input.dtype:
|
|
311
|
+
# Same type. No cast needed
|
|
312
|
+
return src_input
|
|
313
|
+
else:
|
|
314
|
+
# Create a Cast node
|
|
315
|
+
return self._graph.add_op_call(
|
|
316
|
+
onnx.defs.get_schema("Cast"),
|
|
317
|
+
(src_input,),
|
|
318
|
+
{"to": target_input.onnx_dtype},
|
|
319
|
+
)
|
|
297
320
|
return self._graph.add_op_call(schema, inputs, attributes)
|
|
298
321
|
|
|
299
322
|
@runtime_typing.checked
|
|
@@ -303,6 +326,40 @@ class TorchScriptTracingEvaluator(evaluator.Evaluator):
|
|
|
303
326
|
args: Sequence[ValidArgumentType],
|
|
304
327
|
kwargs: Mapping[str, ValidArgumentType],
|
|
305
328
|
):
|
|
329
|
+
if _flags.EXPERIMENTAL_PREFER_TRACING:
|
|
330
|
+
# Special cases for handling IsScalar and Rank
|
|
331
|
+
if function.name == "IsScalar":
|
|
332
|
+
if len(args) != 1:
|
|
333
|
+
raise TypeError(
|
|
334
|
+
f"Expected 1 positional argument for function '{function}', got {len(args)}."
|
|
335
|
+
)
|
|
336
|
+
if isinstance(args[0], TorchScriptTensor):
|
|
337
|
+
if args[0].rank is not None:
|
|
338
|
+
return args[0].rank == 0
|
|
339
|
+
else:
|
|
340
|
+
# Fall to call add_function_call
|
|
341
|
+
pass
|
|
342
|
+
else:
|
|
343
|
+
# Python constants are scalars
|
|
344
|
+
return True
|
|
345
|
+
if function.name == "Rank":
|
|
346
|
+
if len(args) != 1:
|
|
347
|
+
raise TypeError(
|
|
348
|
+
f"Expected 1 positional argument for function '{function}', got {len(args)}."
|
|
349
|
+
)
|
|
350
|
+
if isinstance(args[0], TorchScriptTensor):
|
|
351
|
+
if args[0].rank is not None:
|
|
352
|
+
return args[0].rank
|
|
353
|
+
else:
|
|
354
|
+
# Fall to call add_function_call
|
|
355
|
+
pass
|
|
356
|
+
else:
|
|
357
|
+
# Python constants are scalars
|
|
358
|
+
return 0
|
|
359
|
+
elif function.experimental_traceable:
|
|
360
|
+
# Trace the function call instead of adding the function as a node
|
|
361
|
+
return function.function(*args, **kwargs)
|
|
362
|
+
|
|
306
363
|
# args/kwargs are TorchScriptTensor/python built-in based
|
|
307
364
|
param_schemas = function.param_schemas()
|
|
308
365
|
(
|
|
@@ -972,7 +1029,7 @@ class TorchScriptGraph:
|
|
|
972
1029
|
warnings.warn(f"ONNX model is invalid: {e}", stacklevel=1)
|
|
973
1030
|
logging.debug(
|
|
974
1031
|
"ONNX model:\n%s\n\nTorchScript graph:\n%s",
|
|
975
|
-
|
|
1032
|
+
onnx.printer.to_text(onnx_model),
|
|
976
1033
|
self.torch_graph,
|
|
977
1034
|
)
|
|
978
1035
|
return onnx_model
|
|
@@ -268,9 +268,11 @@ def aten_addr(
|
|
|
268
268
|
# https://github.com/pytorch/pytorch/blob/51664489ba6f6b2343bbec9af9ca99185e2a5dbc/aten/src/ATen/native/cpu/LinearAlgebraKernel.cpp#L53-L54
|
|
269
269
|
# When beta == 0, values in self should be ignored,
|
|
270
270
|
# nans and infs in self should not propagate.
|
|
271
|
+
alpha = op.CastLike(alpha, outer)
|
|
271
272
|
if beta == 0.0:
|
|
272
273
|
result = op.Mul(alpha, outer)
|
|
273
274
|
else:
|
|
275
|
+
beta = op.CastLike(beta, outer)
|
|
274
276
|
result = op.Add(op.Mul(beta, self), op.Mul(alpha, outer))
|
|
275
277
|
|
|
276
278
|
return result
|
|
@@ -4503,40 +4505,30 @@ def aten_linear_backward(
|
|
|
4503
4505
|
|
|
4504
4506
|
@torch_op("aten::linspace", trace_only=True)
|
|
4505
4507
|
def aten_linspace(
|
|
4506
|
-
start:
|
|
4508
|
+
start: TFloat, end: TFloat, steps: int, dtype: int = FLOAT.dtype
|
|
4507
4509
|
) -> TensorType:
|
|
4508
4510
|
"""linspace(Scalar start, Scalar end, int steps, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None) -> Tensor"""
|
|
4509
4511
|
|
|
4510
|
-
|
|
4511
|
-
|
|
4512
|
-
|
|
4513
|
-
|
|
4514
|
-
|
|
4515
|
-
|
|
4516
|
-
|
|
4517
|
-
|
|
4518
|
-
|
|
4519
|
-
|
|
4520
|
-
|
|
4521
|
-
|
|
4522
|
-
|
|
4523
|
-
|
|
4524
|
-
|
|
4525
|
-
|
|
4526
|
-
start
|
|
4527
|
-
end
|
|
4528
|
-
steps = op.Cast(steps, to=FLOAT.dtype)
|
|
4529
|
-
|
|
4530
|
-
range_tensor = op.Range(zero, steps, one)
|
|
4531
|
-
|
|
4532
|
-
start = op.CastLike(start, end)
|
|
4533
|
-
step = op.Div(
|
|
4534
|
-
op.Sub(end, start),
|
|
4535
|
-
op.Sub(steps, one),
|
|
4512
|
+
# Reference: https://github.com/pytorch/pytorch/blob/b35ca2cb941b5ba90858322810ca85c31e4541fd/torch/_refs/__init__.py#L4896
|
|
4513
|
+
if steps == 0:
|
|
4514
|
+
return aten_full(op.Constant(value_ints=[0]), 0.0, dtype=dtype)
|
|
4515
|
+
if steps == 1:
|
|
4516
|
+
return aten_full(op.Constant(value_ints=[steps]), start, dtype=dtype)
|
|
4517
|
+
|
|
4518
|
+
rg = aten_arange_start(0, steps, dtype=dtype)
|
|
4519
|
+
start = op.Cast(start, to=dtype)
|
|
4520
|
+
end = op.Cast(end, to=dtype)
|
|
4521
|
+
steps_float = op.Cast(steps, to=dtype)
|
|
4522
|
+
one = op.Cast(1.0, to=dtype)
|
|
4523
|
+
two = op.Cast(2.0, to=dtype)
|
|
4524
|
+
steps_minus_1 = op.Cast(steps - 1, to=dtype)
|
|
4525
|
+
step = op.Div(op.Sub(end, start), steps_minus_1)
|
|
4526
|
+
return op.Where(
|
|
4527
|
+
rg < op.Div(steps_float, two),
|
|
4528
|
+
start + step * rg,
|
|
4529
|
+
end - step * (steps_float - one - rg),
|
|
4536
4530
|
)
|
|
4537
4531
|
|
|
4538
|
-
return op.Add(op.Mul(range_tensor, step), start)
|
|
4539
|
-
|
|
4540
4532
|
|
|
4541
4533
|
@torch_op("aten::log")
|
|
4542
4534
|
def aten_log(self: TFloatOrBFloat16) -> TFloatOrBFloat16:
|
|
@@ -6923,6 +6915,37 @@ def aten_roll(self: TTensor, shifts: INT64, dims: Sequence[int] = ()) -> TTensor
|
|
|
6923
6915
|
return result
|
|
6924
6916
|
|
|
6925
6917
|
|
|
6918
|
+
@torch_op("aten::roll", trace_only=True, complex=True)
|
|
6919
|
+
def aten_roll_complex(self: TTensor, shifts: INT64, dims: Sequence[int] = ()) -> TTensor:
|
|
6920
|
+
"""roll(Tensor self, int[1] shifts, int[1] dims=[]) -> Tensor"""
|
|
6921
|
+
|
|
6922
|
+
self_rank = len(self.shape)
|
|
6923
|
+
if self_rank == 1:
|
|
6924
|
+
return self
|
|
6925
|
+
|
|
6926
|
+
if self.shape[0] == 0: # empty tensor
|
|
6927
|
+
return self
|
|
6928
|
+
|
|
6929
|
+
self_real = op.Slice(self, [0], [1], axes=[-1])
|
|
6930
|
+
self_imag = op.Slice(self, [1], [2], axes=[-1])
|
|
6931
|
+
if not dims:
|
|
6932
|
+
# assert isinstance(shifts, int)
|
|
6933
|
+
shift_real = _aten_roll_shift_no_dim_onnx(self_real, shifts)
|
|
6934
|
+
shift_imag = _aten_roll_shift_no_dim_onnx(self_imag, shifts)
|
|
6935
|
+
|
|
6936
|
+
result = op.Concat(shift_real, shift_imag, axis=-1)
|
|
6937
|
+
|
|
6938
|
+
else:
|
|
6939
|
+
# assert len(shifts) == len(dims), but shifts is a tensor, dims is a list
|
|
6940
|
+
for i, dim in enumerate(dims):
|
|
6941
|
+
shift = op.Gather(shifts, i, axis=0)
|
|
6942
|
+
self_real = _aten_roll_shift_and_dim_onnx(self_real, shift, dim)
|
|
6943
|
+
self_imag = _aten_roll_shift_and_dim_onnx(self_imag, shift, dim)
|
|
6944
|
+
|
|
6945
|
+
result = op.Concat(self_real, self_imag, axis=-1)
|
|
6946
|
+
return result
|
|
6947
|
+
|
|
6948
|
+
|
|
6926
6949
|
@torch_op("aten::roll", private=True)
|
|
6927
6950
|
def _aten_roll_shift_no_dim_onnx(self: TTensor, shift: INT64) -> TTensor:
|
|
6928
6951
|
neg_1 = op.Constant(value_ints=[-1])
|
|
@@ -8264,10 +8287,47 @@ def aten_vander(
|
|
|
8264
8287
|
raise NotImplementedError()
|
|
8265
8288
|
|
|
8266
8289
|
|
|
8267
|
-
|
|
8290
|
+
@torch_op("aten::var", trace_only=True)
|
|
8291
|
+
def aten_var(self: TReal, unbiased: Optional[bool] = True) -> TReal:
|
|
8268
8292
|
"""var(Tensor self, bool unbiased=True) -> Tensor"""
|
|
8269
8293
|
|
|
8270
|
-
|
|
8294
|
+
# Assume bool(True) and int(1) are same in ONNX, so pass "unbiased" directly as "correction"
|
|
8295
|
+
# If not this case, should be explicitly set correction value according to unbiased value
|
|
8296
|
+
return _aten_var_onnx(self, correction=float(unbiased), keepdim=False)
|
|
8297
|
+
|
|
8298
|
+
|
|
8299
|
+
@torch_op("aten::var.dim", trace_only=True)
|
|
8300
|
+
def aten_var_dim(
|
|
8301
|
+
self: TReal, dim: int, unbiased: Optional[bool] = True, keepdim: Optional[bool] = False
|
|
8302
|
+
) -> TReal:
|
|
8303
|
+
"""var(Tensor self, int[1]? dim, bool unbiased=True, bool keepdim=False) -> Tensor"""
|
|
8304
|
+
|
|
8305
|
+
if isinstance(dim, int):
|
|
8306
|
+
dim = (dim,)
|
|
8307
|
+
dim_tensor = op.Constant(value_ints=dim)
|
|
8308
|
+
return _aten_var_dim_onnx(self, dim_tensor, correction=float(unbiased), keepdim=keepdim)
|
|
8309
|
+
|
|
8310
|
+
|
|
8311
|
+
@torch_op("aten::var.correction", trace_only=True)
|
|
8312
|
+
def aten_var_correction(
|
|
8313
|
+
self: TReal,
|
|
8314
|
+
dim: Optional[int] = None,
|
|
8315
|
+
correction: Optional[float] = None,
|
|
8316
|
+
keepdim: bool = False,
|
|
8317
|
+
) -> TReal:
|
|
8318
|
+
"""var.correction(Tensor self, int[1]? dim=None, *, Scalar? correction=None, bool keepdim=False) -> Tensor"""
|
|
8319
|
+
|
|
8320
|
+
if correction is None:
|
|
8321
|
+
correction = 1.0
|
|
8322
|
+
|
|
8323
|
+
if dim is None:
|
|
8324
|
+
var = _aten_var_onnx(self, correction, keepdim)
|
|
8325
|
+
else:
|
|
8326
|
+
if isinstance(dim, int):
|
|
8327
|
+
dim = (dim,)
|
|
8328
|
+
dim_tensor = op.Constant(value_ints=dim)
|
|
8329
|
+
var = _aten_var_dim_onnx(self, dim_tensor, correction, keepdim)
|
|
8330
|
+
return var
|
|
8271
8331
|
|
|
8272
8332
|
|
|
8273
8333
|
@torch_op("aten::var_mean", trace_only=True)
|
|
@@ -8353,12 +8413,50 @@ def _aten_var_mean_dim_onnx(
|
|
|
8353
8413
|
dim_size = op.Gather(self_shape, dim, axis=0)
|
|
8354
8414
|
numel_float = op.CastLike(op.ReduceProd(dim_size, keepdims=False), self)
|
|
8355
8415
|
mul = op.Mul(var, numel_float)
|
|
8356
|
-
sub = op.Sub(numel_float, correction)
|
|
8416
|
+
sub = op.Sub(numel_float, op.CastLike(correction, self))
|
|
8357
8417
|
var = op.Div(mul, sub)
|
|
8358
8418
|
|
|
8359
8419
|
return var, mean
|
|
8360
8420
|
|
|
8361
8421
|
|
|
8422
|
+
@torch_op("aten::var", private=True, traceable=True)
|
|
8423
|
+
def _aten_var_onnx(self: TReal, correction: float, keepdim: bool = False) -> TReal:
|
|
8424
|
+
mean = op.ReduceMean(self, keepdims=keepdim)
|
|
8425
|
+
sub_mean = op.Sub(self, mean)
|
|
8426
|
+
sqr_mean = op.Mul(sub_mean, sub_mean)
|
|
8427
|
+
var = op.ReduceMean(sqr_mean, keepdims=keepdim)
|
|
8428
|
+
# Adjust var according to correction value
|
|
8429
|
+
if correction > 0.0:
|
|
8430
|
+
self_shape = op.Shape(self)
|
|
8431
|
+
numel_float = op.CastLike(op.ReduceProd(self_shape, keepdims=False), self)
|
|
8432
|
+
mul = op.Mul(var, numel_float)
|
|
8433
|
+
sub = op.Sub(numel_float, op.CastLike(correction, self))
|
|
8434
|
+
var = op.Div(mul, sub)
|
|
8435
|
+
|
|
8436
|
+
return var
|
|
8437
|
+
|
|
8438
|
+
|
|
8439
|
+
@torch_op("aten::var.dim", private=True, traceable=True)
|
|
8440
|
+
def _aten_var_dim_onnx(
|
|
8441
|
+
self: TReal, dim: INT64, correction: float, keepdim: bool = False
|
|
8442
|
+
) -> TReal:
|
|
8443
|
+
dim = op.Reshape(dim, op.Constant(value_ints=[-1]))
|
|
8444
|
+
# Computer mean and var
|
|
8445
|
+
sub_mean = op.Sub(self, op.ReduceMean(self, dim, keepdims=True))
|
|
8446
|
+
sqr_mean = op.Mul(sub_mean, sub_mean)
|
|
8447
|
+
var = op.ReduceMean(sqr_mean, dim, keepdims=keepdim)
|
|
8448
|
+
# Adjust var according to correction value
|
|
8449
|
+
if correction > 0.0:
|
|
8450
|
+
self_shape = op.Shape(self)
|
|
8451
|
+
dim_size = op.Gather(self_shape, dim, axis=0)
|
|
8452
|
+
numel_float = op.CastLike(op.ReduceProd(dim_size, keepdims=False), self)
|
|
8453
|
+
mul = op.Mul(var, numel_float)
|
|
8454
|
+
sub = op.Sub(numel_float, op.CastLike(correction, self))
|
|
8455
|
+
var = op.Div(mul, sub)
|
|
8456
|
+
|
|
8457
|
+
return var
|
|
8458
|
+
|
|
8459
|
+
|
|
8362
8460
|
def aten_vdot(self: TensorType, other: TensorType) -> TensorType:
|
|
8363
8461
|
"""vdot(Tensor self, Tensor other) -> Tensor"""
|
|
8364
8462
|
|
|
@@ -359,7 +359,7 @@ def _format_model_and_input_information(onnx_model, inputs):
|
|
|
359
359
|
f"Inputs:\n"
|
|
360
360
|
f"{pprint.pformat(inputs)}\n"
|
|
361
361
|
f"Model:\n"
|
|
362
|
-
f"{
|
|
362
|
+
f"{onnx.printer.to_text(onnx_model)}"
|
|
363
363
|
)
|
|
364
364
|
|
|
365
365
|
|
|
@@ -526,7 +526,7 @@ def graph_executor(
|
|
|
526
526
|
onnx.checker.check_model(onnx_model, full_check=True)
|
|
527
527
|
except (onnx.checker.ValidationError, onnx.shape_inference.InferenceError) as e:
|
|
528
528
|
raise AssertionError(
|
|
529
|
-
f"ONNX model is invalid. Model:\n{
|
|
529
|
+
f"ONNX model is invalid. Model:\n{onnx.printer.to_text(onnx_model)}"
|
|
530
530
|
) from e
|
|
531
531
|
|
|
532
532
|
try:
|
|
@@ -46,6 +46,7 @@ from torch.testing._internal.opinfo import definitions as opinfo_definitions
|
|
|
46
46
|
from typing_extensions import Self
|
|
47
47
|
|
|
48
48
|
from onnxscript._internal import version_utils
|
|
49
|
+
from onnxscript.function_libs.torch_lib import _flags
|
|
49
50
|
from onnxscript.function_libs.torch_lib.ops import core as core_ops
|
|
50
51
|
from onnxscript.function_libs.torch_lib.ops import fft as fft_ops
|
|
51
52
|
from onnxscript.function_libs.torch_lib.ops import linalg as linalg_ops
|
|
@@ -556,7 +557,7 @@ TESTED_TORCHLIB_OPS: tuple[TorchLibOpInfo, ...] = (
|
|
|
556
557
|
TorchLibOpInfo(
|
|
557
558
|
"addr",
|
|
558
559
|
core_ops.aten_addr,
|
|
559
|
-
tolerance={torch.float16: (
|
|
560
|
+
tolerance={torch.float16: (3e-3, 4e-3)},
|
|
560
561
|
),
|
|
561
562
|
TorchLibOpInfo(
|
|
562
563
|
"amax",
|
|
@@ -875,6 +876,7 @@ TESTED_TORCHLIB_OPS: tuple[TorchLibOpInfo, ...] = (
|
|
|
875
876
|
"linspace",
|
|
876
877
|
core_ops.aten_linspace,
|
|
877
878
|
trace_only=True,
|
|
879
|
+
tolerance={torch.float16: (2e-2, 2e-3)},
|
|
878
880
|
)
|
|
879
881
|
.xfail(
|
|
880
882
|
dtypes=(torch.int64, torch.int32),
|
|
@@ -882,17 +884,9 @@ TESTED_TORCHLIB_OPS: tuple[TorchLibOpInfo, ...] = (
|
|
|
882
884
|
)
|
|
883
885
|
.xfail(
|
|
884
886
|
variant_name="tensor_overload",
|
|
885
|
-
dtypes=(torch.int64, torch.int32
|
|
887
|
+
dtypes=(torch.int64, torch.int32),
|
|
886
888
|
reason="fixme: Results do not match with PyTorch. https://github.com/microsoft/onnxscript/issues/854",
|
|
887
889
|
enabled_if=not version_utils.torch_older_than("2.2"),
|
|
888
|
-
)
|
|
889
|
-
.xfail(
|
|
890
|
-
dtypes=(torch.float16,),
|
|
891
|
-
reason="op 'Range' doesn't support float16.",
|
|
892
|
-
)
|
|
893
|
-
.skip(
|
|
894
|
-
matcher=lambda sample: len(sample.args) > 1 and sample.args[1] == 1,
|
|
895
|
-
reason="aten::linspace with steps=1 is not supported by its definition.",
|
|
896
890
|
),
|
|
897
891
|
TorchLibOpInfo("log", core_ops.aten_log),
|
|
898
892
|
TorchLibOpInfo("le", core_ops.aten_le),
|
|
@@ -990,6 +984,7 @@ TESTED_TORCHLIB_OPS: tuple[TorchLibOpInfo, ...] = (
|
|
|
990
984
|
variant_name="reduction_with_dim",
|
|
991
985
|
reason="fixme: ORT Graph attribute inferencing failed https://github.com/onnx/onnx/issues/4986",
|
|
992
986
|
test_class_name="TestOutputConsistencyFullGraph",
|
|
987
|
+
enabled_if=not _flags.EXPERIMENTAL_PREFER_TRACING,
|
|
993
988
|
)
|
|
994
989
|
.xfail(
|
|
995
990
|
matcher=lambda sample: len(sample.args) == 0
|
|
@@ -1758,6 +1753,7 @@ TESTED_TORCHLIB_OPS: tuple[TorchLibOpInfo, ...] = (
|
|
|
1758
1753
|
variant_name="reduction_with_dim",
|
|
1759
1754
|
reason="fixme: ORT Graph attribute inferencing failed https://github.com/onnx/onnx/issues/4986",
|
|
1760
1755
|
test_class_name="TestOutputConsistencyFullGraph",
|
|
1756
|
+
enabled_if=not _flags.EXPERIMENTAL_PREFER_TRACING,
|
|
1761
1757
|
)
|
|
1762
1758
|
.xfail(
|
|
1763
1759
|
matcher=lambda sample: len(sample.args) == 0
|
|
@@ -2072,6 +2068,13 @@ TESTED_TORCHLIB_OPS: tuple[TorchLibOpInfo, ...] = (
|
|
|
2072
2068
|
trace_only=True,
|
|
2073
2069
|
input_wrangler=_roll_input_wrangler,
|
|
2074
2070
|
),
|
|
2071
|
+
TorchLibOpInfo(
|
|
2072
|
+
"roll",
|
|
2073
|
+
core_ops.aten_roll_complex,
|
|
2074
|
+
input_wrangler=_roll_input_wrangler,
|
|
2075
|
+
trace_only=True,
|
|
2076
|
+
complex=True,
|
|
2077
|
+
),
|
|
2075
2078
|
TorchLibOpInfo(
|
|
2076
2079
|
"scatter_reduce",
|
|
2077
2080
|
core_ops.aten_scatter_reduce,
|
|
@@ -2179,6 +2182,36 @@ TESTED_TORCHLIB_OPS: tuple[TorchLibOpInfo, ...] = (
|
|
|
2179
2182
|
matcher=lambda sample: len(sample.args) > 0 or "correction" not in sample.kwargs,
|
|
2180
2183
|
reason="this Aten overload only support when correction attribute exists",
|
|
2181
2184
|
),
|
|
2185
|
+
TorchLibOpInfo(
|
|
2186
|
+
"var",
|
|
2187
|
+
core_ops.aten_var,
|
|
2188
|
+
trace_only=True,
|
|
2189
|
+
).xfail(
|
|
2190
|
+
# kwargs must be empty
|
|
2191
|
+
matcher=lambda sample: len(sample.kwargs) > 0,
|
|
2192
|
+
reason="this Aten overload only support input[0]=tensor and input[1]=bool as input without any kwargs",
|
|
2193
|
+
),
|
|
2194
|
+
TorchLibOpInfo(
|
|
2195
|
+
"var_dim",
|
|
2196
|
+
core_ops.aten_var_dim,
|
|
2197
|
+
trace_only=True,
|
|
2198
|
+
).xfail(
|
|
2199
|
+
# kwargs["dim"] must exist, kwargs["correction"] must not exist
|
|
2200
|
+
matcher=lambda sample: not (
|
|
2201
|
+
sample.kwargs.get("dim", None) is not None
|
|
2202
|
+
and sample.kwargs.get("correction", None) is None
|
|
2203
|
+
),
|
|
2204
|
+
reason="this Aten overload only support with 'dim' argument and without 'correction' argument",
|
|
2205
|
+
),
|
|
2206
|
+
TorchLibOpInfo(
|
|
2207
|
+
"var_correction",
|
|
2208
|
+
core_ops.aten_var_correction,
|
|
2209
|
+
trace_only=True,
|
|
2210
|
+
).skip(
|
|
2211
|
+
# Don't accept input[1]=bool and 'correction' must be in kwargs
|
|
2212
|
+
matcher=lambda sample: len(sample.args) > 0 or "correction" not in sample.kwargs,
|
|
2213
|
+
reason="this Aten overload only support when correction attribute exists",
|
|
2214
|
+
),
|
|
2182
2215
|
TorchLibOpInfo("zeros_like", core_ops.aten_zeros_like, trace_only=True),
|
|
2183
2216
|
)
|
|
2184
2217
|
|
|
@@ -2276,6 +2309,7 @@ ops_test_common.duplicate_opinfo(OPS_DB, "ops.aten._softmax", ("ops.aten._softma
|
|
|
2276
2309
|
ops_test_common.duplicate_opinfo(OPS_DB, "round", ("round_decimals",))
|
|
2277
2310
|
ops_test_common.duplicate_opinfo(OPS_DB, "squeeze", ("squeeze_dim",))
|
|
2278
2311
|
ops_test_common.duplicate_opinfo(OPS_DB, "var_mean", ("var_mean_dim", "var_mean_correction"))
|
|
2312
|
+
ops_test_common.duplicate_opinfo(OPS_DB, "var", ("var_dim", "var_correction"))
|
|
2279
2313
|
ops_test_common.duplicate_opinfo(OPS_DB, "view_as_complex", ("view_as_complex_copy",))
|
|
2280
2314
|
ops_test_common.duplicate_opinfo(OPS_DB, "view_as_real", ("view_as_real_copy",))
|
|
2281
2315
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: onnxscript
|
|
3
|
-
Version: 0.1.0.
|
|
3
|
+
Version: 0.1.0.dev20231201
|
|
4
4
|
Summary: Naturally author ONNX functions and models using a subset of Python
|
|
5
5
|
Home-page: https://onnxscript.ai/
|
|
6
6
|
Author-email: Microsoft Corporation <onnx@microsoft.com>
|
|
@@ -111,9 +111,8 @@ pytest onnxscript
|
|
|
111
111
|
import onnx
|
|
112
112
|
|
|
113
113
|
# We use ONNX opset 15 to define the function below.
|
|
114
|
-
from onnxscript import FLOAT
|
|
114
|
+
from onnxscript import FLOAT, script
|
|
115
115
|
from onnxscript import opset15 as op
|
|
116
|
-
from onnxscript import script
|
|
117
116
|
|
|
118
117
|
|
|
119
118
|
# We use the script decorator to indicate that
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/_internal/__init__.py
RENAMED
|
File without changes
|
{onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/_internal/analysis.py
RENAMED
|
File without changes
|
{onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/_internal/analysis_test.py
RENAMED
|
File without changes
|
{onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/_internal/ast_utils.py
RENAMED
|
File without changes
|
{onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/_internal/autocast.py
RENAMED
|
File without changes
|
{onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/_internal/deprecation.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/_internal/runtime_typing.py
RENAMED
|
File without changes
|
{onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/_internal/version_utils.py
RENAMED
|
File without changes
|
{onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/backend/__init__.py
RENAMED
|
File without changes
|
{onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/backend/onnx_backend.py
RENAMED
|
File without changes
|
|
File without changes
|
{onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/backend/onnx_export.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{onnxscript-0.1.0.dev20231129 → onnxscript-0.1.0.dev20231201}/onnxscript/diagnostics/infra/_infra.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
|