From 62226d030f8b728c5a53444eecd46acc8c0f028d Mon Sep 17 00:00:00 2001 From: RandySheriffH <48490400+RandySheriffH@users.noreply.github.com> Date: Wed, 6 Jul 2022 21:35:19 -0700 Subject: [PATCH] Cherry-pick tagged commits to 1.12.0 release candidate (#12097) * Update ONNX to 1.12 (#11924) Follow-ups that need to happen after this and before the next ORT release: * Support SequenceMap with https://github.com/microsoft/onnxruntime/pull/11731 * Support signal ops with https://github.com/microsoft/onnxruntime/pull/11778 Follow-ups that need to happen after this but don't necessarily need to happen before the release: * Implement LayerNormalization kernel for opset version 17: https://github.com/microsoft/onnxruntime/issues/11916 Fixes #11640 * Dll version fix ovep4.1 (#11953) * Setting default version values for ovep dlls as well * Update backend_manager.cc Co-authored-by: mayavijx Co-authored-by: mohsin * Optimize t5 encoder in beam search (#11926) * ooptimize t5 encoder * update * update * update * refactor expand impl * cuda tests passed * update * alignment * more alignments * review comments * Allow saving on CPU usage for infrequent inference requests by reducing thread spinning (#11841) Introduce Start/Stop threadpool spinning switch Add a session config option to force spinning stop at the end of the Run() * Restructure function inliner (#11731) * Add nested function call tests * Add overload for Specialize * Pass symboltable to onnx shape inference * Avoid renaming empty names * Enable sequence_map tests which failed before this change * Deprecate APIs returning raw ptrs and provide replacements (#11922) Provider better documentation * register signal ops for opset 17 (#11778) * Register signal ops for op set 17 Note code is mostly being moved, not added. These ops were previously only registered as Microsoft contrib ops and only built if `BUILD_MS_EXPERIMENTAL_OPS=1`. They've been added to the ai.onnx standard op set in version 17. Main components of this change: * Move the kernels from the conrib_ops directory to the core directory. * Add function bodies for ms experimental ops. This will allow old models that use the contrib ops to continue to function. All the function bodies consist of a single op (the new standard op), so performance overhead should be minimal. Minor clean-up also in this change: * De-duplicate get_scalar_value_from_tensor: put it in a new utils.h. * Fix some bugs that caused compilation errors with the experimental ops. Tested with `build.sh --ms_experimental` * Fix some spelling errors and lint violations. * Replace a couple of switch statements with `MLTypeCallDispatcher`. * Use `InlineVector` instead of `std::vector`. Unblocks https://github.com/microsoft/onnxruntime/issues/11640 * Include opset 15 in Conv+BatchNormalization fusion (#11960) * Fix WinML Tests are still targetting deprecated (deleted) experimental signal op definitions (#12006) * fix winml tests * remove legacy test * switch idft -> dft+inverse attr * upgrade opset 13->17 for signal ops tests * [C# Tests] Add support for double tensor output in TestPreTrainedModels. (#12008) Add support for double tensor output in TestPreTrainedModels. * DML EP ResNet50 opset 15 fails in ONNX checker for FusedBatchNormalization lacking training_mode attribute (#12010) FusedBatchNormalization include training_mode attribute * Generalize native op creation (#11539) * create op from ep * read input count from context * create holder to host nodes * fix typo * cast type before comparison * throw error on API fail * silence warning from minimal build * switch to unique_ptr with deleter to host nodes * fix typo * fix build err for minimal * fix build err for minimal * add UT for conv * enable test on CUDA * add comment * fix typo * use gsl::span and string view for Node constructor * Added two APIs - CopyKernelInfo and ReleaseKernelInfo * pass gsl::span by value * switch to span to allow for reference to const containers * fix typo * fix reduced build err * fix reduced build err * refactoring node construction logic * rename exceptions * add input and output count as arguments for op creation * refactor static member * use ORT_CATCH instead of catch * cancel try catch * add static value name map * format input definition and set err code * fix comments * fix typo * [DML EP] Pad operator: Handle negative pad counts (#11974) * Pad fallback to CPU * Added queryPad in operatorRegistration.cpp * Acknowledged PR comments * Used any_of * used none_of instead of any_of Co-authored-by: Sumit Agarwal * Add warning about future computation change for ConvTranspose with auto_pad (#11984) * Add warning about future computation change for Convtranspose with auto_pad * improve msg * update TODO to make lint happy * update more contents for warning and add if * valid was not infected * move it into kernel registration * parse auto_pad myself * try to use conv_transpose_attrs_.auto_pad directly * update roialign cuda impl to onnx opset16 (#12036) * roialign opset16 * fix * fix * Fix windows eager build break by pinning to torch version 1.11.0 (#12033) Fix windows and linux eager build to torch 1.11.0. * Skip Constant Folding for ops producing an optional type output (#11839) * Disable sequence-type tests since C# infra doesn't support well (#12037) * Extend lifetime of KernelDef when creating a standalone op (#12057) place tmp kernel def as local variable to cover the lifetime of kernel creation * Add targets files for new .net6 frameworks (#12016) * Add net6 targets. Remove maccatalyst as we don't have a native build targetting that. * Set platform in macos targets * Add targetFramework entries * Move NativeLib.DllName definition and set using preprocessor values for simplicity. Couldn't get it to build with the preprocessor based setup when it was in a separate file. Update the nuspec generation to set platform version for .net6 targets. TODO: Validate versions. I copied them from the managed nuget package the packaging pipeline generated prior to adding targets. Possibly w could/should lower some of the versions. Hopefully the need to specify a version goes away when the release version of VS2022 supports .net6. * Try android 31.1 as https://github.com/actions/virtual-environments/blob/main/images/win/Windows2022-Readme.md suggests that should be available on the CI machines * Fix patch version mismatch Add some extra debug info in case it helps * Debug nuget location in CI * Add workspace entry back in * Add steps * One more attempt with hardcoded nuget.exe path and original android31.0 version * Better fix - found explicit nuget download and updated version there. * flake8 fixes * Fix black complaints. * Exit Microsoft_ML_OnnxRuntime_CheckPrerequisites for net6 iOS. * Removed outdated comment * Fix DML custom operators which set descriptor heap to command list (#12059) * Make C# runtest.sh automatically set latest opset (#12039) * Update C# runtest.sh for opset 17 Should have been part of https://github.com/microsoft/onnxruntime/pull/11924 * get appropriate opset version from onnx doc * use absolute rather than relative path * fix typo in var name * Disable DML command list reuse for Xbox (#12063) disable cl reuse for xbox * Add data type check in ConvAddRelu fusion (#12058) * Add undocumented attribute to disable generation of Java bindings from the Android AAR. (#12075) The generated bindings causes C# build errors that require workaround code. Disabling generation should avoid the need for any workarounds. As the user has the C# ORT package with the C# to C bindings there's no need for binding generation that calls the ORT Java API (which is C# -> Java ->C). * enable the extensions custom build for java and android (#11823) * generate quantization parameter for outputs (#12089) * DML EP Update to DML 1.9 (#12090) * Update to DML 1.9 * Appease obnoxious Python formatting tool * Fix orttraining-linux-ci-pipeline - Symbolic shape infer (#11965) fix symbolic shape error due to upgraded numpy + legacy sympy * check consumers of dq node before swap dq and transpose (#12099) * check consumers of dq node before swap dq and transpose * add unit test Co-authored-by: Gary Miguel Co-authored-by: Preetha Veeramalai Co-authored-by: mayavijx Co-authored-by: mohsin Co-authored-by: Ye Wang <52801275+wangyems@users.noreply.github.com> Co-authored-by: Dmitri Smirnov Co-authored-by: G. Ramalingam Co-authored-by: Dwayne Robinson Co-authored-by: Sheil Kumar Co-authored-by: Edward Chen <18449977+edgchen1@users.noreply.github.com> Co-authored-by: sumitsays Co-authored-by: Sumit Agarwal Co-authored-by: Chun-Wei Chen Co-authored-by: George Wu Co-authored-by: Wil Brady <25513670+WilBrady@users.noreply.github.com> Co-authored-by: Hariharan Seshadri Co-authored-by: Wei-Sheng Chin Co-authored-by: Scott McKay Co-authored-by: Jeff Bloomfield <38966965+jeffbloo@users.noreply.github.com> Co-authored-by: Justin Stoecker Co-authored-by: Wenbing Li <10278425+wenbingl@users.noreply.github.com> Co-authored-by: Yufeng Li Co-authored-by: pengwa --- .pipelines/nuget_config/x64/packages.config | 2 +- .pipelines/nuget_config/x86/packages.config | 2 +- cgmanifests/generated/cgmanifest.json | 14 +- cmake/CMakeLists.txt | 12 +- cmake/external/dml.cmake | 2 +- cmake/external/extensions.cmake | 3 +- cmake/external/onnx | 2 +- .../Microsoft.ML.OnnxRuntime.csproj | 2 +- .../NativeLib.android.cs | 8 - .../Microsoft.ML.OnnxRuntime/NativeLib.ios.cs | 8 - .../Microsoft.ML.OnnxRuntime/NativeLib.net.cs | 8 - .../NativeLib.netstandard.cs | 8 - .../NativeMethods.shared.cs | 15 + .../targets/net6.0-android/targets.xml | 8 + .../targets/net6.0-ios/targets.xml | 21 + .../targets/net6.0-macos/targets.xml | 21 + .../targets/netstandard/targets.xml | 3 +- .../runtest.sh | 10 +- .../InferenceTest.cs | 21 +- .../OnnxMl.cs | 583 ++++++++- .../InferenceTest.netcore.cs | 22 +- .../OnnxMl.cs | 583 ++++++++- docs/OperatorKernels.md | 10 +- include/onnxruntime/core/graph/graph.h | 29 +- .../platform/EigenNonBlockingThreadPool.h | 1150 +++++++++-------- .../onnxruntime/core/platform/threadpool.h | 8 + .../experimental_onnxruntime_cxx_inline.h | 15 +- .../core/session/onnxruntime_c_api.h | 69 +- .../core/session/onnxruntime_cxx_api.h | 219 +++- .../core/session/onnxruntime_cxx_inline.h | 136 +- .../onnxruntime_session_options_config_keys.h | 7 + ...ai_onnxruntime_OrtSession_SessionOptions.c | 4 + js/web/docs/operators.md | 8 + .../contrib_ops/cpu/cpu_contrib_kernels.cc | 20 - onnxruntime/contrib_ops/cpu/signal/dft.cc | 606 --------- .../cpu/signal/window_functions.cc | 334 ----- .../cpu/transformers/beam_search.cc | 10 +- .../cpu/transformers/beam_search.h | 12 +- .../transformers/beam_search_device_helper.cc | 119 +- .../transformers/beam_search_device_helper.h | 33 +- .../cpu/transformers/beam_search_impl_base.h | 17 +- .../cpu/transformers/beam_search_impl_t5.h | 27 +- .../cpu/transformers/subgraph_t5_decoder.cc | 53 +- .../cpu/transformers/subgraph_t5_decoder.h | 4 + .../cpu/transformers/subgraph_t5_encoder.cc | 22 +- .../cpu/transformers/subgraph_t5_encoder.h | 1 - .../cuda/transformers/beam_search.cc | 5 +- .../transformers/beam_search_device_helper.cc | 90 +- .../transformers/beam_search_device_helper.h | 9 + onnxruntime/core/common/threadpool.cc | 12 + .../core/graph/contrib_ops/contrib_defs.cc | 7 - onnxruntime/core/graph/dml_ops/dml_defs.cc | 1 + onnxruntime/core/graph/function_utils.cc | 405 ++---- onnxruntime/core/graph/function_utils.h | 12 +- onnxruntime/core/graph/graph.cc | 213 ++- .../core/graph/signal_ops/signal_defs.cc | 738 ----------- .../core/graph/signal_ops/signal_defs.h | 36 - .../core/optimizer/constant_folding.cc | 8 +- .../core/optimizer/conv_activation_fusion.cc | 27 +- onnxruntime/core/optimizer/conv_bn_fusion.cc | 2 +- .../transpose_optimizer/optimizer_api.h | 2 +- .../transpose_optimizer.cc | 13 +- .../providers/cpu/cpu_execution_provider.cc | 16 + .../core/providers/cpu/nn/conv_transpose.h | 10 +- .../providers/cpu/optional/optional_ops.cc | 6 +- onnxruntime/core/providers/cpu/signal/dft.cc | 508 ++++++++ .../providers}/cpu/signal/dft.h | 20 +- onnxruntime/core/providers/cpu/signal/utils.h | 30 + .../providers/cpu/signal/window_functions.cc | 216 ++++ .../providers}/cpu/signal/window_functions.h | 24 +- .../cuda/object_detection/roialign.cc | 1 + .../cuda/object_detection/roialign_impl.cu | 9 +- .../cuda/object_detection/roialign_impl.h | 1 + .../inc/IWinmlExecutionProvider.h | 2 +- .../src/DmlCommandRecorder.h | 6 + .../src/ExecutionContext.cpp | 6 +- .../src/ExecutionContext.h | 2 +- .../src/ExecutionProvider.cpp | 4 +- .../src/ExecutionProvider.h | 2 +- .../src/GraphDescBuilder.cpp | 5 + .../src/MLOperatorAuthorImpl.cpp | 4 +- .../src/Operators/DmlOperatorPadding.cpp | 17 + .../src/Operators/OperatorRegistration.cpp | 3 +- .../providers/openvino/backend_manager.cc | 2 +- onnxruntime/core/session/inference_session.cc | 40 +- onnxruntime/core/session/inference_session.h | 6 + onnxruntime/core/session/onnxruntime_c_api.cc | 27 +- onnxruntime/core/session/ort_apis.h | 13 +- .../core/session/standalone_op_invoker.cc | 160 ++- .../python/tools/quantization/calibrate.py | 36 +- .../tools/quantization/qdq_quantizer.py | 2 +- .../test/contrib_ops/signal_ops_test.cc | 207 --- onnxruntime/test/framework/function_test.cc | 171 ++- onnxruntime/test/onnx/dataitem_request.cc | 5 +- .../test/opaque_api/test_opaque_api.cc | 8 +- .../test/optimizer/graph_transform_test.cc | 31 + onnxruntime/test/optimizer/qdq_test_utils.cc | 10 + onnxruntime/test/optimizer/qdq_test_utils.h | 5 + .../test/optimizer/qdq_transformer_test.cc | 10 - .../optimizer/transpose_optimizer_test.cc | 37 + onnxruntime/test/perftest/ort_test_session.cc | 5 +- .../providers/cpu/signal/signal_ops_test.cc | 242 ++++ .../python/quantization/test_calibration.py | 52 +- .../transformers/bert_model_generator.py | 9 +- .../transformers/gpt2_model_generator.py | 6 +- .../test/shared_lib/custom_op_utils.cc | 195 ++- onnxruntime/test/shared_lib/custom_op_utils.h | 26 +- onnxruntime/test/shared_lib/test_inference.cc | 131 +- onnxruntime/test/testdata/gh_issue_11717.onnx | Bin 0 -> 1253 bytes .../testdata/kernel_def_hashes/onnx.cpu.json | 40 +- .../onnx_backend_test_series_overrides.jsonc | 4 +- .../transform/fusion/conv_add_relu_fp16.onnx | 43 + .../test/gradient/gradient_op_test_utils.cc | 27 +- packages.config | 2 +- tools/ci_build/build.py | 2 +- .../c-api-noopenmp-packaging-pipelines.yml | 6 +- .../azure-pipelines/linux-ci-pipeline.yml | 3 +- .../azure-pipelines/linux-gpu-ci-pipeline.yml | 3 +- .../orttraining-linux-ci-pipeline.yml | 5 +- .../azure-pipelines/templates/c-api-cpu.yml | 8 +- .../py-packaging-selectable-stage.yml | 3 +- .../templates/py-packaging-stage.yml | 6 +- .../docker/scripts/manylinux/requirements.txt | 4 +- .../linux/docker/scripts/requirements.txt | 4 +- .../stage1/torch_eager_cpu/requirements.txt | 2 +- .../github/windows/eager/requirements.txt | 3 +- .../nuget/generate_nuspec_for_native_nuget.py | 85 +- .../test/api/LearningModelSessionAPITest.cpp | 54 +- 128 files changed, 4892 insertions(+), 3591 deletions(-) delete mode 100644 csharp/src/Microsoft.ML.OnnxRuntime/NativeLib.android.cs delete mode 100644 csharp/src/Microsoft.ML.OnnxRuntime/NativeLib.ios.cs delete mode 100644 csharp/src/Microsoft.ML.OnnxRuntime/NativeLib.net.cs delete mode 100644 csharp/src/Microsoft.ML.OnnxRuntime/NativeLib.netstandard.cs create mode 100644 csharp/src/Microsoft.ML.OnnxRuntime/targets/net6.0-android/targets.xml create mode 100644 csharp/src/Microsoft.ML.OnnxRuntime/targets/net6.0-ios/targets.xml create mode 100644 csharp/src/Microsoft.ML.OnnxRuntime/targets/net6.0-macos/targets.xml delete mode 100644 onnxruntime/contrib_ops/cpu/signal/dft.cc delete mode 100644 onnxruntime/contrib_ops/cpu/signal/window_functions.cc delete mode 100644 onnxruntime/core/graph/signal_ops/signal_defs.cc delete mode 100644 onnxruntime/core/graph/signal_ops/signal_defs.h create mode 100644 onnxruntime/core/providers/cpu/signal/dft.cc rename onnxruntime/{contrib_ops => core/providers}/cpu/signal/dft.h (68%) create mode 100644 onnxruntime/core/providers/cpu/signal/utils.h create mode 100644 onnxruntime/core/providers/cpu/signal/window_functions.cc rename onnxruntime/{contrib_ops => core/providers}/cpu/signal/window_functions.h (62%) delete mode 100644 onnxruntime/test/contrib_ops/signal_ops_test.cc create mode 100644 onnxruntime/test/providers/cpu/signal/signal_ops_test.cc create mode 100644 onnxruntime/test/testdata/gh_issue_11717.onnx create mode 100644 onnxruntime/test/testdata/transform/fusion/conv_add_relu_fp16.onnx diff --git a/.pipelines/nuget_config/x64/packages.config b/.pipelines/nuget_config/x64/packages.config index 1f73d55fd7894..e903904d44876 100644 --- a/.pipelines/nuget_config/x64/packages.config +++ b/.pipelines/nuget_config/x64/packages.config @@ -1,6 +1,6 @@  - + diff --git a/.pipelines/nuget_config/x86/packages.config b/.pipelines/nuget_config/x86/packages.config index 9d111765e881f..169e973245542 100644 --- a/.pipelines/nuget_config/x86/packages.config +++ b/.pipelines/nuget_config/x86/packages.config @@ -1,6 +1,6 @@  - + diff --git a/cgmanifests/generated/cgmanifest.json b/cgmanifests/generated/cgmanifest.json index 4f05575171e52..9cfddd61ff25a 100644 --- a/cgmanifests/generated/cgmanifest.json +++ b/cgmanifests/generated/cgmanifest.json @@ -225,7 +225,7 @@ "type": "git", "git": { "commitHash": "db78ac1d7716f56fc9f1b030b715f872f93964e4", - "repositoryUrl": "https://github.com/nlohmann/json.git" + "repositoryUrl": "https://github.com/nlohmann/json" }, "comments": "git submodule at cmake/external/json" } @@ -265,7 +265,7 @@ "type": "git", "git": { "commitHash": "436617053d0f39a1019a371c3a9aa599b3cb2cea", - "repositoryUrl": "https://github.com/google/nsync.git" + "repositoryUrl": "https://github.com/google/nsync" }, "comments": "git submodule at cmake/external/nsync" } @@ -274,8 +274,8 @@ "component": { "type": "git", "git": { - "commitHash": "850a81b0b77786bf99ea90580242b084f86a6235", - "repositoryUrl": "https://github.com/onnx/onnx.git" + "commitHash": "f7ee1ac60d06abe8e26c9b6bbe1e3db5286b614b", + "repositoryUrl": "https://github.com/onnx/onnx" }, "comments": "git submodule at cmake/external/onnx" } @@ -284,7 +284,7 @@ "component": { "type": "git", "git": { - "commitHash": "e776aa0275e293707b6a0901e0e8d8a8a3679508", + "commitHash": "0d98dba29d66e93259db7daa53a9327df767a415", "repositoryUrl": "https://github.com/google/benchmark.git" }, "comments": "git submodule at cmake/external/onnx/third_party/benchmark" @@ -294,7 +294,7 @@ "component": { "type": "git", "git": { - "commitHash": "59a2ac2745d8a57ac94c6accced73620d59fb844", + "commitHash": "ffa346860b306c9bbfb341aed9c14c067751feb8", "repositoryUrl": "https://github.com/pybind/pybind11.git" }, "comments": "git submodule at cmake/external/onnx/third_party/pybind11" @@ -425,7 +425,7 @@ "type": "git", "git": { "commitHash": "e8c599bca6c56c44b6730ad93f6abbc9ecd60fc1", - "repositoryUrl": "https://github.com/microsoft/wil.git" + "repositoryUrl": "https://github.com/microsoft/wil" }, "comments": "git submodule at cmake/external/wil" } diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index d591d1b8a0cb0..dbf0aca923240 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -1968,6 +1968,12 @@ if (onnxruntime_ENABLE_TRAINING) set(onnxruntime_ENABLE_ATEN ON) endif() +# Default version parts for Microsoft.AI.MachineLearning.dll, onnxruntime.dll, onnxruntime_providers_openvino.dll and onnxruntime_providers_shared.dll in non-ADO pipeline local builds +set(VERSION_MAJOR_PART 0 CACHE STRING "First part of numeric file/product version.") +set(VERSION_MINOR_PART 0 CACHE STRING "Second part of numeric file/product version.") +set(VERSION_BUILD_PART 0 CACHE STRING "Third part of numeric file/product version.") +set(VERSION_PRIVATE_PART 0 CACHE STRING "Fourth part of numeric file/product version.") +set(VERSION_STRING "Internal Build" CACHE STRING "String representation of file/product version.") set(ONNXRUNTIME_TARGETS onnxruntime_common onnxruntime_graph onnxruntime_framework onnxruntime_util onnxruntime_providers onnxruntime_optimizer onnxruntime_session onnxruntime_mlas onnxruntime_flatbuffers) if (onnxruntime_USE_NUPHAR_TVM) @@ -2016,12 +2022,6 @@ if (WIN32 AND NOT GDK_PLATFORM) endif() endif() -# Default version parts for Microsoft.AI.MachineLearning.dll and onnxruntime.dll in non-ADO pipeline local builds -set(VERSION_MAJOR_PART 0 CACHE STRING "First part of numeric file/product version.") -set(VERSION_MINOR_PART 0 CACHE STRING "Second part of numeric file/product version.") -set(VERSION_BUILD_PART 0 CACHE STRING "Third part of numeric file/product version.") -set(VERSION_PRIVATE_PART 0 CACHE STRING "Fourth part of numeric file/product version.") -set(VERSION_STRING "Internal Build" CACHE STRING "String representation of file/product version.") include(wil.cmake) if (onnxruntime_USE_WINML) diff --git a/cmake/external/dml.cmake b/cmake/external/dml.cmake index 667ef72145515..dcb31bbe1976e 100644 --- a/cmake/external/dml.cmake +++ b/cmake/external/dml.cmake @@ -40,7 +40,7 @@ if (NOT onnxruntime_USE_CUSTOM_DIRECTML) set(NUGET_CONFIG ${PROJECT_SOURCE_DIR}/../NuGet.config) set(PACKAGES_CONFIG ${PROJECT_SOURCE_DIR}/../packages.config) get_filename_component(PACKAGES_DIR ${CMAKE_CURRENT_BINARY_DIR}/../packages ABSOLUTE) - set(DML_PACKAGE_DIR ${PACKAGES_DIR}/Microsoft.AI.DirectML.Preview.1.9.0-devb9b146539f535988728c8eb4791840db54add4a7) + set(DML_PACKAGE_DIR ${PACKAGES_DIR}/Microsoft.AI.DirectML.1.9.0) set(DML_SHARED_LIB DirectML.dll) # Restore nuget packages, which will pull down the DirectML redist package. diff --git a/cmake/external/extensions.cmake b/cmake/external/extensions.cmake index 470172abefa4c..7bd8aeafbbaa2 100644 --- a/cmake/external/extensions.cmake +++ b/cmake/external/extensions.cmake @@ -23,7 +23,8 @@ endif() # when onnxruntime-extensions is not a subdirectory of onnxruntime, # output binary directory must be explicitly specified. -add_subdirectory(${onnxruntime_EXTENSIONS_PATH} ${onnxruntime_EXTENSIONS_PATH}/_subbuild EXCLUDE_FROM_ALL) +# and the output binary path is the same as CMake FetchContent pattern +add_subdirectory(${onnxruntime_EXTENSIONS_PATH} ${CMAKE_BINARY_DIR}/_deps/extensions-subbuild EXCLUDE_FROM_ALL) # target library or executable are defined in CMakeLists.txt of onnxruntime-extensions target_include_directories(ocos_operators PRIVATE ${RE2_INCLUDE_DIR} external/json/include) diff --git a/cmake/external/onnx b/cmake/external/onnx index 850a81b0b7778..f7ee1ac60d06a 160000 --- a/cmake/external/onnx +++ b/cmake/external/onnx @@ -1 +1 @@ -Subproject commit 850a81b0b77786bf99ea90580242b084f86a6235 +Subproject commit f7ee1ac60d06abe8e26c9b6bbe1e3db5286b614b diff --git a/csharp/src/Microsoft.ML.OnnxRuntime/Microsoft.ML.OnnxRuntime.csproj b/csharp/src/Microsoft.ML.OnnxRuntime/Microsoft.ML.OnnxRuntime.csproj index 3711978cffcd4..661a9e8cbab86 100644 --- a/csharp/src/Microsoft.ML.OnnxRuntime/Microsoft.ML.OnnxRuntime.csproj +++ b/csharp/src/Microsoft.ML.OnnxRuntime/Microsoft.ML.OnnxRuntime.csproj @@ -37,7 +37,7 @@ we can add .net6 support to other packages later as needed --> - net6.0;net6.0-android;net6.0-ios;net6.0-maccatalyst;net6.0-macos + net6.0;net6.0-android;net6.0-ios;net6.0-macos diff --git a/csharp/src/Microsoft.ML.OnnxRuntime/NativeLib.android.cs b/csharp/src/Microsoft.ML.OnnxRuntime/NativeLib.android.cs deleted file mode 100644 index 4d5a05da4f4ca..0000000000000 --- a/csharp/src/Microsoft.ML.OnnxRuntime/NativeLib.android.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace Microsoft.ML.OnnxRuntime -{ - internal class NativeLib - { - // define the library name required for android - internal const string DllName = "libonnxruntime.so"; - } -} \ No newline at end of file diff --git a/csharp/src/Microsoft.ML.OnnxRuntime/NativeLib.ios.cs b/csharp/src/Microsoft.ML.OnnxRuntime/NativeLib.ios.cs deleted file mode 100644 index ad5cbcb41375a..0000000000000 --- a/csharp/src/Microsoft.ML.OnnxRuntime/NativeLib.ios.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace Microsoft.ML.OnnxRuntime -{ - internal class NativeLib - { - // define the library name required for iOS - internal const string DllName = "__Internal"; - } -} \ No newline at end of file diff --git a/csharp/src/Microsoft.ML.OnnxRuntime/NativeLib.net.cs b/csharp/src/Microsoft.ML.OnnxRuntime/NativeLib.net.cs deleted file mode 100644 index 0514be6775d05..0000000000000 --- a/csharp/src/Microsoft.ML.OnnxRuntime/NativeLib.net.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace Microsoft.ML.OnnxRuntime -{ - internal class NativeLib - { - // define the library name required for net targets - internal const string DllName = "onnxruntime"; - } -} \ No newline at end of file diff --git a/csharp/src/Microsoft.ML.OnnxRuntime/NativeLib.netstandard.cs b/csharp/src/Microsoft.ML.OnnxRuntime/NativeLib.netstandard.cs deleted file mode 100644 index 832de058a28bd..0000000000000 --- a/csharp/src/Microsoft.ML.OnnxRuntime/NativeLib.netstandard.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace Microsoft.ML.OnnxRuntime -{ - internal class NativeLib - { - // define the library name required for netstandard targets - internal const string DllName = "onnxruntime"; - } -} \ No newline at end of file diff --git a/csharp/src/Microsoft.ML.OnnxRuntime/NativeMethods.shared.cs b/csharp/src/Microsoft.ML.OnnxRuntime/NativeMethods.shared.cs index 70e46c286ebaf..f008d2fbffde1 100644 --- a/csharp/src/Microsoft.ML.OnnxRuntime/NativeMethods.shared.cs +++ b/csharp/src/Microsoft.ML.OnnxRuntime/NativeMethods.shared.cs @@ -425,6 +425,21 @@ static NativeMethods() typeof(DSessionOptionsAppendExecutionProvider)); } + internal class NativeLib + { +#if __ANDROID__ + // define the library name required for android + internal const string DllName = "libonnxruntime.so"; +#elif __IOS__ + // define the library name required for iOS + internal const string DllName = "__Internal"; +#else + internal const string DllName = "onnxruntime"; +#endif + // TODO: Does macos need special handling or will 'onnxruntime' -> libonnxruntime.dylib? + } + + [DllImport(NativeLib.DllName, CharSet = CharSet.Ansi)] public static extern ref OrtApiBase OrtGetApiBase(); diff --git a/csharp/src/Microsoft.ML.OnnxRuntime/targets/net6.0-android/targets.xml b/csharp/src/Microsoft.ML.OnnxRuntime/targets/net6.0-android/targets.xml new file mode 100644 index 0000000000000..ba946c59d86c7 --- /dev/null +++ b/csharp/src/Microsoft.ML.OnnxRuntime/targets/net6.0-android/targets.xml @@ -0,0 +1,8 @@ + + + + + %(Filename)%(Extension) + + + \ No newline at end of file diff --git a/csharp/src/Microsoft.ML.OnnxRuntime/targets/net6.0-ios/targets.xml b/csharp/src/Microsoft.ML.OnnxRuntime/targets/net6.0-ios/targets.xml new file mode 100644 index 0000000000000..02043bcad233c --- /dev/null +++ b/csharp/src/Microsoft.ML.OnnxRuntime/targets/net6.0-ios/targets.xml @@ -0,0 +1,21 @@ + + + + + Framework + True + True + True + -lc++ + CoreML + + + Framework + True + True + True + -lc++ + CoreML + + + \ No newline at end of file diff --git a/csharp/src/Microsoft.ML.OnnxRuntime/targets/net6.0-macos/targets.xml b/csharp/src/Microsoft.ML.OnnxRuntime/targets/net6.0-macos/targets.xml new file mode 100644 index 0000000000000..63d4461ad15ad --- /dev/null +++ b/csharp/src/Microsoft.ML.OnnxRuntime/targets/net6.0-macos/targets.xml @@ -0,0 +1,21 @@ + + + + + Framework + True + True + True + -lc++ + CoreML + + + Framework + True + True + True + -lc++ + CoreML + + + \ No newline at end of file diff --git a/csharp/src/Microsoft.ML.OnnxRuntime/targets/netstandard/targets.xml b/csharp/src/Microsoft.ML.OnnxRuntime/targets/netstandard/targets.xml index b2a3149434cac..b8bb5efc7cc96 100644 --- a/csharp/src/Microsoft.ML.OnnxRuntime/targets/netstandard/targets.xml +++ b/csharp/src/Microsoft.ML.OnnxRuntime/targets/netstandard/targets.xml @@ -9,7 +9,8 @@ diff --git a/csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests/runtest.sh b/csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests/runtest.sh index 28d92b73530c4..f56fdc802cd40 100755 --- a/csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests/runtest.sh +++ b/csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests/runtest.sh @@ -18,8 +18,12 @@ echo "Current NuGet package version is $CurrentOnnxRuntimeVersion" if [ $RunTestCsharp = "true" ]; then if [[ $IsMacOS == "True" || $IsMacOS == "true" ]]; then - mkdir -p $BUILD_BINARIESDIRECTORY/models - ln -s $BUILD_SOURCESDIRECTORY/cmake/external/onnx/onnx/backend/test/data/node $BUILD_BINARIESDIRECTORY/models/opset16 + # TODO(#12040): The test should figure out the opset version from the model file. Remove it from the path. + ONNX_DIR="${BUILD_SOURCESDIRECTORY}/cmake/external/onnx" + ONNX_VERSION_NUMBER=$(cat "${ONNX_DIR}/VERSION_NUMBER" | sed -E 's/([0-9]+\.[0-9]+\.[0-9]+).*/\1/') + OPSET_VERSION=$(grep "${ONNX_VERSION_NUMBER}" "${ONNX_DIR}/docs/Versioning.md" | sed -E "s/${ONNX_VERSION_NUMBER}\|[^|]+\|([0-9]+)\|.*/\1/") + mkdir -p "${BUILD_BINARIESDIRECTORY}/models" + ln -s "${ONNX_DIR}/onnx/backend/test/data/node" "${BUILD_BINARIESDIRECTORY}/models/opset${OPSET_VERSION}" fi # Run C# tests dotnet restore $BUILD_SOURCESDIRECTORY/csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests/Microsoft.ML.OnnxRuntime.EndToEndTests.csproj -s $LocalNuGetRepo -s https://api.nuget.org/v3/index.json @@ -29,7 +33,7 @@ if [ $RunTestCsharp = "true" ]; then fi if [ $PACKAGENAME = "Microsoft.ML.OnnxRuntime.Gpu" ]; then - export TESTONGPU=ON + export TESTONGPU=ON dotnet test -p:DefineConstants=USE_CUDA $BUILD_SOURCESDIRECTORY/csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests/Microsoft.ML.OnnxRuntime.EndToEndTests.csproj --no-restore --verbosity detailed if [ $? -ne 0 ]; then echo "Failed to build or execute the end-to-end test" diff --git a/csharp/test/Microsoft.ML.OnnxRuntime.Tests.Common/InferenceTest.cs b/csharp/test/Microsoft.ML.OnnxRuntime.Tests.Common/InferenceTest.cs index 64f395d3df623..eaffa9dafd27d 100644 --- a/csharp/test/Microsoft.ML.OnnxRuntime.Tests.Common/InferenceTest.cs +++ b/csharp/test/Microsoft.ML.OnnxRuntime.Tests.Common/InferenceTest.cs @@ -27,7 +27,7 @@ public InferenceTest(ITestOutputHelper o) [Fact(DisplayName = "TestSessionOptions")] public void TestSessionOptions() { - // get instance to setup logging + // get instance to setup logging var ortEnvInstance = OrtEnv.Instance(); using (SessionOptions opt = new SessionOptions()) @@ -1938,7 +1938,7 @@ internal static Tuple, float[]> Op var session = (deviceId.HasValue) ? new InferenceSession(model, option) : new InferenceSession(model); - float[] inputData = TestDataLoader.LoadTensorFromEmbeddedResource("bench.in"); + float[] inputData = TestDataLoader.LoadTensorFromEmbeddedResource("bench.in"); float[] expectedOutput = TestDataLoader.LoadTensorFromEmbeddedResource("bench.expected_out"); var inputMeta = session.InputMetadata; var tensor = new DenseTensor(inputData, inputMeta["data_0"].Dimensions); @@ -1961,6 +1961,21 @@ public int GetHashCode(float x) } } + internal class DoubleComparer : IEqualityComparer + { + private double atol = 1e-3; + private double rtol = 1.7e-2; + + public bool Equals(double x, double y) + { + return Math.Abs(x - y) <= (atol + rtol * Math.Abs(y)); + } + public int GetHashCode(double x) + { + return x.GetHashCode(); + } + } + class ExactComparer : IEqualityComparer { public bool Equals(T x, T y) @@ -2069,4 +2084,4 @@ public void Dispose() } #endregion } -} \ No newline at end of file +} diff --git a/csharp/test/Microsoft.ML.OnnxRuntime.Tests.Common/OnnxMl.cs b/csharp/test/Microsoft.ML.OnnxRuntime.Tests.Common/OnnxMl.cs index a8d05aa458ffb..8805b95839f28 100644 --- a/csharp/test/Microsoft.ML.OnnxRuntime.Tests.Common/OnnxMl.cs +++ b/csharp/test/Microsoft.ML.OnnxRuntime.Tests.Common/OnnxMl.cs @@ -62,7 +62,7 @@ static OnnxMlReflection() { "Z0VudHJ5UHJvdG8SCwoDa2V5GAEgASgJEg0KBXZhbHVlGAIgASgJImsKEFRl", "bnNvckFubm90YXRpb24SEwoLdGVuc29yX25hbWUYASABKAkSQgoccXVhbnRf", "cGFyYW1ldGVyX3RlbnNvcl9uYW1lcxgCIAMoCzIcLm9ubnguU3RyaW5nU3Ry", - "aW5nRW50cnlQcm90byLYAgoKR3JhcGhQcm90bxIdCgRub2RlGAEgAygLMg8u", + "aW5nRW50cnlQcm90byKeAwoKR3JhcGhQcm90bxIdCgRub2RlGAEgAygLMg8u", "b25ueC5Ob2RlUHJvdG8SDAoEbmFtZRgCIAEoCRImCgtpbml0aWFsaXplchgF", "IAMoCzIRLm9ubnguVGVuc29yUHJvdG8SMwoSc3BhcnNlX2luaXRpYWxpemVy", "GA8gAygLMhcub25ueC5TcGFyc2VUZW5zb3JQcm90bxISCgpkb2Nfc3RyaW5n", @@ -70,56 +70,57 @@ static OnnxMlReflection() { "CgZvdXRwdXQYDCADKAsyFC5vbm54LlZhbHVlSW5mb1Byb3RvEigKCnZhbHVl", "X2luZm8YDSADKAsyFC5vbm54LlZhbHVlSW5mb1Byb3RvEjcKF3F1YW50aXph", "dGlvbl9hbm5vdGF0aW9uGA4gAygLMhYub25ueC5UZW5zb3JBbm5vdGF0aW9u", - "IrgFCgtUZW5zb3JQcm90bxIMCgRkaW1zGAEgAygDEhEKCWRhdGFfdHlwZRgC", - "IAEoBRIqCgdzZWdtZW50GAMgASgLMhkub25ueC5UZW5zb3JQcm90by5TZWdt", - "ZW50EhYKCmZsb2F0X2RhdGEYBCADKAJCAhABEhYKCmludDMyX2RhdGEYBSAD", - "KAVCAhABEhMKC3N0cmluZ19kYXRhGAYgAygMEhYKCmludDY0X2RhdGEYByAD", - "KANCAhABEgwKBG5hbWUYCCABKAkSEgoKZG9jX3N0cmluZxgMIAEoCRIQCghy", - "YXdfZGF0YRgJIAEoDBIzCg1leHRlcm5hbF9kYXRhGA0gAygLMhwub25ueC5T", - "dHJpbmdTdHJpbmdFbnRyeVByb3RvEjUKDWRhdGFfbG9jYXRpb24YDiABKA4y", - "Hi5vbm54LlRlbnNvclByb3RvLkRhdGFMb2NhdGlvbhIXCgtkb3VibGVfZGF0", - "YRgKIAMoAUICEAESFwoLdWludDY0X2RhdGEYCyADKARCAhABGiUKB1NlZ21l", - "bnQSDQoFYmVnaW4YASABKAMSCwoDZW5kGAIgASgDItoBCghEYXRhVHlwZRIN", - "CglVTkRFRklORUQQABIJCgVGTE9BVBABEgkKBVVJTlQ4EAISCAoESU5UOBAD", - "EgoKBlVJTlQxNhAEEgkKBUlOVDE2EAUSCQoFSU5UMzIQBhIJCgVJTlQ2NBAH", - "EgoKBlNUUklORxAIEggKBEJPT0wQCRILCgdGTE9BVDE2EAoSCgoGRE9VQkxF", - "EAsSCgoGVUlOVDMyEAwSCgoGVUlOVDY0EA0SDQoJQ09NUExFWDY0EA4SDgoK", - "Q09NUExFWDEyOBAPEgwKCEJGTE9BVDE2EBAiKQoMRGF0YUxvY2F0aW9uEgsK", - "B0RFRkFVTFQQABIMCghFWFRFUk5BTBABImgKEVNwYXJzZVRlbnNvclByb3Rv", - "EiEKBnZhbHVlcxgBIAEoCzIRLm9ubnguVGVuc29yUHJvdG8SIgoHaW5kaWNl", - "cxgCIAEoCzIRLm9ubnguVGVuc29yUHJvdG8SDAoEZGltcxgDIAMoAyKVAQoQ", - "VGVuc29yU2hhcGVQcm90bxItCgNkaW0YASADKAsyIC5vbm54LlRlbnNvclNo", - "YXBlUHJvdG8uRGltZW5zaW9uGlIKCURpbWVuc2lvbhITCglkaW1fdmFsdWUY", - "ASABKANIABITCglkaW1fcGFyYW0YAiABKAlIABISCgpkZW5vdGF0aW9uGAMg", - "ASgJQgcKBXZhbHVlIqUFCglUeXBlUHJvdG8SLQoLdGVuc29yX3R5cGUYASAB", - "KAsyFi5vbm54LlR5cGVQcm90by5UZW5zb3JIABIxCg1zZXF1ZW5jZV90eXBl", - "GAQgASgLMhgub25ueC5UeXBlUHJvdG8uU2VxdWVuY2VIABInCghtYXBfdHlw", - "ZRgFIAEoCzITLm9ubnguVHlwZVByb3RvLk1hcEgAEjEKDW9wdGlvbmFsX3R5", - "cGUYCSABKAsyGC5vbm54LlR5cGVQcm90by5PcHRpb25hbEgAEjoKEnNwYXJz", - "ZV90ZW5zb3JfdHlwZRgIIAEoCzIcLm9ubnguVHlwZVByb3RvLlNwYXJzZVRl", - "bnNvckgAEi0KC29wYXF1ZV90eXBlGAcgASgLMhYub25ueC5UeXBlUHJvdG8u", - "T3BhcXVlSAASEgoKZGVub3RhdGlvbhgGIAEoCRpCCgZUZW5zb3ISEQoJZWxl", - "bV90eXBlGAEgASgFEiUKBXNoYXBlGAIgASgLMhYub25ueC5UZW5zb3JTaGFw", - "ZVByb3RvGi4KCFNlcXVlbmNlEiIKCWVsZW1fdHlwZRgBIAEoCzIPLm9ubngu", - "VHlwZVByb3RvGjwKA01hcBIQCghrZXlfdHlwZRgBIAEoBRIjCgp2YWx1ZV90", - "eXBlGAIgASgLMg8ub25ueC5UeXBlUHJvdG8aLgoIT3B0aW9uYWwSIgoJZWxl", - "bV90eXBlGAEgASgLMg8ub25ueC5UeXBlUHJvdG8aSAoMU3BhcnNlVGVuc29y", - "EhEKCWVsZW1fdHlwZRgBIAEoBRIlCgVzaGFwZRgCIAEoCzIWLm9ubnguVGVu", - "c29yU2hhcGVQcm90bxomCgZPcGFxdWUSDgoGZG9tYWluGAEgASgJEgwKBG5h", - "bWUYAiABKAlCBwoFdmFsdWUiNQoST3BlcmF0b3JTZXRJZFByb3RvEg4KBmRv", - "bWFpbhgBIAEoCRIPCgd2ZXJzaW9uGAIgASgDIuUBCg1GdW5jdGlvblByb3Rv", - "EgwKBG5hbWUYASABKAkSDQoFaW5wdXQYBCADKAkSDgoGb3V0cHV0GAUgAygJ", - "EhEKCWF0dHJpYnV0ZRgGIAMoCRIdCgRub2RlGAcgAygLMg8ub25ueC5Ob2Rl", - "UHJvdG8SEgoKZG9jX3N0cmluZxgIIAEoCRIuCgxvcHNldF9pbXBvcnQYCSAD", - "KAsyGC5vbm54Lk9wZXJhdG9yU2V0SWRQcm90bxIOCgZkb21haW4YCiABKAlK", - "BAgCEANKBAgDEARSDXNpbmNlX3ZlcnNpb25SBnN0YXR1cyrkAQoHVmVyc2lv", - "bhISCg5fU1RBUlRfVkVSU0lPThAAEhkKFUlSX1ZFUlNJT05fMjAxN18xMF8x", - "MBABEhkKFUlSX1ZFUlNJT05fMjAxN18xMF8zMBACEhgKFElSX1ZFUlNJT05f", - "MjAxN18xMV8zEAMSGAoUSVJfVkVSU0lPTl8yMDE5XzFfMjIQBBIYChRJUl9W", - "RVJTSU9OXzIwMTlfM18xOBAFEhgKFElSX1ZFUlNJT05fMjAxOV85XzE5EAYS", - "FwoTSVJfVkVSU0lPTl8yMDIwXzVfOBAHEg4KCklSX1ZFUlNJT04QCCouCg5P", - "cGVyYXRvclN0YXR1cxIQCgxFWFBFUklNRU5UQUwQABIKCgZTVEFCTEUQAUIC", - "SANiBnByb3RvMw==")); + "SgQIAxAESgQIBBAFSgQIBhAKUgppcl92ZXJzaW9uUhBwcm9kdWNlcl92ZXJz", + "aW9uUgxwcm9kdWNlcl90YWdSBmRvbWFpbiK4BQoLVGVuc29yUHJvdG8SDAoE", + "ZGltcxgBIAMoAxIRCglkYXRhX3R5cGUYAiABKAUSKgoHc2VnbWVudBgDIAEo", + "CzIZLm9ubnguVGVuc29yUHJvdG8uU2VnbWVudBIWCgpmbG9hdF9kYXRhGAQg", + "AygCQgIQARIWCgppbnQzMl9kYXRhGAUgAygFQgIQARITCgtzdHJpbmdfZGF0", + "YRgGIAMoDBIWCgppbnQ2NF9kYXRhGAcgAygDQgIQARIMCgRuYW1lGAggASgJ", + "EhIKCmRvY19zdHJpbmcYDCABKAkSEAoIcmF3X2RhdGEYCSABKAwSMwoNZXh0", + "ZXJuYWxfZGF0YRgNIAMoCzIcLm9ubnguU3RyaW5nU3RyaW5nRW50cnlQcm90", + "bxI1Cg1kYXRhX2xvY2F0aW9uGA4gASgOMh4ub25ueC5UZW5zb3JQcm90by5E", + "YXRhTG9jYXRpb24SFwoLZG91YmxlX2RhdGEYCiADKAFCAhABEhcKC3VpbnQ2", + "NF9kYXRhGAsgAygEQgIQARolCgdTZWdtZW50Eg0KBWJlZ2luGAEgASgDEgsK", + "A2VuZBgCIAEoAyLaAQoIRGF0YVR5cGUSDQoJVU5ERUZJTkVEEAASCQoFRkxP", + "QVQQARIJCgVVSU5UOBACEggKBElOVDgQAxIKCgZVSU5UMTYQBBIJCgVJTlQx", + "NhAFEgkKBUlOVDMyEAYSCQoFSU5UNjQQBxIKCgZTVFJJTkcQCBIICgRCT09M", + "EAkSCwoHRkxPQVQxNhAKEgoKBkRPVUJMRRALEgoKBlVJTlQzMhAMEgoKBlVJ", + "TlQ2NBANEg0KCUNPTVBMRVg2NBAOEg4KCkNPTVBMRVgxMjgQDxIMCghCRkxP", + "QVQxNhAQIikKDERhdGFMb2NhdGlvbhILCgdERUZBVUxUEAASDAoIRVhURVJO", + "QUwQASJoChFTcGFyc2VUZW5zb3JQcm90bxIhCgZ2YWx1ZXMYASABKAsyES5v", + "bm54LlRlbnNvclByb3RvEiIKB2luZGljZXMYAiABKAsyES5vbm54LlRlbnNv", + "clByb3RvEgwKBGRpbXMYAyADKAMilQEKEFRlbnNvclNoYXBlUHJvdG8SLQoD", + "ZGltGAEgAygLMiAub25ueC5UZW5zb3JTaGFwZVByb3RvLkRpbWVuc2lvbhpS", + "CglEaW1lbnNpb24SEwoJZGltX3ZhbHVlGAEgASgDSAASEwoJZGltX3BhcmFt", + "GAIgASgJSAASEgoKZGVub3RhdGlvbhgDIAEoCUIHCgV2YWx1ZSKlBQoJVHlw", + "ZVByb3RvEi0KC3RlbnNvcl90eXBlGAEgASgLMhYub25ueC5UeXBlUHJvdG8u", + "VGVuc29ySAASMQoNc2VxdWVuY2VfdHlwZRgEIAEoCzIYLm9ubnguVHlwZVBy", + "b3RvLlNlcXVlbmNlSAASJwoIbWFwX3R5cGUYBSABKAsyEy5vbm54LlR5cGVQ", + "cm90by5NYXBIABIxCg1vcHRpb25hbF90eXBlGAkgASgLMhgub25ueC5UeXBl", + "UHJvdG8uT3B0aW9uYWxIABI6ChJzcGFyc2VfdGVuc29yX3R5cGUYCCABKAsy", + "HC5vbm54LlR5cGVQcm90by5TcGFyc2VUZW5zb3JIABItCgtvcGFxdWVfdHlw", + "ZRgHIAEoCzIWLm9ubnguVHlwZVByb3RvLk9wYXF1ZUgAEhIKCmRlbm90YXRp", + "b24YBiABKAkaQgoGVGVuc29yEhEKCWVsZW1fdHlwZRgBIAEoBRIlCgVzaGFw", + "ZRgCIAEoCzIWLm9ubnguVGVuc29yU2hhcGVQcm90bxouCghTZXF1ZW5jZRIi", + "CgllbGVtX3R5cGUYASABKAsyDy5vbm54LlR5cGVQcm90bxo8CgNNYXASEAoI", + "a2V5X3R5cGUYASABKAUSIwoKdmFsdWVfdHlwZRgCIAEoCzIPLm9ubnguVHlw", + "ZVByb3RvGi4KCE9wdGlvbmFsEiIKCWVsZW1fdHlwZRgBIAEoCzIPLm9ubngu", + "VHlwZVByb3RvGkgKDFNwYXJzZVRlbnNvchIRCgllbGVtX3R5cGUYASABKAUS", + "JQoFc2hhcGUYAiABKAsyFi5vbm54LlRlbnNvclNoYXBlUHJvdG8aJgoGT3Bh", + "cXVlEg4KBmRvbWFpbhgBIAEoCRIMCgRuYW1lGAIgASgJQgcKBXZhbHVlIjUK", + "Ek9wZXJhdG9yU2V0SWRQcm90bxIOCgZkb21haW4YASABKAkSDwoHdmVyc2lv", + "bhgCIAEoAyLlAQoNRnVuY3Rpb25Qcm90bxIMCgRuYW1lGAEgASgJEg0KBWlu", + "cHV0GAQgAygJEg4KBm91dHB1dBgFIAMoCRIRCglhdHRyaWJ1dGUYBiADKAkS", + "HQoEbm9kZRgHIAMoCzIPLm9ubnguTm9kZVByb3RvEhIKCmRvY19zdHJpbmcY", + "CCABKAkSLgoMb3BzZXRfaW1wb3J0GAkgAygLMhgub25ueC5PcGVyYXRvclNl", + "dElkUHJvdG8SDgoGZG9tYWluGAogASgJSgQIAhADSgQIAxAEUg1zaW5jZV92", + "ZXJzaW9uUgZzdGF0dXMq5AEKB1ZlcnNpb24SEgoOX1NUQVJUX1ZFUlNJT04Q", + "ABIZChVJUl9WRVJTSU9OXzIwMTdfMTBfMTAQARIZChVJUl9WRVJTSU9OXzIw", + "MTdfMTBfMzAQAhIYChRJUl9WRVJTSU9OXzIwMTdfMTFfMxADEhgKFElSX1ZF", + "UlNJT05fMjAxOV8xXzIyEAQSGAoUSVJfVkVSU0lPTl8yMDE5XzNfMTgQBRIY", + "ChRJUl9WRVJTSU9OXzIwMTlfOV8xORAGEhcKE0lSX1ZFUlNJT05fMjAyMF81", + "XzgQBxIOCgpJUl9WRVJTSU9OEAgqLgoOT3BlcmF0b3JTdGF0dXMSEAoMRVhQ", + "RVJJTUVOVEFMEAASCgoGU1RBQkxFEAFCAkgDYgZwcm90bzM=")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Onnx.Version), typeof(global::Onnx.OperatorStatus), }, null, new pbr::GeneratedClrTypeInfo[] { @@ -251,19 +252,23 @@ public sealed partial class AttributeProto : pb::IMessage private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new AttributeProto()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Onnx.OnnxMlReflection.Descriptor.MessageTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public AttributeProto() { OnConstruction(); } @@ -271,6 +276,7 @@ public AttributeProto() { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public AttributeProto(AttributeProto other) : this() { name_ = other.name_; refAttrName_ = other.refAttrName_; @@ -294,6 +300,7 @@ public AttributeProto(AttributeProto other) : this() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public AttributeProto Clone() { return new AttributeProto(this); } @@ -305,6 +312,7 @@ public AttributeProto Clone() { /// The name field MUST be present for this version of the IR. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Name { get { return name_; } set { @@ -322,6 +330,7 @@ public string Name { /// NOTE: This should ONLY be used in function (sub-graph). It's invalid to be used in main graph. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string RefAttrName { get { return refAttrName_; } set { @@ -336,6 +345,7 @@ public string RefAttrName { /// A human-readable documentation for this attribute. Markdown is allowed. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string DocString { get { return docString_; } set { @@ -355,6 +365,7 @@ public string DocString { /// change was made to accommodate proto3 implementations. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Onnx.AttributeProto.Types.AttributeType Type { get { return type_; } set { @@ -369,6 +380,7 @@ public string DocString { /// Exactly ONE of the following fields must be present for this version of the IR /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public float F { get { return f_; } set { @@ -383,6 +395,7 @@ public float F { /// int /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long I { get { return i_; } set { @@ -397,6 +410,7 @@ public long I { /// UTF-8 string /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pb::ByteString S { get { return s_; } set { @@ -411,6 +425,7 @@ public long I { /// tensor value /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Onnx.TensorProto T { get { return t_; } set { @@ -425,6 +440,7 @@ public long I { /// graph /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Onnx.GraphProto G { get { return g_; } set { @@ -439,6 +455,7 @@ public long I { /// sparse tensor value /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Onnx.SparseTensorProto SparseTensor { get { return sparseTensor_; } set { @@ -454,6 +471,7 @@ public long I { /// optional ValueProto v = 12; // value - subsumes everything but graph /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Onnx.TypeProto Tp { get { return tp_; } set { @@ -470,6 +488,7 @@ public long I { /// list of floats /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Floats { get { return floats_; } } @@ -483,6 +502,7 @@ public long I { /// list of ints /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Ints { get { return ints_; } } @@ -496,6 +516,7 @@ public long I { /// list of UTF-8 strings /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Strings { get { return strings_; } } @@ -509,6 +530,7 @@ public long I { /// list of tensors /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Tensors { get { return tensors_; } } @@ -522,6 +544,7 @@ public long I { /// list of graph /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Graphs { get { return graphs_; } } @@ -535,6 +558,7 @@ public long I { /// list of sparse tensors /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField SparseTensors { get { return sparseTensors_; } } @@ -548,16 +572,19 @@ public long I { /// list of type protos /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField TypeProtos { get { return typeProtos_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as AttributeProto); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(AttributeProto other) { if (ReferenceEquals(other, null)) { return false; @@ -587,6 +614,7 @@ public bool Equals(AttributeProto other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Name.Length != 0) hash ^= Name.GetHashCode(); @@ -614,11 +642,13 @@ public override int GetHashCode() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -682,6 +712,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (Name.Length != 0) { output.WriteRawTag(10); @@ -741,6 +772,7 @@ public void WriteTo(pb::CodedOutputStream output) { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Name.Length != 0) { @@ -790,6 +822,7 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(AttributeProto other) { if (other == null) { return; @@ -850,6 +883,7 @@ public void MergeFrom(AttributeProto other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -953,6 +987,7 @@ public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -1054,6 +1089,7 @@ public void MergeFrom(pb::CodedInputStream input) { #region Nested types /// Container for nested types declared in the AttributeProto message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { /// /// Note: this enum is structurally identical to the OpSchema::AttrType @@ -1094,19 +1130,23 @@ public sealed partial class ValueInfoProto : pb::IMessage private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ValueInfoProto()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Onnx.OnnxMlReflection.Descriptor.MessageTypes[1]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ValueInfoProto() { OnConstruction(); } @@ -1114,6 +1154,7 @@ public ValueInfoProto() { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ValueInfoProto(ValueInfoProto other) : this() { name_ = other.name_; type_ = other.type_ != null ? other.type_.Clone() : null; @@ -1122,6 +1163,7 @@ public ValueInfoProto(ValueInfoProto other) : this() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ValueInfoProto Clone() { return new ValueInfoProto(this); } @@ -1133,6 +1175,7 @@ public ValueInfoProto Clone() { /// This field MUST be present in this version of the IR. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Name { get { return name_; } set { @@ -1148,6 +1191,7 @@ public string Name { /// inputs and outputs of the top-level graph. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Onnx.TypeProto Type { get { return type_; } set { @@ -1162,6 +1206,7 @@ public string Name { /// A human-readable documentation for this value. Markdown is allowed. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string DocString { get { return docString_; } set { @@ -1170,11 +1215,13 @@ public string DocString { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as ValueInfoProto); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(ValueInfoProto other) { if (ReferenceEquals(other, null)) { return false; @@ -1189,6 +1236,7 @@ public bool Equals(ValueInfoProto other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Name.Length != 0) hash ^= Name.GetHashCode(); @@ -1201,11 +1249,13 @@ public override int GetHashCode() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -1230,6 +1280,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (Name.Length != 0) { output.WriteRawTag(10); @@ -1250,6 +1301,7 @@ public void WriteTo(pb::CodedOutputStream output) { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Name.Length != 0) { @@ -1268,6 +1320,7 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(ValueInfoProto other) { if (other == null) { return; @@ -1288,6 +1341,7 @@ public void MergeFrom(ValueInfoProto other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -1320,6 +1374,7 @@ public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -1366,19 +1421,23 @@ public sealed partial class NodeProto : pb::IMessage private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NodeProto()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Onnx.OnnxMlReflection.Descriptor.MessageTypes[2]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NodeProto() { OnConstruction(); } @@ -1386,6 +1445,7 @@ public NodeProto() { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NodeProto(NodeProto other) : this() { input_ = other.input_.Clone(); output_ = other.output_.Clone(); @@ -1398,6 +1458,7 @@ public NodeProto(NodeProto other) : this() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NodeProto Clone() { return new NodeProto(this); } @@ -1411,6 +1472,7 @@ public NodeProto Clone() { /// namespace Value /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Input { get { return input_; } } @@ -1424,6 +1486,7 @@ public NodeProto Clone() { /// namespace Value /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Output { get { return output_; } } @@ -1436,6 +1499,7 @@ public NodeProto Clone() { /// This field MAY be absent in ths version of the IR. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Name { get { return name_; } set { @@ -1450,6 +1514,7 @@ public string Name { /// The symbolic identifier of the Operator to execute. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string OpType { get { return opType_; } set { @@ -1464,6 +1529,7 @@ public string OpType { /// The domain of the OperatorSet that specifies the operator named by op_type. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Domain { get { return domain_; } set { @@ -1480,6 +1546,7 @@ public string Domain { /// Additional named attributes. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Attribute { get { return attribute_; } } @@ -1491,6 +1558,7 @@ public string Domain { /// A human-readable documentation for this node. Markdown is allowed. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string DocString { get { return docString_; } set { @@ -1499,11 +1567,13 @@ public string DocString { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as NodeProto); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(NodeProto other) { if (ReferenceEquals(other, null)) { return false; @@ -1522,6 +1592,7 @@ public bool Equals(NodeProto other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; hash ^= input_.GetHashCode(); @@ -1538,11 +1609,13 @@ public override int GetHashCode() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -1574,6 +1647,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { input_.WriteTo(ref output, _repeated_input_codec); output_.WriteTo(ref output, _repeated_output_codec); @@ -1601,6 +1675,7 @@ public void WriteTo(pb::CodedOutputStream output) { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; size += input_.CalculateSize(_repeated_input_codec); @@ -1625,6 +1700,7 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(NodeProto other) { if (other == null) { return; @@ -1648,6 +1724,7 @@ public void MergeFrom(NodeProto other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -1693,6 +1770,7 @@ public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -1764,19 +1842,23 @@ public sealed partial class TrainingInfoProto : pb::IMessage private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TrainingInfoProto()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Onnx.OnnxMlReflection.Descriptor.MessageTypes[3]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TrainingInfoProto() { OnConstruction(); } @@ -1784,6 +1866,7 @@ public TrainingInfoProto() { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TrainingInfoProto(TrainingInfoProto other) : this() { initialization_ = other.initialization_ != null ? other.initialization_.Clone() : null; algorithm_ = other.algorithm_ != null ? other.algorithm_.Clone() : null; @@ -1793,6 +1876,7 @@ public TrainingInfoProto(TrainingInfoProto other) : this() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TrainingInfoProto Clone() { return new TrainingInfoProto(this); } @@ -1816,6 +1900,7 @@ public TrainingInfoProto Clone() { /// produce any output. Thus, no initializer would be changed by default. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Onnx.GraphProto Initialization { get { return initialization_; } set { @@ -1858,6 +1943,7 @@ public TrainingInfoProto Clone() { /// update any initializers. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Onnx.GraphProto Algorithm { get { return algorithm_; } set { @@ -1880,6 +1966,7 @@ public TrainingInfoProto Clone() { /// by the execution of "initialization". /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField InitializationBinding { get { return initializationBinding_; } } @@ -1932,16 +2019,19 @@ public TrainingInfoProto Clone() { /// by the execution of "algorithm". /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UpdateBinding { get { return updateBinding_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TrainingInfoProto); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TrainingInfoProto other) { if (ReferenceEquals(other, null)) { return false; @@ -1957,6 +2047,7 @@ public bool Equals(TrainingInfoProto other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (initialization_ != null) hash ^= Initialization.GetHashCode(); @@ -1970,11 +2061,13 @@ public override int GetHashCode() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -1997,6 +2090,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (initialization_ != null) { output.WriteRawTag(10); @@ -2015,6 +2109,7 @@ public void WriteTo(pb::CodedOutputStream output) { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (initialization_ != null) { @@ -2032,6 +2127,7 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TrainingInfoProto other) { if (other == null) { return; @@ -2054,6 +2150,7 @@ public void MergeFrom(TrainingInfoProto other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -2093,6 +2190,7 @@ public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -2145,19 +2243,23 @@ public sealed partial class ModelProto : pb::IMessage private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ModelProto()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Onnx.OnnxMlReflection.Descriptor.MessageTypes[4]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ModelProto() { OnConstruction(); } @@ -2165,6 +2267,7 @@ public ModelProto() { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ModelProto(ModelProto other) : this() { irVersion_ = other.irVersion_; opsetImport_ = other.opsetImport_.Clone(); @@ -2181,6 +2284,7 @@ public ModelProto(ModelProto other) : this() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ModelProto Clone() { return new ModelProto(this); } @@ -2193,6 +2297,7 @@ public ModelProto Clone() { /// This field MUST be present. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long IrVersion { get { return irVersion_; } set { @@ -2216,6 +2321,7 @@ public long IrVersion { /// in the referenced operator sets. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField OpsetImport { get { return opsetImport_; } } @@ -2229,6 +2335,7 @@ public long IrVersion { /// emitted the model. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string ProducerName { get { return producerName_; } set { @@ -2245,6 +2352,7 @@ public string ProducerName { /// emitted the model. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string ProducerVersion { get { return producerVersion_; } set { @@ -2264,6 +2372,7 @@ public string ProducerVersion { /// the graph. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Domain { get { return domain_; } set { @@ -2278,6 +2387,7 @@ public string Domain { /// The version of the graph encoded. See Version enum below. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long ModelVersion { get { return modelVersion_; } set { @@ -2292,6 +2402,7 @@ public long ModelVersion { /// A human-readable documentation for this model. Markdown is allowed. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string DocString { get { return docString_; } set { @@ -2306,6 +2417,7 @@ public string DocString { /// The parameterized graph that is evaluated to execute the model. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Onnx.GraphProto Graph { get { return graph_; } set { @@ -2322,6 +2434,7 @@ public string DocString { /// Named metadata values; keys should be distinct. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField MetadataProps { get { return metadataProps_; } } @@ -2343,6 +2456,7 @@ public string DocString { /// If this field is empty, the training behavior of the model is undefined. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField TrainingInfo { get { return trainingInfo_; } } @@ -2357,13 +2471,13 @@ public string DocString { /// /// Name of the function "FunctionProto.name" should be unique within the domain "FunctionProto.domain". /// In case of any conflicts the behavior (whether the model local functions are given higher priority, - /// or standard opserator sets are given higher priotity or this is treated as error) is defined by + /// or standard opserator sets are given higher priotity or this is treated as error) is defined by /// the runtimes. - /// + /// /// The operator sets imported by FunctionProto should be compatible with the ones - /// imported by ModelProto and other model local FunctionProtos. - /// Example, if same operator set say 'A' is imported by a FunctionProto and ModelProto - /// or by 2 FunctionProtos then versions for the operator set may be different but, + /// imported by ModelProto and other model local FunctionProtos. + /// Example, if same operator set say 'A' is imported by a FunctionProto and ModelProto + /// or by 2 FunctionProtos then versions for the operator set may be different but, /// the operator schema returned for op_type, domain, version combination /// for both the versions should be same for every node in the function body. /// @@ -2371,16 +2485,19 @@ public string DocString { /// is not allowed. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Functions { get { return functions_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as ModelProto); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(ModelProto other) { if (ReferenceEquals(other, null)) { return false; @@ -2403,6 +2520,7 @@ public bool Equals(ModelProto other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (IrVersion != 0L) hash ^= IrVersion.GetHashCode(); @@ -2423,11 +2541,13 @@ public override int GetHashCode() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -2472,6 +2592,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (IrVersion != 0L) { output.WriteRawTag(8); @@ -2512,6 +2633,7 @@ public void WriteTo(pb::CodedOutputStream output) { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (IrVersion != 0L) { @@ -2546,6 +2668,7 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(ModelProto other) { if (other == null) { return; @@ -2582,6 +2705,7 @@ public void MergeFrom(ModelProto other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -2646,6 +2770,7 @@ public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -2719,19 +2844,23 @@ public sealed partial class StringStringEntryProto : pb::IMessage _parser = new pb::MessageParser(() => new StringStringEntryProto()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Onnx.OnnxMlReflection.Descriptor.MessageTypes[5]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public StringStringEntryProto() { OnConstruction(); } @@ -2739,6 +2868,7 @@ public StringStringEntryProto() { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public StringStringEntryProto(StringStringEntryProto other) : this() { key_ = other.key_; value_ = other.value_; @@ -2746,6 +2876,7 @@ public StringStringEntryProto(StringStringEntryProto other) : this() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public StringStringEntryProto Clone() { return new StringStringEntryProto(this); } @@ -2754,6 +2885,7 @@ public StringStringEntryProto Clone() { public const int KeyFieldNumber = 1; private string key_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Key { get { return key_; } set { @@ -2765,6 +2897,7 @@ public string Key { public const int ValueFieldNumber = 2; private string value_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Value { get { return value_; } set { @@ -2773,11 +2906,13 @@ public string Value { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as StringStringEntryProto); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(StringStringEntryProto other) { if (ReferenceEquals(other, null)) { return false; @@ -2791,6 +2926,7 @@ public bool Equals(StringStringEntryProto other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Key.Length != 0) hash ^= Key.GetHashCode(); @@ -2802,11 +2938,13 @@ public override int GetHashCode() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -2827,6 +2965,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (Key.Length != 0) { output.WriteRawTag(10); @@ -2843,6 +2982,7 @@ public void WriteTo(pb::CodedOutputStream output) { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Key.Length != 0) { @@ -2858,6 +2998,7 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(StringStringEntryProto other) { if (other == null) { return; @@ -2872,6 +3013,7 @@ public void MergeFrom(StringStringEntryProto other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -2897,6 +3039,7 @@ public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -2927,19 +3070,23 @@ public sealed partial class TensorAnnotation : pb::IMessage private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TensorAnnotation()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Onnx.OnnxMlReflection.Descriptor.MessageTypes[6]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TensorAnnotation() { OnConstruction(); } @@ -2947,6 +3094,7 @@ public TensorAnnotation() { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TensorAnnotation(TensorAnnotation other) : this() { tensorName_ = other.tensorName_; quantParameterTensorNames_ = other.quantParameterTensorNames_.Clone(); @@ -2954,6 +3102,7 @@ public TensorAnnotation(TensorAnnotation other) : this() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TensorAnnotation Clone() { return new TensorAnnotation(this); } @@ -2962,6 +3111,7 @@ public TensorAnnotation Clone() { public const int TensorNameFieldNumber = 1; private string tensorName_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string TensorName { get { return tensorName_; } set { @@ -2981,16 +3131,19 @@ public string TensorName { /// quantization parameter keys. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField QuantParameterTensorNames { get { return quantParameterTensorNames_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TensorAnnotation); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TensorAnnotation other) { if (ReferenceEquals(other, null)) { return false; @@ -3004,6 +3157,7 @@ public bool Equals(TensorAnnotation other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (TensorName.Length != 0) hash ^= TensorName.GetHashCode(); @@ -3015,11 +3169,13 @@ public override int GetHashCode() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -3037,6 +3193,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (TensorName.Length != 0) { output.WriteRawTag(10); @@ -3050,6 +3207,7 @@ public void WriteTo(pb::CodedOutputStream output) { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (TensorName.Length != 0) { @@ -3063,6 +3221,7 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TensorAnnotation other) { if (other == null) { return; @@ -3075,6 +3234,7 @@ public void MergeFrom(TensorAnnotation other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -3100,6 +3260,7 @@ public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -3138,19 +3299,23 @@ public sealed partial class GraphProto : pb::IMessage private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GraphProto()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Onnx.OnnxMlReflection.Descriptor.MessageTypes[7]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public GraphProto() { OnConstruction(); } @@ -3158,6 +3323,7 @@ public GraphProto() { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public GraphProto(GraphProto other) : this() { node_ = other.node_.Clone(); name_ = other.name_; @@ -3172,6 +3338,7 @@ public GraphProto(GraphProto other) : this() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public GraphProto Clone() { return new GraphProto(this); } @@ -3185,6 +3352,7 @@ public GraphProto Clone() { /// The nodes in the graph, sorted topologically. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Node { get { return node_; } } @@ -3196,6 +3364,7 @@ public GraphProto Clone() { /// The name of the graph. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Name { get { return name_; } set { @@ -3215,6 +3384,7 @@ public string Name { /// but the name MAY also appear in the input list. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Initializer { get { return initializer_; } } @@ -3228,6 +3398,7 @@ public string Name { /// Initializers (see above) stored in sparse format. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField SparseInitializer { get { return sparseInitializer_; } } @@ -3239,6 +3410,7 @@ public string Name { /// A human-readable documentation for this graph. Markdown is allowed. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string DocString { get { return docString_; } set { @@ -3255,6 +3427,7 @@ public string DocString { /// The inputs and outputs of the graph. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Input { get { return input_; } } @@ -3265,6 +3438,7 @@ public string DocString { = pb::FieldCodec.ForMessage(98, global::Onnx.ValueInfoProto.Parser); private readonly pbc::RepeatedField output_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Output { get { return output_; } } @@ -3279,6 +3453,7 @@ public string DocString { /// must be distinct. It is optional for a value to appear in value_info list. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField ValueInfo { get { return valueInfo_; } } @@ -3295,16 +3470,19 @@ public string DocString { /// which means, tensor 'a_scale' and tensor 'a_zero_point' are scale and zero point of tensor 'a' in the model. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField QuantizationAnnotation { get { return quantizationAnnotation_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as GraphProto); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(GraphProto other) { if (ReferenceEquals(other, null)) { return false; @@ -3325,6 +3503,7 @@ public bool Equals(GraphProto other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; hash ^= node_.GetHashCode(); @@ -3343,11 +3522,13 @@ public override int GetHashCode() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -3375,6 +3556,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { node_.WriteTo(ref output, _repeated_node_codec); if (Name.Length != 0) { @@ -3398,6 +3580,7 @@ public void WriteTo(pb::CodedOutputStream output) { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; size += node_.CalculateSize(_repeated_node_codec); @@ -3420,6 +3603,7 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(GraphProto other) { if (other == null) { return; @@ -3441,6 +3625,7 @@ public void MergeFrom(GraphProto other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -3494,6 +3679,7 @@ public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -3557,19 +3743,23 @@ public sealed partial class TensorProto : pb::IMessage private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TensorProto()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Onnx.OnnxMlReflection.Descriptor.MessageTypes[8]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TensorProto() { OnConstruction(); } @@ -3577,6 +3767,7 @@ public TensorProto() { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TensorProto(TensorProto other) : this() { dims_ = other.dims_.Clone(); dataType_ = other.dataType_; @@ -3596,6 +3787,7 @@ public TensorProto(TensorProto other) : this() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TensorProto Clone() { return new TensorProto(this); } @@ -3609,6 +3801,7 @@ public TensorProto Clone() { /// The shape of the tensor. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Dims { get { return dims_; } } @@ -3621,6 +3814,7 @@ public TensorProto Clone() { /// This field MUST have a valid TensorProto.DataType value /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int DataType { get { return dataType_; } set { @@ -3632,6 +3826,7 @@ public int DataType { public const int SegmentFieldNumber = 3; private global::Onnx.TensorProto.Types.Segment segment_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Onnx.TensorProto.Types.Segment Segment { get { return segment_; } set { @@ -3654,6 +3849,7 @@ public int DataType { /// When this field is present, the data_type field MUST be FLOAT or COMPLEX64. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField FloatData { get { return floatData_; } } @@ -3671,6 +3867,7 @@ public int DataType { /// INT32, INT16, INT8, UINT16, UINT8, BOOL, or FLOAT16 /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Int32Data { get { return int32Data_; } } @@ -3688,6 +3885,7 @@ public int DataType { /// When this field is present, the data_type field MUST be STRING /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField StringData { get { return stringData_; } } @@ -3702,6 +3900,7 @@ public int DataType { /// When this field is present, the data_type field MUST be INT64 /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Int64Data { get { return int64Data_; } } @@ -3713,6 +3912,7 @@ public int DataType { /// Optionally, a name for the tensor. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Name { get { return name_; } set { @@ -3727,6 +3927,7 @@ public string Name { /// A human-readable documentation for this tensor. Markdown is allowed. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string DocString { get { return docString_; } set { @@ -3755,6 +3956,7 @@ public string DocString { /// When this field is present, the data_type field MUST NOT be STRING or UNDEFINED /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pb::ByteString RawData { get { return rawData_; } set { @@ -3779,6 +3981,7 @@ public string DocString { /// - "checksum" (optional) - SHA1 digest of file specified in under 'location' key. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField ExternalData { get { return externalData_; } } @@ -3790,6 +3993,7 @@ public string DocString { /// If value not set, data is stored in raw_data (if set) otherwise in type-specified field. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Onnx.TensorProto.Types.DataLocation DataLocation { get { return dataLocation_; } set { @@ -3812,6 +4016,7 @@ public string DocString { /// When this field is present, the data_type field MUST be DOUBLE or COMPLEX128 /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField DoubleData { get { return doubleData_; } } @@ -3827,16 +4032,19 @@ public string DocString { /// UINT32 or UINT64 /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Uint64Data { get { return uint64Data_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TensorProto); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TensorProto other) { if (ReferenceEquals(other, null)) { return false; @@ -3862,6 +4070,7 @@ public bool Equals(TensorProto other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; hash ^= dims_.GetHashCode(); @@ -3885,11 +4094,13 @@ public override int GetHashCode() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -3934,6 +4145,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { dims_.WriteTo(ref output, _repeated_dims_codec); if (DataType != 0) { @@ -3974,6 +4186,7 @@ public void WriteTo(pb::CodedOutputStream output) { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; size += dims_.CalculateSize(_repeated_dims_codec); @@ -4009,6 +4222,7 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TensorProto other) { if (other == null) { return; @@ -4046,6 +4260,7 @@ public void MergeFrom(TensorProto other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -4128,6 +4343,7 @@ public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -4208,6 +4424,7 @@ public void MergeFrom(pb::CodedInputStream input) { #region Nested types /// Container for nested types declared in the TensorProto message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { public enum DataType { [pbr::OriginalName("UNDEFINED")] Undefined = 0, @@ -4294,19 +4511,23 @@ public sealed partial class Segment : pb::IMessage private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Segment()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Onnx.TensorProto.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Segment() { OnConstruction(); } @@ -4314,6 +4535,7 @@ public Segment() { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Segment(Segment other) : this() { begin_ = other.begin_; end_ = other.end_; @@ -4321,6 +4543,7 @@ public Segment(Segment other) : this() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Segment Clone() { return new Segment(this); } @@ -4329,6 +4552,7 @@ public Segment Clone() { public const int BeginFieldNumber = 1; private long begin_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long Begin { get { return begin_; } set { @@ -4340,6 +4564,7 @@ public long Begin { public const int EndFieldNumber = 2; private long end_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long End { get { return end_; } set { @@ -4348,11 +4573,13 @@ public long End { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Segment); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Segment other) { if (ReferenceEquals(other, null)) { return false; @@ -4366,6 +4593,7 @@ public bool Equals(Segment other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Begin != 0L) hash ^= Begin.GetHashCode(); @@ -4377,11 +4605,13 @@ public override int GetHashCode() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -4402,6 +4632,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (Begin != 0L) { output.WriteRawTag(8); @@ -4418,6 +4649,7 @@ public void WriteTo(pb::CodedOutputStream output) { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Begin != 0L) { @@ -4433,6 +4665,7 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Segment other) { if (other == null) { return; @@ -4447,6 +4680,7 @@ public void MergeFrom(Segment other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -4472,6 +4706,7 @@ public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -4510,19 +4745,23 @@ public sealed partial class SparseTensorProto : pb::IMessage private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SparseTensorProto()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Onnx.OnnxMlReflection.Descriptor.MessageTypes[9]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SparseTensorProto() { OnConstruction(); } @@ -4530,6 +4769,7 @@ public SparseTensorProto() { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SparseTensorProto(SparseTensorProto other) : this() { values_ = other.values_ != null ? other.values_.Clone() : null; indices_ = other.indices_ != null ? other.indices_.Clone() : null; @@ -4538,6 +4778,7 @@ public SparseTensorProto(SparseTensorProto other) : this() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SparseTensorProto Clone() { return new SparseTensorProto(this); } @@ -4552,6 +4793,7 @@ public SparseTensorProto Clone() { /// when used in sparse_initializer list. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Onnx.TensorProto Values { get { return values_; } set { @@ -4575,6 +4817,7 @@ public SparseTensorProto Clone() { /// e.g., index-value [1,4] must appear before [2,1] /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Onnx.TensorProto Indices { get { return indices_; } set { @@ -4591,16 +4834,19 @@ public SparseTensorProto Clone() { /// The shape of the underlying dense-tensor: [dim_1, dim_2, ... dim_rank] /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Dims { get { return dims_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as SparseTensorProto); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(SparseTensorProto other) { if (ReferenceEquals(other, null)) { return false; @@ -4615,6 +4861,7 @@ public bool Equals(SparseTensorProto other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (values_ != null) hash ^= Values.GetHashCode(); @@ -4627,11 +4874,13 @@ public override int GetHashCode() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -4653,6 +4902,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (values_ != null) { output.WriteRawTag(10); @@ -4670,6 +4920,7 @@ public void WriteTo(pb::CodedOutputStream output) { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (values_ != null) { @@ -4686,6 +4937,7 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(SparseTensorProto other) { if (other == null) { return; @@ -4707,6 +4959,7 @@ public void MergeFrom(SparseTensorProto other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -4743,6 +4996,7 @@ public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -4789,19 +5043,23 @@ public sealed partial class TensorShapeProto : pb::IMessage private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TensorShapeProto()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Onnx.OnnxMlReflection.Descriptor.MessageTypes[10]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TensorShapeProto() { OnConstruction(); } @@ -4809,12 +5067,14 @@ public TensorShapeProto() { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TensorShapeProto(TensorShapeProto other) : this() { dim_ = other.dim_.Clone(); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TensorShapeProto Clone() { return new TensorShapeProto(this); } @@ -4825,16 +5085,19 @@ public TensorShapeProto Clone() { = pb::FieldCodec.ForMessage(10, global::Onnx.TensorShapeProto.Types.Dimension.Parser); private readonly pbc::RepeatedField dim_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Dim { get { return dim_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TensorShapeProto); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TensorShapeProto other) { if (ReferenceEquals(other, null)) { return false; @@ -4847,6 +5110,7 @@ public bool Equals(TensorShapeProto other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; hash ^= dim_.GetHashCode(); @@ -4857,11 +5121,13 @@ public override int GetHashCode() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -4875,6 +5141,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { dim_.WriteTo(ref output, _repeated_dim_codec); if (_unknownFields != null) { @@ -4884,6 +5151,7 @@ public void WriteTo(pb::CodedOutputStream output) { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; size += dim_.CalculateSize(_repeated_dim_codec); @@ -4894,6 +5162,7 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TensorShapeProto other) { if (other == null) { return; @@ -4903,6 +5172,7 @@ public void MergeFrom(TensorShapeProto other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -4924,6 +5194,7 @@ public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -4943,6 +5214,7 @@ public void MergeFrom(pb::CodedInputStream input) { #region Nested types /// Container for nested types declared in the TensorShapeProto message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { public sealed partial class Dimension : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE @@ -4952,19 +5224,23 @@ public sealed partial class Dimension : pb::IMessage private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Dimension()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Onnx.TensorShapeProto.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Dimension() { OnConstruction(); } @@ -4972,6 +5248,7 @@ public Dimension() { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Dimension(Dimension other) : this() { denotation_ = other.denotation_; switch (other.ValueCase) { @@ -4987,6 +5264,7 @@ public Dimension(Dimension other) : this() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Dimension Clone() { return new Dimension(this); } @@ -4994,6 +5272,7 @@ public Dimension Clone() { /// Field number for the "dim_value" field. public const int DimValueFieldNumber = 1; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long DimValue { get { return valueCase_ == ValueOneofCase.DimValue ? (long) value_ : 0L; } set { @@ -5008,6 +5287,7 @@ public long DimValue { /// namespace Shape /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string DimParam { get { return valueCase_ == ValueOneofCase.DimParam ? (string) value_ : ""; } set { @@ -5023,10 +5303,11 @@ public string DimParam { /// Standard denotation can optionally be used to denote tensor /// dimensions with standard semantic descriptions to ensure /// that operations are applied to the correct axis of a tensor. - /// Refer to https://github.com/onnx/onnx/blob/master/docs/DimensionDenotation.md#denotation-definition + /// Refer to https://github.com/onnx/onnx/blob/main/docs/DimensionDenotation.md#denotation-definition /// for pre-defined dimension denotations. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Denotation { get { return denotation_; } set { @@ -5043,22 +5324,26 @@ public enum ValueOneofCase { } private ValueOneofCase valueCase_ = ValueOneofCase.None; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ValueOneofCase ValueCase { get { return valueCase_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearValue() { valueCase_ = ValueOneofCase.None; value_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Dimension); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Dimension other) { if (ReferenceEquals(other, null)) { return false; @@ -5074,6 +5359,7 @@ public bool Equals(Dimension other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (valueCase_ == ValueOneofCase.DimValue) hash ^= DimValue.GetHashCode(); @@ -5087,11 +5373,13 @@ public override int GetHashCode() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -5116,6 +5404,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (valueCase_ == ValueOneofCase.DimValue) { output.WriteRawTag(8); @@ -5136,6 +5425,7 @@ public void WriteTo(pb::CodedOutputStream output) { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (valueCase_ == ValueOneofCase.DimValue) { @@ -5154,6 +5444,7 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Dimension other) { if (other == null) { return; @@ -5174,6 +5465,7 @@ public void MergeFrom(Dimension other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -5203,6 +5495,7 @@ public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -5247,19 +5540,23 @@ public sealed partial class TypeProto : pb::IMessage private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TypeProto()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Onnx.OnnxMlReflection.Descriptor.MessageTypes[11]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TypeProto() { OnConstruction(); } @@ -5267,6 +5564,7 @@ public TypeProto() { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TypeProto(TypeProto other) : this() { denotation_ = other.denotation_; switch (other.ValueCase) { @@ -5294,6 +5592,7 @@ public TypeProto(TypeProto other) : this() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TypeProto Clone() { return new TypeProto(this); } @@ -5304,6 +5603,7 @@ public TypeProto Clone() { /// The type of a tensor. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Onnx.TypeProto.Types.Tensor TensorType { get { return valueCase_ == ValueOneofCase.TensorType ? (global::Onnx.TypeProto.Types.Tensor) value_ : null; } set { @@ -5318,6 +5618,7 @@ public TypeProto Clone() { /// The type of a sequence. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Onnx.TypeProto.Types.Sequence SequenceType { get { return valueCase_ == ValueOneofCase.SequenceType ? (global::Onnx.TypeProto.Types.Sequence) value_ : null; } set { @@ -5332,6 +5633,7 @@ public TypeProto Clone() { /// The type of a map. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Onnx.TypeProto.Types.Map MapType { get { return valueCase_ == ValueOneofCase.MapType ? (global::Onnx.TypeProto.Types.Map) value_ : null; } set { @@ -5346,6 +5648,7 @@ public TypeProto Clone() { /// The type of an optional. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Onnx.TypeProto.Types.Optional OptionalType { get { return valueCase_ == ValueOneofCase.OptionalType ? (global::Onnx.TypeProto.Types.Optional) value_ : null; } set { @@ -5360,6 +5663,7 @@ public TypeProto Clone() { /// Type of the sparse tensor /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Onnx.TypeProto.Types.SparseTensor SparseTensorType { get { return valueCase_ == ValueOneofCase.SparseTensorType ? (global::Onnx.TypeProto.Types.SparseTensor) value_ : null; } set { @@ -5371,6 +5675,7 @@ public TypeProto Clone() { /// Field number for the "opaque_type" field. public const int OpaqueTypeFieldNumber = 7; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Onnx.TypeProto.Types.Opaque OpaqueType { get { return valueCase_ == ValueOneofCase.OpaqueType ? (global::Onnx.TypeProto.Types.Opaque) value_ : null; } set { @@ -5385,10 +5690,11 @@ public TypeProto Clone() { /// /// An optional denotation can be used to denote the whole /// type with a standard semantic description as to what is - /// stored inside. Refer to https://github.com/onnx/onnx/blob/master/docs/TypeDenotation.md#type-denotation-definition + /// stored inside. Refer to https://github.com/onnx/onnx/blob/main/docs/TypeDenotation.md#type-denotation-definition /// for pre-defined type denotations. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Denotation { get { return denotation_; } set { @@ -5409,22 +5715,26 @@ public enum ValueOneofCase { } private ValueOneofCase valueCase_ = ValueOneofCase.None; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ValueOneofCase ValueCase { get { return valueCase_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearValue() { valueCase_ = ValueOneofCase.None; value_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TypeProto); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TypeProto other) { if (ReferenceEquals(other, null)) { return false; @@ -5444,6 +5754,7 @@ public bool Equals(TypeProto other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (valueCase_ == ValueOneofCase.TensorType) hash ^= TensorType.GetHashCode(); @@ -5461,11 +5772,13 @@ public override int GetHashCode() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -5506,6 +5819,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (valueCase_ == ValueOneofCase.TensorType) { output.WriteRawTag(10); @@ -5542,6 +5856,7 @@ public void WriteTo(pb::CodedOutputStream output) { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (valueCase_ == ValueOneofCase.TensorType) { @@ -5572,6 +5887,7 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TypeProto other) { if (other == null) { return; @@ -5622,6 +5938,7 @@ public void MergeFrom(TypeProto other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -5697,6 +6014,7 @@ public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -5770,6 +6088,7 @@ public void MergeFrom(pb::CodedInputStream input) { #region Nested types /// Container for nested types declared in the TypeProto message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { public sealed partial class Tensor : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE @@ -5779,19 +6098,23 @@ public sealed partial class Tensor : pb::IMessage private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Tensor()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Onnx.TypeProto.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Tensor() { OnConstruction(); } @@ -5799,6 +6122,7 @@ public Tensor() { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Tensor(Tensor other) : this() { elemType_ = other.elemType_; shape_ = other.shape_ != null ? other.shape_.Clone() : null; @@ -5806,6 +6130,7 @@ public Tensor(Tensor other) : this() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Tensor Clone() { return new Tensor(this); } @@ -5819,6 +6144,7 @@ public Tensor Clone() { /// This field MUST be present for this version of the IR. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int ElemType { get { return elemType_; } set { @@ -5830,6 +6156,7 @@ public int ElemType { public const int ShapeFieldNumber = 2; private global::Onnx.TensorShapeProto shape_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Onnx.TensorShapeProto Shape { get { return shape_; } set { @@ -5838,11 +6165,13 @@ public int ElemType { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Tensor); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Tensor other) { if (ReferenceEquals(other, null)) { return false; @@ -5856,6 +6185,7 @@ public bool Equals(Tensor other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (ElemType != 0) hash ^= ElemType.GetHashCode(); @@ -5867,11 +6197,13 @@ public override int GetHashCode() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -5892,6 +6224,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (ElemType != 0) { output.WriteRawTag(8); @@ -5908,6 +6241,7 @@ public void WriteTo(pb::CodedOutputStream output) { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (ElemType != 0) { @@ -5923,6 +6257,7 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Tensor other) { if (other == null) { return; @@ -5940,6 +6275,7 @@ public void MergeFrom(Tensor other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -5968,6 +6304,7 @@ public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -6004,19 +6341,23 @@ public sealed partial class Sequence : pb::IMessage private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Sequence()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Onnx.TypeProto.Descriptor.NestedTypes[1]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Sequence() { OnConstruction(); } @@ -6024,12 +6365,14 @@ public Sequence() { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Sequence(Sequence other) : this() { elemType_ = other.elemType_ != null ? other.elemType_.Clone() : null; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Sequence Clone() { return new Sequence(this); } @@ -6042,6 +6385,7 @@ public Sequence Clone() { /// This field MUST be present for this version of the IR. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Onnx.TypeProto ElemType { get { return elemType_; } set { @@ -6050,11 +6394,13 @@ public Sequence Clone() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Sequence); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Sequence other) { if (ReferenceEquals(other, null)) { return false; @@ -6067,6 +6413,7 @@ public bool Equals(Sequence other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (elemType_ != null) hash ^= ElemType.GetHashCode(); @@ -6077,11 +6424,13 @@ public override int GetHashCode() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -6098,6 +6447,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (elemType_ != null) { output.WriteRawTag(10); @@ -6110,6 +6460,7 @@ public void WriteTo(pb::CodedOutputStream output) { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (elemType_ != null) { @@ -6122,6 +6473,7 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Sequence other) { if (other == null) { return; @@ -6136,6 +6488,7 @@ public void MergeFrom(Sequence other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -6160,6 +6513,7 @@ public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -6192,19 +6546,23 @@ public sealed partial class Map : pb::IMessage private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Map()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Onnx.TypeProto.Descriptor.NestedTypes[2]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Map() { OnConstruction(); } @@ -6212,6 +6570,7 @@ public Map() { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Map(Map other) : this() { keyType_ = other.keyType_; valueType_ = other.valueType_ != null ? other.valueType_.Clone() : null; @@ -6219,6 +6578,7 @@ public Map(Map other) : this() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Map Clone() { return new Map(this); } @@ -6232,6 +6592,7 @@ public Map Clone() { /// This field MUST refer to an integral type ([U]INT{8|16|32|64}) or STRING /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int KeyType { get { return keyType_; } set { @@ -6246,6 +6607,7 @@ public int KeyType { /// This field MUST be present for this version of the IR. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Onnx.TypeProto ValueType { get { return valueType_; } set { @@ -6254,11 +6616,13 @@ public int KeyType { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Map); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Map other) { if (ReferenceEquals(other, null)) { return false; @@ -6272,6 +6636,7 @@ public bool Equals(Map other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (KeyType != 0) hash ^= KeyType.GetHashCode(); @@ -6283,11 +6648,13 @@ public override int GetHashCode() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -6308,6 +6675,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (KeyType != 0) { output.WriteRawTag(8); @@ -6324,6 +6692,7 @@ public void WriteTo(pb::CodedOutputStream output) { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (KeyType != 0) { @@ -6339,6 +6708,7 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Map other) { if (other == null) { return; @@ -6356,6 +6726,7 @@ public void MergeFrom(Map other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -6384,6 +6755,7 @@ public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -6420,19 +6792,23 @@ public sealed partial class Optional : pb::IMessage private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Optional()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Onnx.TypeProto.Descriptor.NestedTypes[3]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Optional() { OnConstruction(); } @@ -6440,12 +6816,14 @@ public Optional() { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Optional(Optional other) : this() { elemType_ = other.elemType_ != null ? other.elemType_.Clone() : null; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Optional Clone() { return new Optional(this); } @@ -6459,6 +6837,7 @@ public Optional Clone() { /// Possible values correspond to OptionalProto.DataType enum /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Onnx.TypeProto ElemType { get { return elemType_; } set { @@ -6467,11 +6846,13 @@ public Optional Clone() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Optional); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Optional other) { if (ReferenceEquals(other, null)) { return false; @@ -6484,6 +6865,7 @@ public bool Equals(Optional other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (elemType_ != null) hash ^= ElemType.GetHashCode(); @@ -6494,11 +6876,13 @@ public override int GetHashCode() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -6515,6 +6899,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (elemType_ != null) { output.WriteRawTag(10); @@ -6527,6 +6912,7 @@ public void WriteTo(pb::CodedOutputStream output) { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (elemType_ != null) { @@ -6539,6 +6925,7 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Optional other) { if (other == null) { return; @@ -6553,6 +6940,7 @@ public void MergeFrom(Optional other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -6577,6 +6965,7 @@ public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -6606,19 +6995,23 @@ public sealed partial class SparseTensor : pb::IMessage private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SparseTensor()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Onnx.TypeProto.Descriptor.NestedTypes[4]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SparseTensor() { OnConstruction(); } @@ -6626,6 +7019,7 @@ public SparseTensor() { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SparseTensor(SparseTensor other) : this() { elemType_ = other.elemType_; shape_ = other.shape_ != null ? other.shape_.Clone() : null; @@ -6633,6 +7027,7 @@ public SparseTensor(SparseTensor other) : this() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SparseTensor Clone() { return new SparseTensor(this); } @@ -6646,6 +7041,7 @@ public SparseTensor Clone() { /// This field MUST be present for this version of the IR. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int ElemType { get { return elemType_; } set { @@ -6657,6 +7053,7 @@ public int ElemType { public const int ShapeFieldNumber = 2; private global::Onnx.TensorShapeProto shape_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Onnx.TensorShapeProto Shape { get { return shape_; } set { @@ -6665,11 +7062,13 @@ public int ElemType { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as SparseTensor); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(SparseTensor other) { if (ReferenceEquals(other, null)) { return false; @@ -6683,6 +7082,7 @@ public bool Equals(SparseTensor other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (ElemType != 0) hash ^= ElemType.GetHashCode(); @@ -6694,11 +7094,13 @@ public override int GetHashCode() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -6719,6 +7121,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (ElemType != 0) { output.WriteRawTag(8); @@ -6735,6 +7138,7 @@ public void WriteTo(pb::CodedOutputStream output) { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (ElemType != 0) { @@ -6750,6 +7154,7 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(SparseTensor other) { if (other == null) { return; @@ -6767,6 +7172,7 @@ public void MergeFrom(SparseTensor other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -6795,6 +7201,7 @@ public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -6828,19 +7235,23 @@ public sealed partial class Opaque : pb::IMessage private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Opaque()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Onnx.TypeProto.Descriptor.NestedTypes[5]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Opaque() { OnConstruction(); } @@ -6848,6 +7259,7 @@ public Opaque() { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Opaque(Opaque other) : this() { domain_ = other.domain_; name_ = other.name_; @@ -6855,6 +7267,7 @@ public Opaque(Opaque other) : this() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Opaque Clone() { return new Opaque(this); } @@ -6866,6 +7279,7 @@ public Opaque Clone() { /// When missing, the domain is the same as the model's. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Domain { get { return domain_; } set { @@ -6880,6 +7294,7 @@ public string Domain { /// The name is optional but significant when provided. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Name { get { return name_; } set { @@ -6888,11 +7303,13 @@ public string Name { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Opaque); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Opaque other) { if (ReferenceEquals(other, null)) { return false; @@ -6906,6 +7323,7 @@ public bool Equals(Opaque other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Domain.Length != 0) hash ^= Domain.GetHashCode(); @@ -6917,11 +7335,13 @@ public override int GetHashCode() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -6942,6 +7362,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (Domain.Length != 0) { output.WriteRawTag(10); @@ -6958,6 +7379,7 @@ public void WriteTo(pb::CodedOutputStream output) { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Domain.Length != 0) { @@ -6973,6 +7395,7 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Opaque other) { if (other == null) { return; @@ -6987,6 +7410,7 @@ public void MergeFrom(Opaque other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -7012,6 +7436,7 @@ public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -7052,19 +7477,23 @@ public sealed partial class OperatorSetIdProto : pb::IMessage _parser = new pb::MessageParser(() => new OperatorSetIdProto()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Onnx.OnnxMlReflection.Descriptor.MessageTypes[12]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OperatorSetIdProto() { OnConstruction(); } @@ -7072,6 +7501,7 @@ public OperatorSetIdProto() { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OperatorSetIdProto(OperatorSetIdProto other) : this() { domain_ = other.domain_; version_ = other.version_; @@ -7079,6 +7509,7 @@ public OperatorSetIdProto(OperatorSetIdProto other) : this() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OperatorSetIdProto Clone() { return new OperatorSetIdProto(this); } @@ -7093,6 +7524,7 @@ public OperatorSetIdProto Clone() { /// This field MUST be present in this version of the IR when referring to any other operator set. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Domain { get { return domain_; } set { @@ -7108,6 +7540,7 @@ public string Domain { /// This field MUST be present in this version of the IR. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long Version { get { return version_; } set { @@ -7116,11 +7549,13 @@ public long Version { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as OperatorSetIdProto); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(OperatorSetIdProto other) { if (ReferenceEquals(other, null)) { return false; @@ -7134,6 +7569,7 @@ public bool Equals(OperatorSetIdProto other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Domain.Length != 0) hash ^= Domain.GetHashCode(); @@ -7145,11 +7581,13 @@ public override int GetHashCode() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -7170,6 +7608,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (Domain.Length != 0) { output.WriteRawTag(10); @@ -7186,6 +7625,7 @@ public void WriteTo(pb::CodedOutputStream output) { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Domain.Length != 0) { @@ -7201,6 +7641,7 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(OperatorSetIdProto other) { if (other == null) { return; @@ -7215,6 +7656,7 @@ public void MergeFrom(OperatorSetIdProto other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -7240,6 +7682,7 @@ public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -7270,19 +7713,23 @@ public sealed partial class FunctionProto : pb::IMessage private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FunctionProto()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Onnx.OnnxMlReflection.Descriptor.MessageTypes[13]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FunctionProto() { OnConstruction(); } @@ -7290,6 +7737,7 @@ public FunctionProto() { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FunctionProto(FunctionProto other) : this() { name_ = other.name_; input_ = other.input_.Clone(); @@ -7303,6 +7751,7 @@ public FunctionProto(FunctionProto other) : this() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FunctionProto Clone() { return new FunctionProto(this); } @@ -7316,6 +7765,7 @@ public FunctionProto Clone() { /// the FunctionProto. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Name { get { return name_; } set { @@ -7332,6 +7782,7 @@ public string Name { /// The inputs and outputs of the function. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Input { get { return input_; } } @@ -7342,6 +7793,7 @@ public string Name { = pb::FieldCodec.ForString(42); private readonly pbc::RepeatedField output_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Output { get { return output_; } } @@ -7355,6 +7807,7 @@ public string Name { /// The attributes of the function. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Attribute { get { return attribute_; } } @@ -7368,6 +7821,7 @@ public string Name { /// The nodes in the function. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Node { get { return node_; } } @@ -7379,6 +7833,7 @@ public string Name { /// A human-readable documentation for this function. Markdown is allowed. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string DocString { get { return docString_; } set { @@ -7392,6 +7847,7 @@ public string DocString { = pb::FieldCodec.ForMessage(74, global::Onnx.OperatorSetIdProto.Parser); private readonly pbc::RepeatedField opsetImport_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField OpsetImport { get { return opsetImport_; } } @@ -7404,6 +7860,7 @@ public string DocString { /// the FunctionProto. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Domain { get { return domain_; } set { @@ -7412,11 +7869,13 @@ public string Domain { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as FunctionProto); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(FunctionProto other) { if (ReferenceEquals(other, null)) { return false; @@ -7436,6 +7895,7 @@ public bool Equals(FunctionProto other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Name.Length != 0) hash ^= Name.GetHashCode(); @@ -7453,11 +7913,13 @@ public override int GetHashCode() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -7487,6 +7949,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (Name.Length != 0) { output.WriteRawTag(10); @@ -7512,6 +7975,7 @@ public void WriteTo(pb::CodedOutputStream output) { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Name.Length != 0) { @@ -7535,6 +7999,7 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(FunctionProto other) { if (other == null) { return; @@ -7557,6 +8022,7 @@ public void MergeFrom(FunctionProto other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -7606,6 +8072,7 @@ public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { diff --git a/csharp/test/Microsoft.ML.OnnxRuntime.Tests.NetCoreApp/InferenceTest.netcore.cs b/csharp/test/Microsoft.ML.OnnxRuntime.Tests.NetCoreApp/InferenceTest.netcore.cs index 223c4f9fdd93b..393b6dd1d11f7 100644 --- a/csharp/test/Microsoft.ML.OnnxRuntime.Tests.NetCoreApp/InferenceTest.netcore.cs +++ b/csharp/test/Microsoft.ML.OnnxRuntime.Tests.NetCoreApp/InferenceTest.netcore.cs @@ -343,6 +343,18 @@ private static Dictionary GetSkippedModels(DirectoryInfo modelsD { "test_identity_opt", "opset16 version not implemented yet"}, { "test_if_opt", "opset16 version not implemented yet"}, { "test_loop16_seq_none", "opset16 version not implemented yet"}, + { "test_sequence_map_extract_shapes", "sequence type is not supported in test infra." }, + { "test_sequence_map_identity_1_sequence_1_tensor", "sequence type is not supported in test infra." }, + { "test_sequence_map_identity_1_sequence_1_tensor_expanded", "sequence type is not supported in test infra." }, + { "test_sequence_map_add_1_sequence_1_tensor", "sequence type is not supported in test infra." }, + { "test_sequence_map_identity_1_sequence_expanded", "sequence type is not supported in test infra." }, + { "test_sequence_map_identity_2_sequences", "sequence type is not supported in test infra." }, + { "test_sequence_map_add_2_sequences_expanded", "sequence type is not supported in test infra." }, + { "test_sequence_map_identity_2_sequences_expanded", "sequence type is not supported in test infra." }, + { "test_sequence_map_extract_shapes_expanded", "sequence type is not supported in test infra." }, + { "test_sequence_map_add_1_sequence_1_tensor_expanded", "sequence type is not supported in test infra." }, + { "test_sequence_map_add_2_sequences", "sequence type is not supported in test infra." }, + { "test_sequence_map_identity_1_sequence", "sequence type is not supported in test infra." } }; // The following models fails on nocontribops win CI @@ -518,6 +530,10 @@ private void TestPreTrainedModels(string opset, string modelName) { Assert.Equal(result.AsTensor(), outputValue.AsTensor(), new FloatComparer()); } + else if (outputMeta.ElementType == typeof(double)) + { + Assert.Equal(result.AsTensor(), outputValue.AsTensor(), new DoubleComparer()); + } else if (outputMeta.ElementType == typeof(int)) { Assert.Equal(result.AsTensor(), outputValue.AsTensor(), new ExactComparer()); @@ -560,12 +576,12 @@ private void TestPreTrainedModels(string opset, string modelName) } else { - Assert.True(false, "The TestPretrainedModels does not yet support output of type " + nameof(outputMeta.ElementType)); + Assert.True(false, $"{nameof(TestPreTrainedModels)} does not yet support output of type {outputMeta.ElementType}"); } } else { - Assert.True(false, "TestPretrainedModel cannot handle non-tensor outputs yet"); + Assert.True(false, $"{nameof(TestPreTrainedModels)} cannot handle non-tensor outputs yet"); } } } @@ -808,4 +824,4 @@ static string GetTestModelsDir() return modelsDir; } } -} \ No newline at end of file +} diff --git a/csharp/tools/Microsoft.ML.OnnxRuntime.PerfTool/OnnxMl.cs b/csharp/tools/Microsoft.ML.OnnxRuntime.PerfTool/OnnxMl.cs index a8d05aa458ffb..8805b95839f28 100644 --- a/csharp/tools/Microsoft.ML.OnnxRuntime.PerfTool/OnnxMl.cs +++ b/csharp/tools/Microsoft.ML.OnnxRuntime.PerfTool/OnnxMl.cs @@ -62,7 +62,7 @@ static OnnxMlReflection() { "Z0VudHJ5UHJvdG8SCwoDa2V5GAEgASgJEg0KBXZhbHVlGAIgASgJImsKEFRl", "bnNvckFubm90YXRpb24SEwoLdGVuc29yX25hbWUYASABKAkSQgoccXVhbnRf", "cGFyYW1ldGVyX3RlbnNvcl9uYW1lcxgCIAMoCzIcLm9ubnguU3RyaW5nU3Ry", - "aW5nRW50cnlQcm90byLYAgoKR3JhcGhQcm90bxIdCgRub2RlGAEgAygLMg8u", + "aW5nRW50cnlQcm90byKeAwoKR3JhcGhQcm90bxIdCgRub2RlGAEgAygLMg8u", "b25ueC5Ob2RlUHJvdG8SDAoEbmFtZRgCIAEoCRImCgtpbml0aWFsaXplchgF", "IAMoCzIRLm9ubnguVGVuc29yUHJvdG8SMwoSc3BhcnNlX2luaXRpYWxpemVy", "GA8gAygLMhcub25ueC5TcGFyc2VUZW5zb3JQcm90bxISCgpkb2Nfc3RyaW5n", @@ -70,56 +70,57 @@ static OnnxMlReflection() { "CgZvdXRwdXQYDCADKAsyFC5vbm54LlZhbHVlSW5mb1Byb3RvEigKCnZhbHVl", "X2luZm8YDSADKAsyFC5vbm54LlZhbHVlSW5mb1Byb3RvEjcKF3F1YW50aXph", "dGlvbl9hbm5vdGF0aW9uGA4gAygLMhYub25ueC5UZW5zb3JBbm5vdGF0aW9u", - "IrgFCgtUZW5zb3JQcm90bxIMCgRkaW1zGAEgAygDEhEKCWRhdGFfdHlwZRgC", - "IAEoBRIqCgdzZWdtZW50GAMgASgLMhkub25ueC5UZW5zb3JQcm90by5TZWdt", - "ZW50EhYKCmZsb2F0X2RhdGEYBCADKAJCAhABEhYKCmludDMyX2RhdGEYBSAD", - "KAVCAhABEhMKC3N0cmluZ19kYXRhGAYgAygMEhYKCmludDY0X2RhdGEYByAD", - "KANCAhABEgwKBG5hbWUYCCABKAkSEgoKZG9jX3N0cmluZxgMIAEoCRIQCghy", - "YXdfZGF0YRgJIAEoDBIzCg1leHRlcm5hbF9kYXRhGA0gAygLMhwub25ueC5T", - "dHJpbmdTdHJpbmdFbnRyeVByb3RvEjUKDWRhdGFfbG9jYXRpb24YDiABKA4y", - "Hi5vbm54LlRlbnNvclByb3RvLkRhdGFMb2NhdGlvbhIXCgtkb3VibGVfZGF0", - "YRgKIAMoAUICEAESFwoLdWludDY0X2RhdGEYCyADKARCAhABGiUKB1NlZ21l", - "bnQSDQoFYmVnaW4YASABKAMSCwoDZW5kGAIgASgDItoBCghEYXRhVHlwZRIN", - "CglVTkRFRklORUQQABIJCgVGTE9BVBABEgkKBVVJTlQ4EAISCAoESU5UOBAD", - "EgoKBlVJTlQxNhAEEgkKBUlOVDE2EAUSCQoFSU5UMzIQBhIJCgVJTlQ2NBAH", - "EgoKBlNUUklORxAIEggKBEJPT0wQCRILCgdGTE9BVDE2EAoSCgoGRE9VQkxF", - "EAsSCgoGVUlOVDMyEAwSCgoGVUlOVDY0EA0SDQoJQ09NUExFWDY0EA4SDgoK", - "Q09NUExFWDEyOBAPEgwKCEJGTE9BVDE2EBAiKQoMRGF0YUxvY2F0aW9uEgsK", - "B0RFRkFVTFQQABIMCghFWFRFUk5BTBABImgKEVNwYXJzZVRlbnNvclByb3Rv", - "EiEKBnZhbHVlcxgBIAEoCzIRLm9ubnguVGVuc29yUHJvdG8SIgoHaW5kaWNl", - "cxgCIAEoCzIRLm9ubnguVGVuc29yUHJvdG8SDAoEZGltcxgDIAMoAyKVAQoQ", - "VGVuc29yU2hhcGVQcm90bxItCgNkaW0YASADKAsyIC5vbm54LlRlbnNvclNo", - "YXBlUHJvdG8uRGltZW5zaW9uGlIKCURpbWVuc2lvbhITCglkaW1fdmFsdWUY", - "ASABKANIABITCglkaW1fcGFyYW0YAiABKAlIABISCgpkZW5vdGF0aW9uGAMg", - "ASgJQgcKBXZhbHVlIqUFCglUeXBlUHJvdG8SLQoLdGVuc29yX3R5cGUYASAB", - "KAsyFi5vbm54LlR5cGVQcm90by5UZW5zb3JIABIxCg1zZXF1ZW5jZV90eXBl", - "GAQgASgLMhgub25ueC5UeXBlUHJvdG8uU2VxdWVuY2VIABInCghtYXBfdHlw", - "ZRgFIAEoCzITLm9ubnguVHlwZVByb3RvLk1hcEgAEjEKDW9wdGlvbmFsX3R5", - "cGUYCSABKAsyGC5vbm54LlR5cGVQcm90by5PcHRpb25hbEgAEjoKEnNwYXJz", - "ZV90ZW5zb3JfdHlwZRgIIAEoCzIcLm9ubnguVHlwZVByb3RvLlNwYXJzZVRl", - "bnNvckgAEi0KC29wYXF1ZV90eXBlGAcgASgLMhYub25ueC5UeXBlUHJvdG8u", - "T3BhcXVlSAASEgoKZGVub3RhdGlvbhgGIAEoCRpCCgZUZW5zb3ISEQoJZWxl", - "bV90eXBlGAEgASgFEiUKBXNoYXBlGAIgASgLMhYub25ueC5UZW5zb3JTaGFw", - "ZVByb3RvGi4KCFNlcXVlbmNlEiIKCWVsZW1fdHlwZRgBIAEoCzIPLm9ubngu", - "VHlwZVByb3RvGjwKA01hcBIQCghrZXlfdHlwZRgBIAEoBRIjCgp2YWx1ZV90", - "eXBlGAIgASgLMg8ub25ueC5UeXBlUHJvdG8aLgoIT3B0aW9uYWwSIgoJZWxl", - "bV90eXBlGAEgASgLMg8ub25ueC5UeXBlUHJvdG8aSAoMU3BhcnNlVGVuc29y", - "EhEKCWVsZW1fdHlwZRgBIAEoBRIlCgVzaGFwZRgCIAEoCzIWLm9ubnguVGVu", - "c29yU2hhcGVQcm90bxomCgZPcGFxdWUSDgoGZG9tYWluGAEgASgJEgwKBG5h", - "bWUYAiABKAlCBwoFdmFsdWUiNQoST3BlcmF0b3JTZXRJZFByb3RvEg4KBmRv", - "bWFpbhgBIAEoCRIPCgd2ZXJzaW9uGAIgASgDIuUBCg1GdW5jdGlvblByb3Rv", - "EgwKBG5hbWUYASABKAkSDQoFaW5wdXQYBCADKAkSDgoGb3V0cHV0GAUgAygJ", - "EhEKCWF0dHJpYnV0ZRgGIAMoCRIdCgRub2RlGAcgAygLMg8ub25ueC5Ob2Rl", - "UHJvdG8SEgoKZG9jX3N0cmluZxgIIAEoCRIuCgxvcHNldF9pbXBvcnQYCSAD", - "KAsyGC5vbm54Lk9wZXJhdG9yU2V0SWRQcm90bxIOCgZkb21haW4YCiABKAlK", - "BAgCEANKBAgDEARSDXNpbmNlX3ZlcnNpb25SBnN0YXR1cyrkAQoHVmVyc2lv", - "bhISCg5fU1RBUlRfVkVSU0lPThAAEhkKFUlSX1ZFUlNJT05fMjAxN18xMF8x", - "MBABEhkKFUlSX1ZFUlNJT05fMjAxN18xMF8zMBACEhgKFElSX1ZFUlNJT05f", - "MjAxN18xMV8zEAMSGAoUSVJfVkVSU0lPTl8yMDE5XzFfMjIQBBIYChRJUl9W", - "RVJTSU9OXzIwMTlfM18xOBAFEhgKFElSX1ZFUlNJT05fMjAxOV85XzE5EAYS", - "FwoTSVJfVkVSU0lPTl8yMDIwXzVfOBAHEg4KCklSX1ZFUlNJT04QCCouCg5P", - "cGVyYXRvclN0YXR1cxIQCgxFWFBFUklNRU5UQUwQABIKCgZTVEFCTEUQAUIC", - "SANiBnByb3RvMw==")); + "SgQIAxAESgQIBBAFSgQIBhAKUgppcl92ZXJzaW9uUhBwcm9kdWNlcl92ZXJz", + "aW9uUgxwcm9kdWNlcl90YWdSBmRvbWFpbiK4BQoLVGVuc29yUHJvdG8SDAoE", + "ZGltcxgBIAMoAxIRCglkYXRhX3R5cGUYAiABKAUSKgoHc2VnbWVudBgDIAEo", + "CzIZLm9ubnguVGVuc29yUHJvdG8uU2VnbWVudBIWCgpmbG9hdF9kYXRhGAQg", + "AygCQgIQARIWCgppbnQzMl9kYXRhGAUgAygFQgIQARITCgtzdHJpbmdfZGF0", + "YRgGIAMoDBIWCgppbnQ2NF9kYXRhGAcgAygDQgIQARIMCgRuYW1lGAggASgJ", + "EhIKCmRvY19zdHJpbmcYDCABKAkSEAoIcmF3X2RhdGEYCSABKAwSMwoNZXh0", + "ZXJuYWxfZGF0YRgNIAMoCzIcLm9ubnguU3RyaW5nU3RyaW5nRW50cnlQcm90", + "bxI1Cg1kYXRhX2xvY2F0aW9uGA4gASgOMh4ub25ueC5UZW5zb3JQcm90by5E", + "YXRhTG9jYXRpb24SFwoLZG91YmxlX2RhdGEYCiADKAFCAhABEhcKC3VpbnQ2", + "NF9kYXRhGAsgAygEQgIQARolCgdTZWdtZW50Eg0KBWJlZ2luGAEgASgDEgsK", + "A2VuZBgCIAEoAyLaAQoIRGF0YVR5cGUSDQoJVU5ERUZJTkVEEAASCQoFRkxP", + "QVQQARIJCgVVSU5UOBACEggKBElOVDgQAxIKCgZVSU5UMTYQBBIJCgVJTlQx", + "NhAFEgkKBUlOVDMyEAYSCQoFSU5UNjQQBxIKCgZTVFJJTkcQCBIICgRCT09M", + "EAkSCwoHRkxPQVQxNhAKEgoKBkRPVUJMRRALEgoKBlVJTlQzMhAMEgoKBlVJ", + "TlQ2NBANEg0KCUNPTVBMRVg2NBAOEg4KCkNPTVBMRVgxMjgQDxIMCghCRkxP", + "QVQxNhAQIikKDERhdGFMb2NhdGlvbhILCgdERUZBVUxUEAASDAoIRVhURVJO", + "QUwQASJoChFTcGFyc2VUZW5zb3JQcm90bxIhCgZ2YWx1ZXMYASABKAsyES5v", + "bm54LlRlbnNvclByb3RvEiIKB2luZGljZXMYAiABKAsyES5vbm54LlRlbnNv", + "clByb3RvEgwKBGRpbXMYAyADKAMilQEKEFRlbnNvclNoYXBlUHJvdG8SLQoD", + "ZGltGAEgAygLMiAub25ueC5UZW5zb3JTaGFwZVByb3RvLkRpbWVuc2lvbhpS", + "CglEaW1lbnNpb24SEwoJZGltX3ZhbHVlGAEgASgDSAASEwoJZGltX3BhcmFt", + "GAIgASgJSAASEgoKZGVub3RhdGlvbhgDIAEoCUIHCgV2YWx1ZSKlBQoJVHlw", + "ZVByb3RvEi0KC3RlbnNvcl90eXBlGAEgASgLMhYub25ueC5UeXBlUHJvdG8u", + "VGVuc29ySAASMQoNc2VxdWVuY2VfdHlwZRgEIAEoCzIYLm9ubnguVHlwZVBy", + "b3RvLlNlcXVlbmNlSAASJwoIbWFwX3R5cGUYBSABKAsyEy5vbm54LlR5cGVQ", + "cm90by5NYXBIABIxCg1vcHRpb25hbF90eXBlGAkgASgLMhgub25ueC5UeXBl", + "UHJvdG8uT3B0aW9uYWxIABI6ChJzcGFyc2VfdGVuc29yX3R5cGUYCCABKAsy", + "HC5vbm54LlR5cGVQcm90by5TcGFyc2VUZW5zb3JIABItCgtvcGFxdWVfdHlw", + "ZRgHIAEoCzIWLm9ubnguVHlwZVByb3RvLk9wYXF1ZUgAEhIKCmRlbm90YXRp", + "b24YBiABKAkaQgoGVGVuc29yEhEKCWVsZW1fdHlwZRgBIAEoBRIlCgVzaGFw", + "ZRgCIAEoCzIWLm9ubnguVGVuc29yU2hhcGVQcm90bxouCghTZXF1ZW5jZRIi", + "CgllbGVtX3R5cGUYASABKAsyDy5vbm54LlR5cGVQcm90bxo8CgNNYXASEAoI", + "a2V5X3R5cGUYASABKAUSIwoKdmFsdWVfdHlwZRgCIAEoCzIPLm9ubnguVHlw", + "ZVByb3RvGi4KCE9wdGlvbmFsEiIKCWVsZW1fdHlwZRgBIAEoCzIPLm9ubngu", + "VHlwZVByb3RvGkgKDFNwYXJzZVRlbnNvchIRCgllbGVtX3R5cGUYASABKAUS", + "JQoFc2hhcGUYAiABKAsyFi5vbm54LlRlbnNvclNoYXBlUHJvdG8aJgoGT3Bh", + "cXVlEg4KBmRvbWFpbhgBIAEoCRIMCgRuYW1lGAIgASgJQgcKBXZhbHVlIjUK", + "Ek9wZXJhdG9yU2V0SWRQcm90bxIOCgZkb21haW4YASABKAkSDwoHdmVyc2lv", + "bhgCIAEoAyLlAQoNRnVuY3Rpb25Qcm90bxIMCgRuYW1lGAEgASgJEg0KBWlu", + "cHV0GAQgAygJEg4KBm91dHB1dBgFIAMoCRIRCglhdHRyaWJ1dGUYBiADKAkS", + "HQoEbm9kZRgHIAMoCzIPLm9ubnguTm9kZVByb3RvEhIKCmRvY19zdHJpbmcY", + "CCABKAkSLgoMb3BzZXRfaW1wb3J0GAkgAygLMhgub25ueC5PcGVyYXRvclNl", + "dElkUHJvdG8SDgoGZG9tYWluGAogASgJSgQIAhADSgQIAxAEUg1zaW5jZV92", + "ZXJzaW9uUgZzdGF0dXMq5AEKB1ZlcnNpb24SEgoOX1NUQVJUX1ZFUlNJT04Q", + "ABIZChVJUl9WRVJTSU9OXzIwMTdfMTBfMTAQARIZChVJUl9WRVJTSU9OXzIw", + "MTdfMTBfMzAQAhIYChRJUl9WRVJTSU9OXzIwMTdfMTFfMxADEhgKFElSX1ZF", + "UlNJT05fMjAxOV8xXzIyEAQSGAoUSVJfVkVSU0lPTl8yMDE5XzNfMTgQBRIY", + "ChRJUl9WRVJTSU9OXzIwMTlfOV8xORAGEhcKE0lSX1ZFUlNJT05fMjAyMF81", + "XzgQBxIOCgpJUl9WRVJTSU9OEAgqLgoOT3BlcmF0b3JTdGF0dXMSEAoMRVhQ", + "RVJJTUVOVEFMEAASCgoGU1RBQkxFEAFCAkgDYgZwcm90bzM=")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Onnx.Version), typeof(global::Onnx.OperatorStatus), }, null, new pbr::GeneratedClrTypeInfo[] { @@ -251,19 +252,23 @@ public sealed partial class AttributeProto : pb::IMessage private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new AttributeProto()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Onnx.OnnxMlReflection.Descriptor.MessageTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public AttributeProto() { OnConstruction(); } @@ -271,6 +276,7 @@ public AttributeProto() { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public AttributeProto(AttributeProto other) : this() { name_ = other.name_; refAttrName_ = other.refAttrName_; @@ -294,6 +300,7 @@ public AttributeProto(AttributeProto other) : this() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public AttributeProto Clone() { return new AttributeProto(this); } @@ -305,6 +312,7 @@ public AttributeProto Clone() { /// The name field MUST be present for this version of the IR. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Name { get { return name_; } set { @@ -322,6 +330,7 @@ public string Name { /// NOTE: This should ONLY be used in function (sub-graph). It's invalid to be used in main graph. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string RefAttrName { get { return refAttrName_; } set { @@ -336,6 +345,7 @@ public string RefAttrName { /// A human-readable documentation for this attribute. Markdown is allowed. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string DocString { get { return docString_; } set { @@ -355,6 +365,7 @@ public string DocString { /// change was made to accommodate proto3 implementations. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Onnx.AttributeProto.Types.AttributeType Type { get { return type_; } set { @@ -369,6 +380,7 @@ public string DocString { /// Exactly ONE of the following fields must be present for this version of the IR /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public float F { get { return f_; } set { @@ -383,6 +395,7 @@ public float F { /// int /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long I { get { return i_; } set { @@ -397,6 +410,7 @@ public long I { /// UTF-8 string /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pb::ByteString S { get { return s_; } set { @@ -411,6 +425,7 @@ public long I { /// tensor value /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Onnx.TensorProto T { get { return t_; } set { @@ -425,6 +440,7 @@ public long I { /// graph /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Onnx.GraphProto G { get { return g_; } set { @@ -439,6 +455,7 @@ public long I { /// sparse tensor value /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Onnx.SparseTensorProto SparseTensor { get { return sparseTensor_; } set { @@ -454,6 +471,7 @@ public long I { /// optional ValueProto v = 12; // value - subsumes everything but graph /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Onnx.TypeProto Tp { get { return tp_; } set { @@ -470,6 +488,7 @@ public long I { /// list of floats /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Floats { get { return floats_; } } @@ -483,6 +502,7 @@ public long I { /// list of ints /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Ints { get { return ints_; } } @@ -496,6 +516,7 @@ public long I { /// list of UTF-8 strings /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Strings { get { return strings_; } } @@ -509,6 +530,7 @@ public long I { /// list of tensors /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Tensors { get { return tensors_; } } @@ -522,6 +544,7 @@ public long I { /// list of graph /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Graphs { get { return graphs_; } } @@ -535,6 +558,7 @@ public long I { /// list of sparse tensors /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField SparseTensors { get { return sparseTensors_; } } @@ -548,16 +572,19 @@ public long I { /// list of type protos /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField TypeProtos { get { return typeProtos_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as AttributeProto); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(AttributeProto other) { if (ReferenceEquals(other, null)) { return false; @@ -587,6 +614,7 @@ public bool Equals(AttributeProto other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Name.Length != 0) hash ^= Name.GetHashCode(); @@ -614,11 +642,13 @@ public override int GetHashCode() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -682,6 +712,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (Name.Length != 0) { output.WriteRawTag(10); @@ -741,6 +772,7 @@ public void WriteTo(pb::CodedOutputStream output) { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Name.Length != 0) { @@ -790,6 +822,7 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(AttributeProto other) { if (other == null) { return; @@ -850,6 +883,7 @@ public void MergeFrom(AttributeProto other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -953,6 +987,7 @@ public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -1054,6 +1089,7 @@ public void MergeFrom(pb::CodedInputStream input) { #region Nested types /// Container for nested types declared in the AttributeProto message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { /// /// Note: this enum is structurally identical to the OpSchema::AttrType @@ -1094,19 +1130,23 @@ public sealed partial class ValueInfoProto : pb::IMessage private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ValueInfoProto()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Onnx.OnnxMlReflection.Descriptor.MessageTypes[1]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ValueInfoProto() { OnConstruction(); } @@ -1114,6 +1154,7 @@ public ValueInfoProto() { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ValueInfoProto(ValueInfoProto other) : this() { name_ = other.name_; type_ = other.type_ != null ? other.type_.Clone() : null; @@ -1122,6 +1163,7 @@ public ValueInfoProto(ValueInfoProto other) : this() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ValueInfoProto Clone() { return new ValueInfoProto(this); } @@ -1133,6 +1175,7 @@ public ValueInfoProto Clone() { /// This field MUST be present in this version of the IR. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Name { get { return name_; } set { @@ -1148,6 +1191,7 @@ public string Name { /// inputs and outputs of the top-level graph. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Onnx.TypeProto Type { get { return type_; } set { @@ -1162,6 +1206,7 @@ public string Name { /// A human-readable documentation for this value. Markdown is allowed. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string DocString { get { return docString_; } set { @@ -1170,11 +1215,13 @@ public string DocString { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as ValueInfoProto); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(ValueInfoProto other) { if (ReferenceEquals(other, null)) { return false; @@ -1189,6 +1236,7 @@ public bool Equals(ValueInfoProto other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Name.Length != 0) hash ^= Name.GetHashCode(); @@ -1201,11 +1249,13 @@ public override int GetHashCode() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -1230,6 +1280,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (Name.Length != 0) { output.WriteRawTag(10); @@ -1250,6 +1301,7 @@ public void WriteTo(pb::CodedOutputStream output) { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Name.Length != 0) { @@ -1268,6 +1320,7 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(ValueInfoProto other) { if (other == null) { return; @@ -1288,6 +1341,7 @@ public void MergeFrom(ValueInfoProto other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -1320,6 +1374,7 @@ public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -1366,19 +1421,23 @@ public sealed partial class NodeProto : pb::IMessage private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NodeProto()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Onnx.OnnxMlReflection.Descriptor.MessageTypes[2]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NodeProto() { OnConstruction(); } @@ -1386,6 +1445,7 @@ public NodeProto() { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NodeProto(NodeProto other) : this() { input_ = other.input_.Clone(); output_ = other.output_.Clone(); @@ -1398,6 +1458,7 @@ public NodeProto(NodeProto other) : this() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public NodeProto Clone() { return new NodeProto(this); } @@ -1411,6 +1472,7 @@ public NodeProto Clone() { /// namespace Value /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Input { get { return input_; } } @@ -1424,6 +1486,7 @@ public NodeProto Clone() { /// namespace Value /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Output { get { return output_; } } @@ -1436,6 +1499,7 @@ public NodeProto Clone() { /// This field MAY be absent in ths version of the IR. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Name { get { return name_; } set { @@ -1450,6 +1514,7 @@ public string Name { /// The symbolic identifier of the Operator to execute. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string OpType { get { return opType_; } set { @@ -1464,6 +1529,7 @@ public string OpType { /// The domain of the OperatorSet that specifies the operator named by op_type. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Domain { get { return domain_; } set { @@ -1480,6 +1546,7 @@ public string Domain { /// Additional named attributes. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Attribute { get { return attribute_; } } @@ -1491,6 +1558,7 @@ public string Domain { /// A human-readable documentation for this node. Markdown is allowed. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string DocString { get { return docString_; } set { @@ -1499,11 +1567,13 @@ public string DocString { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as NodeProto); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(NodeProto other) { if (ReferenceEquals(other, null)) { return false; @@ -1522,6 +1592,7 @@ public bool Equals(NodeProto other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; hash ^= input_.GetHashCode(); @@ -1538,11 +1609,13 @@ public override int GetHashCode() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -1574,6 +1647,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { input_.WriteTo(ref output, _repeated_input_codec); output_.WriteTo(ref output, _repeated_output_codec); @@ -1601,6 +1675,7 @@ public void WriteTo(pb::CodedOutputStream output) { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; size += input_.CalculateSize(_repeated_input_codec); @@ -1625,6 +1700,7 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(NodeProto other) { if (other == null) { return; @@ -1648,6 +1724,7 @@ public void MergeFrom(NodeProto other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -1693,6 +1770,7 @@ public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -1764,19 +1842,23 @@ public sealed partial class TrainingInfoProto : pb::IMessage private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TrainingInfoProto()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Onnx.OnnxMlReflection.Descriptor.MessageTypes[3]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TrainingInfoProto() { OnConstruction(); } @@ -1784,6 +1866,7 @@ public TrainingInfoProto() { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TrainingInfoProto(TrainingInfoProto other) : this() { initialization_ = other.initialization_ != null ? other.initialization_.Clone() : null; algorithm_ = other.algorithm_ != null ? other.algorithm_.Clone() : null; @@ -1793,6 +1876,7 @@ public TrainingInfoProto(TrainingInfoProto other) : this() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TrainingInfoProto Clone() { return new TrainingInfoProto(this); } @@ -1816,6 +1900,7 @@ public TrainingInfoProto Clone() { /// produce any output. Thus, no initializer would be changed by default. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Onnx.GraphProto Initialization { get { return initialization_; } set { @@ -1858,6 +1943,7 @@ public TrainingInfoProto Clone() { /// update any initializers. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Onnx.GraphProto Algorithm { get { return algorithm_; } set { @@ -1880,6 +1966,7 @@ public TrainingInfoProto Clone() { /// by the execution of "initialization". /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField InitializationBinding { get { return initializationBinding_; } } @@ -1932,16 +2019,19 @@ public TrainingInfoProto Clone() { /// by the execution of "algorithm". /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField UpdateBinding { get { return updateBinding_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TrainingInfoProto); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TrainingInfoProto other) { if (ReferenceEquals(other, null)) { return false; @@ -1957,6 +2047,7 @@ public bool Equals(TrainingInfoProto other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (initialization_ != null) hash ^= Initialization.GetHashCode(); @@ -1970,11 +2061,13 @@ public override int GetHashCode() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -1997,6 +2090,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (initialization_ != null) { output.WriteRawTag(10); @@ -2015,6 +2109,7 @@ public void WriteTo(pb::CodedOutputStream output) { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (initialization_ != null) { @@ -2032,6 +2127,7 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TrainingInfoProto other) { if (other == null) { return; @@ -2054,6 +2150,7 @@ public void MergeFrom(TrainingInfoProto other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -2093,6 +2190,7 @@ public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -2145,19 +2243,23 @@ public sealed partial class ModelProto : pb::IMessage private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ModelProto()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Onnx.OnnxMlReflection.Descriptor.MessageTypes[4]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ModelProto() { OnConstruction(); } @@ -2165,6 +2267,7 @@ public ModelProto() { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ModelProto(ModelProto other) : this() { irVersion_ = other.irVersion_; opsetImport_ = other.opsetImport_.Clone(); @@ -2181,6 +2284,7 @@ public ModelProto(ModelProto other) : this() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ModelProto Clone() { return new ModelProto(this); } @@ -2193,6 +2297,7 @@ public ModelProto Clone() { /// This field MUST be present. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long IrVersion { get { return irVersion_; } set { @@ -2216,6 +2321,7 @@ public long IrVersion { /// in the referenced operator sets. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField OpsetImport { get { return opsetImport_; } } @@ -2229,6 +2335,7 @@ public long IrVersion { /// emitted the model. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string ProducerName { get { return producerName_; } set { @@ -2245,6 +2352,7 @@ public string ProducerName { /// emitted the model. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string ProducerVersion { get { return producerVersion_; } set { @@ -2264,6 +2372,7 @@ public string ProducerVersion { /// the graph. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Domain { get { return domain_; } set { @@ -2278,6 +2387,7 @@ public string Domain { /// The version of the graph encoded. See Version enum below. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long ModelVersion { get { return modelVersion_; } set { @@ -2292,6 +2402,7 @@ public long ModelVersion { /// A human-readable documentation for this model. Markdown is allowed. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string DocString { get { return docString_; } set { @@ -2306,6 +2417,7 @@ public string DocString { /// The parameterized graph that is evaluated to execute the model. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Onnx.GraphProto Graph { get { return graph_; } set { @@ -2322,6 +2434,7 @@ public string DocString { /// Named metadata values; keys should be distinct. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField MetadataProps { get { return metadataProps_; } } @@ -2343,6 +2456,7 @@ public string DocString { /// If this field is empty, the training behavior of the model is undefined. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField TrainingInfo { get { return trainingInfo_; } } @@ -2357,13 +2471,13 @@ public string DocString { /// /// Name of the function "FunctionProto.name" should be unique within the domain "FunctionProto.domain". /// In case of any conflicts the behavior (whether the model local functions are given higher priority, - /// or standard opserator sets are given higher priotity or this is treated as error) is defined by + /// or standard opserator sets are given higher priotity or this is treated as error) is defined by /// the runtimes. - /// + /// /// The operator sets imported by FunctionProto should be compatible with the ones - /// imported by ModelProto and other model local FunctionProtos. - /// Example, if same operator set say 'A' is imported by a FunctionProto and ModelProto - /// or by 2 FunctionProtos then versions for the operator set may be different but, + /// imported by ModelProto and other model local FunctionProtos. + /// Example, if same operator set say 'A' is imported by a FunctionProto and ModelProto + /// or by 2 FunctionProtos then versions for the operator set may be different but, /// the operator schema returned for op_type, domain, version combination /// for both the versions should be same for every node in the function body. /// @@ -2371,16 +2485,19 @@ public string DocString { /// is not allowed. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Functions { get { return functions_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as ModelProto); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(ModelProto other) { if (ReferenceEquals(other, null)) { return false; @@ -2403,6 +2520,7 @@ public bool Equals(ModelProto other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (IrVersion != 0L) hash ^= IrVersion.GetHashCode(); @@ -2423,11 +2541,13 @@ public override int GetHashCode() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -2472,6 +2592,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (IrVersion != 0L) { output.WriteRawTag(8); @@ -2512,6 +2633,7 @@ public void WriteTo(pb::CodedOutputStream output) { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (IrVersion != 0L) { @@ -2546,6 +2668,7 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(ModelProto other) { if (other == null) { return; @@ -2582,6 +2705,7 @@ public void MergeFrom(ModelProto other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -2646,6 +2770,7 @@ public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -2719,19 +2844,23 @@ public sealed partial class StringStringEntryProto : pb::IMessage _parser = new pb::MessageParser(() => new StringStringEntryProto()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Onnx.OnnxMlReflection.Descriptor.MessageTypes[5]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public StringStringEntryProto() { OnConstruction(); } @@ -2739,6 +2868,7 @@ public StringStringEntryProto() { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public StringStringEntryProto(StringStringEntryProto other) : this() { key_ = other.key_; value_ = other.value_; @@ -2746,6 +2876,7 @@ public StringStringEntryProto(StringStringEntryProto other) : this() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public StringStringEntryProto Clone() { return new StringStringEntryProto(this); } @@ -2754,6 +2885,7 @@ public StringStringEntryProto Clone() { public const int KeyFieldNumber = 1; private string key_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Key { get { return key_; } set { @@ -2765,6 +2897,7 @@ public string Key { public const int ValueFieldNumber = 2; private string value_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Value { get { return value_; } set { @@ -2773,11 +2906,13 @@ public string Value { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as StringStringEntryProto); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(StringStringEntryProto other) { if (ReferenceEquals(other, null)) { return false; @@ -2791,6 +2926,7 @@ public bool Equals(StringStringEntryProto other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Key.Length != 0) hash ^= Key.GetHashCode(); @@ -2802,11 +2938,13 @@ public override int GetHashCode() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -2827,6 +2965,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (Key.Length != 0) { output.WriteRawTag(10); @@ -2843,6 +2982,7 @@ public void WriteTo(pb::CodedOutputStream output) { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Key.Length != 0) { @@ -2858,6 +2998,7 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(StringStringEntryProto other) { if (other == null) { return; @@ -2872,6 +3013,7 @@ public void MergeFrom(StringStringEntryProto other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -2897,6 +3039,7 @@ public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -2927,19 +3070,23 @@ public sealed partial class TensorAnnotation : pb::IMessage private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TensorAnnotation()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Onnx.OnnxMlReflection.Descriptor.MessageTypes[6]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TensorAnnotation() { OnConstruction(); } @@ -2947,6 +3094,7 @@ public TensorAnnotation() { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TensorAnnotation(TensorAnnotation other) : this() { tensorName_ = other.tensorName_; quantParameterTensorNames_ = other.quantParameterTensorNames_.Clone(); @@ -2954,6 +3102,7 @@ public TensorAnnotation(TensorAnnotation other) : this() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TensorAnnotation Clone() { return new TensorAnnotation(this); } @@ -2962,6 +3111,7 @@ public TensorAnnotation Clone() { public const int TensorNameFieldNumber = 1; private string tensorName_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string TensorName { get { return tensorName_; } set { @@ -2981,16 +3131,19 @@ public string TensorName { /// quantization parameter keys. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField QuantParameterTensorNames { get { return quantParameterTensorNames_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TensorAnnotation); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TensorAnnotation other) { if (ReferenceEquals(other, null)) { return false; @@ -3004,6 +3157,7 @@ public bool Equals(TensorAnnotation other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (TensorName.Length != 0) hash ^= TensorName.GetHashCode(); @@ -3015,11 +3169,13 @@ public override int GetHashCode() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -3037,6 +3193,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (TensorName.Length != 0) { output.WriteRawTag(10); @@ -3050,6 +3207,7 @@ public void WriteTo(pb::CodedOutputStream output) { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (TensorName.Length != 0) { @@ -3063,6 +3221,7 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TensorAnnotation other) { if (other == null) { return; @@ -3075,6 +3234,7 @@ public void MergeFrom(TensorAnnotation other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -3100,6 +3260,7 @@ public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -3138,19 +3299,23 @@ public sealed partial class GraphProto : pb::IMessage private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GraphProto()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Onnx.OnnxMlReflection.Descriptor.MessageTypes[7]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public GraphProto() { OnConstruction(); } @@ -3158,6 +3323,7 @@ public GraphProto() { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public GraphProto(GraphProto other) : this() { node_ = other.node_.Clone(); name_ = other.name_; @@ -3172,6 +3338,7 @@ public GraphProto(GraphProto other) : this() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public GraphProto Clone() { return new GraphProto(this); } @@ -3185,6 +3352,7 @@ public GraphProto Clone() { /// The nodes in the graph, sorted topologically. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Node { get { return node_; } } @@ -3196,6 +3364,7 @@ public GraphProto Clone() { /// The name of the graph. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Name { get { return name_; } set { @@ -3215,6 +3384,7 @@ public string Name { /// but the name MAY also appear in the input list. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Initializer { get { return initializer_; } } @@ -3228,6 +3398,7 @@ public string Name { /// Initializers (see above) stored in sparse format. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField SparseInitializer { get { return sparseInitializer_; } } @@ -3239,6 +3410,7 @@ public string Name { /// A human-readable documentation for this graph. Markdown is allowed. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string DocString { get { return docString_; } set { @@ -3255,6 +3427,7 @@ public string DocString { /// The inputs and outputs of the graph. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Input { get { return input_; } } @@ -3265,6 +3438,7 @@ public string DocString { = pb::FieldCodec.ForMessage(98, global::Onnx.ValueInfoProto.Parser); private readonly pbc::RepeatedField output_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Output { get { return output_; } } @@ -3279,6 +3453,7 @@ public string DocString { /// must be distinct. It is optional for a value to appear in value_info list. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField ValueInfo { get { return valueInfo_; } } @@ -3295,16 +3470,19 @@ public string DocString { /// which means, tensor 'a_scale' and tensor 'a_zero_point' are scale and zero point of tensor 'a' in the model. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField QuantizationAnnotation { get { return quantizationAnnotation_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as GraphProto); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(GraphProto other) { if (ReferenceEquals(other, null)) { return false; @@ -3325,6 +3503,7 @@ public bool Equals(GraphProto other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; hash ^= node_.GetHashCode(); @@ -3343,11 +3522,13 @@ public override int GetHashCode() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -3375,6 +3556,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { node_.WriteTo(ref output, _repeated_node_codec); if (Name.Length != 0) { @@ -3398,6 +3580,7 @@ public void WriteTo(pb::CodedOutputStream output) { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; size += node_.CalculateSize(_repeated_node_codec); @@ -3420,6 +3603,7 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(GraphProto other) { if (other == null) { return; @@ -3441,6 +3625,7 @@ public void MergeFrom(GraphProto other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -3494,6 +3679,7 @@ public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -3557,19 +3743,23 @@ public sealed partial class TensorProto : pb::IMessage private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TensorProto()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Onnx.OnnxMlReflection.Descriptor.MessageTypes[8]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TensorProto() { OnConstruction(); } @@ -3577,6 +3767,7 @@ public TensorProto() { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TensorProto(TensorProto other) : this() { dims_ = other.dims_.Clone(); dataType_ = other.dataType_; @@ -3596,6 +3787,7 @@ public TensorProto(TensorProto other) : this() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TensorProto Clone() { return new TensorProto(this); } @@ -3609,6 +3801,7 @@ public TensorProto Clone() { /// The shape of the tensor. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Dims { get { return dims_; } } @@ -3621,6 +3814,7 @@ public TensorProto Clone() { /// This field MUST have a valid TensorProto.DataType value /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int DataType { get { return dataType_; } set { @@ -3632,6 +3826,7 @@ public int DataType { public const int SegmentFieldNumber = 3; private global::Onnx.TensorProto.Types.Segment segment_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Onnx.TensorProto.Types.Segment Segment { get { return segment_; } set { @@ -3654,6 +3849,7 @@ public int DataType { /// When this field is present, the data_type field MUST be FLOAT or COMPLEX64. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField FloatData { get { return floatData_; } } @@ -3671,6 +3867,7 @@ public int DataType { /// INT32, INT16, INT8, UINT16, UINT8, BOOL, or FLOAT16 /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Int32Data { get { return int32Data_; } } @@ -3688,6 +3885,7 @@ public int DataType { /// When this field is present, the data_type field MUST be STRING /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField StringData { get { return stringData_; } } @@ -3702,6 +3900,7 @@ public int DataType { /// When this field is present, the data_type field MUST be INT64 /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Int64Data { get { return int64Data_; } } @@ -3713,6 +3912,7 @@ public int DataType { /// Optionally, a name for the tensor. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Name { get { return name_; } set { @@ -3727,6 +3927,7 @@ public string Name { /// A human-readable documentation for this tensor. Markdown is allowed. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string DocString { get { return docString_; } set { @@ -3755,6 +3956,7 @@ public string DocString { /// When this field is present, the data_type field MUST NOT be STRING or UNDEFINED /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pb::ByteString RawData { get { return rawData_; } set { @@ -3779,6 +3981,7 @@ public string DocString { /// - "checksum" (optional) - SHA1 digest of file specified in under 'location' key. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField ExternalData { get { return externalData_; } } @@ -3790,6 +3993,7 @@ public string DocString { /// If value not set, data is stored in raw_data (if set) otherwise in type-specified field. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Onnx.TensorProto.Types.DataLocation DataLocation { get { return dataLocation_; } set { @@ -3812,6 +4016,7 @@ public string DocString { /// When this field is present, the data_type field MUST be DOUBLE or COMPLEX128 /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField DoubleData { get { return doubleData_; } } @@ -3827,16 +4032,19 @@ public string DocString { /// UINT32 or UINT64 /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Uint64Data { get { return uint64Data_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TensorProto); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TensorProto other) { if (ReferenceEquals(other, null)) { return false; @@ -3862,6 +4070,7 @@ public bool Equals(TensorProto other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; hash ^= dims_.GetHashCode(); @@ -3885,11 +4094,13 @@ public override int GetHashCode() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -3934,6 +4145,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { dims_.WriteTo(ref output, _repeated_dims_codec); if (DataType != 0) { @@ -3974,6 +4186,7 @@ public void WriteTo(pb::CodedOutputStream output) { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; size += dims_.CalculateSize(_repeated_dims_codec); @@ -4009,6 +4222,7 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TensorProto other) { if (other == null) { return; @@ -4046,6 +4260,7 @@ public void MergeFrom(TensorProto other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -4128,6 +4343,7 @@ public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -4208,6 +4424,7 @@ public void MergeFrom(pb::CodedInputStream input) { #region Nested types /// Container for nested types declared in the TensorProto message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { public enum DataType { [pbr::OriginalName("UNDEFINED")] Undefined = 0, @@ -4294,19 +4511,23 @@ public sealed partial class Segment : pb::IMessage private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Segment()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Onnx.TensorProto.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Segment() { OnConstruction(); } @@ -4314,6 +4535,7 @@ public Segment() { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Segment(Segment other) : this() { begin_ = other.begin_; end_ = other.end_; @@ -4321,6 +4543,7 @@ public Segment(Segment other) : this() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Segment Clone() { return new Segment(this); } @@ -4329,6 +4552,7 @@ public Segment Clone() { public const int BeginFieldNumber = 1; private long begin_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long Begin { get { return begin_; } set { @@ -4340,6 +4564,7 @@ public long Begin { public const int EndFieldNumber = 2; private long end_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long End { get { return end_; } set { @@ -4348,11 +4573,13 @@ public long End { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Segment); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Segment other) { if (ReferenceEquals(other, null)) { return false; @@ -4366,6 +4593,7 @@ public bool Equals(Segment other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Begin != 0L) hash ^= Begin.GetHashCode(); @@ -4377,11 +4605,13 @@ public override int GetHashCode() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -4402,6 +4632,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (Begin != 0L) { output.WriteRawTag(8); @@ -4418,6 +4649,7 @@ public void WriteTo(pb::CodedOutputStream output) { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Begin != 0L) { @@ -4433,6 +4665,7 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Segment other) { if (other == null) { return; @@ -4447,6 +4680,7 @@ public void MergeFrom(Segment other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -4472,6 +4706,7 @@ public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -4510,19 +4745,23 @@ public sealed partial class SparseTensorProto : pb::IMessage private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SparseTensorProto()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Onnx.OnnxMlReflection.Descriptor.MessageTypes[9]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SparseTensorProto() { OnConstruction(); } @@ -4530,6 +4769,7 @@ public SparseTensorProto() { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SparseTensorProto(SparseTensorProto other) : this() { values_ = other.values_ != null ? other.values_.Clone() : null; indices_ = other.indices_ != null ? other.indices_.Clone() : null; @@ -4538,6 +4778,7 @@ public SparseTensorProto(SparseTensorProto other) : this() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SparseTensorProto Clone() { return new SparseTensorProto(this); } @@ -4552,6 +4793,7 @@ public SparseTensorProto Clone() { /// when used in sparse_initializer list. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Onnx.TensorProto Values { get { return values_; } set { @@ -4575,6 +4817,7 @@ public SparseTensorProto Clone() { /// e.g., index-value [1,4] must appear before [2,1] /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Onnx.TensorProto Indices { get { return indices_; } set { @@ -4591,16 +4834,19 @@ public SparseTensorProto Clone() { /// The shape of the underlying dense-tensor: [dim_1, dim_2, ... dim_rank] /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Dims { get { return dims_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as SparseTensorProto); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(SparseTensorProto other) { if (ReferenceEquals(other, null)) { return false; @@ -4615,6 +4861,7 @@ public bool Equals(SparseTensorProto other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (values_ != null) hash ^= Values.GetHashCode(); @@ -4627,11 +4874,13 @@ public override int GetHashCode() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -4653,6 +4902,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (values_ != null) { output.WriteRawTag(10); @@ -4670,6 +4920,7 @@ public void WriteTo(pb::CodedOutputStream output) { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (values_ != null) { @@ -4686,6 +4937,7 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(SparseTensorProto other) { if (other == null) { return; @@ -4707,6 +4959,7 @@ public void MergeFrom(SparseTensorProto other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -4743,6 +4996,7 @@ public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -4789,19 +5043,23 @@ public sealed partial class TensorShapeProto : pb::IMessage private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TensorShapeProto()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Onnx.OnnxMlReflection.Descriptor.MessageTypes[10]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TensorShapeProto() { OnConstruction(); } @@ -4809,12 +5067,14 @@ public TensorShapeProto() { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TensorShapeProto(TensorShapeProto other) : this() { dim_ = other.dim_.Clone(); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TensorShapeProto Clone() { return new TensorShapeProto(this); } @@ -4825,16 +5085,19 @@ public TensorShapeProto Clone() { = pb::FieldCodec.ForMessage(10, global::Onnx.TensorShapeProto.Types.Dimension.Parser); private readonly pbc::RepeatedField dim_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Dim { get { return dim_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TensorShapeProto); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TensorShapeProto other) { if (ReferenceEquals(other, null)) { return false; @@ -4847,6 +5110,7 @@ public bool Equals(TensorShapeProto other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; hash ^= dim_.GetHashCode(); @@ -4857,11 +5121,13 @@ public override int GetHashCode() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -4875,6 +5141,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { dim_.WriteTo(ref output, _repeated_dim_codec); if (_unknownFields != null) { @@ -4884,6 +5151,7 @@ public void WriteTo(pb::CodedOutputStream output) { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; size += dim_.CalculateSize(_repeated_dim_codec); @@ -4894,6 +5162,7 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TensorShapeProto other) { if (other == null) { return; @@ -4903,6 +5172,7 @@ public void MergeFrom(TensorShapeProto other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -4924,6 +5194,7 @@ public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -4943,6 +5214,7 @@ public void MergeFrom(pb::CodedInputStream input) { #region Nested types /// Container for nested types declared in the TensorShapeProto message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { public sealed partial class Dimension : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE @@ -4952,19 +5224,23 @@ public sealed partial class Dimension : pb::IMessage private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Dimension()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Onnx.TensorShapeProto.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Dimension() { OnConstruction(); } @@ -4972,6 +5248,7 @@ public Dimension() { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Dimension(Dimension other) : this() { denotation_ = other.denotation_; switch (other.ValueCase) { @@ -4987,6 +5264,7 @@ public Dimension(Dimension other) : this() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Dimension Clone() { return new Dimension(this); } @@ -4994,6 +5272,7 @@ public Dimension Clone() { /// Field number for the "dim_value" field. public const int DimValueFieldNumber = 1; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long DimValue { get { return valueCase_ == ValueOneofCase.DimValue ? (long) value_ : 0L; } set { @@ -5008,6 +5287,7 @@ public long DimValue { /// namespace Shape /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string DimParam { get { return valueCase_ == ValueOneofCase.DimParam ? (string) value_ : ""; } set { @@ -5023,10 +5303,11 @@ public string DimParam { /// Standard denotation can optionally be used to denote tensor /// dimensions with standard semantic descriptions to ensure /// that operations are applied to the correct axis of a tensor. - /// Refer to https://github.com/onnx/onnx/blob/master/docs/DimensionDenotation.md#denotation-definition + /// Refer to https://github.com/onnx/onnx/blob/main/docs/DimensionDenotation.md#denotation-definition /// for pre-defined dimension denotations. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Denotation { get { return denotation_; } set { @@ -5043,22 +5324,26 @@ public enum ValueOneofCase { } private ValueOneofCase valueCase_ = ValueOneofCase.None; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ValueOneofCase ValueCase { get { return valueCase_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearValue() { valueCase_ = ValueOneofCase.None; value_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Dimension); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Dimension other) { if (ReferenceEquals(other, null)) { return false; @@ -5074,6 +5359,7 @@ public bool Equals(Dimension other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (valueCase_ == ValueOneofCase.DimValue) hash ^= DimValue.GetHashCode(); @@ -5087,11 +5373,13 @@ public override int GetHashCode() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -5116,6 +5404,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (valueCase_ == ValueOneofCase.DimValue) { output.WriteRawTag(8); @@ -5136,6 +5425,7 @@ public void WriteTo(pb::CodedOutputStream output) { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (valueCase_ == ValueOneofCase.DimValue) { @@ -5154,6 +5444,7 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Dimension other) { if (other == null) { return; @@ -5174,6 +5465,7 @@ public void MergeFrom(Dimension other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -5203,6 +5495,7 @@ public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -5247,19 +5540,23 @@ public sealed partial class TypeProto : pb::IMessage private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TypeProto()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Onnx.OnnxMlReflection.Descriptor.MessageTypes[11]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TypeProto() { OnConstruction(); } @@ -5267,6 +5564,7 @@ public TypeProto() { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TypeProto(TypeProto other) : this() { denotation_ = other.denotation_; switch (other.ValueCase) { @@ -5294,6 +5592,7 @@ public TypeProto(TypeProto other) : this() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public TypeProto Clone() { return new TypeProto(this); } @@ -5304,6 +5603,7 @@ public TypeProto Clone() { /// The type of a tensor. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Onnx.TypeProto.Types.Tensor TensorType { get { return valueCase_ == ValueOneofCase.TensorType ? (global::Onnx.TypeProto.Types.Tensor) value_ : null; } set { @@ -5318,6 +5618,7 @@ public TypeProto Clone() { /// The type of a sequence. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Onnx.TypeProto.Types.Sequence SequenceType { get { return valueCase_ == ValueOneofCase.SequenceType ? (global::Onnx.TypeProto.Types.Sequence) value_ : null; } set { @@ -5332,6 +5633,7 @@ public TypeProto Clone() { /// The type of a map. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Onnx.TypeProto.Types.Map MapType { get { return valueCase_ == ValueOneofCase.MapType ? (global::Onnx.TypeProto.Types.Map) value_ : null; } set { @@ -5346,6 +5648,7 @@ public TypeProto Clone() { /// The type of an optional. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Onnx.TypeProto.Types.Optional OptionalType { get { return valueCase_ == ValueOneofCase.OptionalType ? (global::Onnx.TypeProto.Types.Optional) value_ : null; } set { @@ -5360,6 +5663,7 @@ public TypeProto Clone() { /// Type of the sparse tensor /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Onnx.TypeProto.Types.SparseTensor SparseTensorType { get { return valueCase_ == ValueOneofCase.SparseTensorType ? (global::Onnx.TypeProto.Types.SparseTensor) value_ : null; } set { @@ -5371,6 +5675,7 @@ public TypeProto Clone() { /// Field number for the "opaque_type" field. public const int OpaqueTypeFieldNumber = 7; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Onnx.TypeProto.Types.Opaque OpaqueType { get { return valueCase_ == ValueOneofCase.OpaqueType ? (global::Onnx.TypeProto.Types.Opaque) value_ : null; } set { @@ -5385,10 +5690,11 @@ public TypeProto Clone() { /// /// An optional denotation can be used to denote the whole /// type with a standard semantic description as to what is - /// stored inside. Refer to https://github.com/onnx/onnx/blob/master/docs/TypeDenotation.md#type-denotation-definition + /// stored inside. Refer to https://github.com/onnx/onnx/blob/main/docs/TypeDenotation.md#type-denotation-definition /// for pre-defined type denotations. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Denotation { get { return denotation_; } set { @@ -5409,22 +5715,26 @@ public enum ValueOneofCase { } private ValueOneofCase valueCase_ = ValueOneofCase.None; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public ValueOneofCase ValueCase { get { return valueCase_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void ClearValue() { valueCase_ = ValueOneofCase.None; value_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as TypeProto); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(TypeProto other) { if (ReferenceEquals(other, null)) { return false; @@ -5444,6 +5754,7 @@ public bool Equals(TypeProto other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (valueCase_ == ValueOneofCase.TensorType) hash ^= TensorType.GetHashCode(); @@ -5461,11 +5772,13 @@ public override int GetHashCode() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -5506,6 +5819,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (valueCase_ == ValueOneofCase.TensorType) { output.WriteRawTag(10); @@ -5542,6 +5856,7 @@ public void WriteTo(pb::CodedOutputStream output) { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (valueCase_ == ValueOneofCase.TensorType) { @@ -5572,6 +5887,7 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(TypeProto other) { if (other == null) { return; @@ -5622,6 +5938,7 @@ public void MergeFrom(TypeProto other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -5697,6 +6014,7 @@ public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -5770,6 +6088,7 @@ public void MergeFrom(pb::CodedInputStream input) { #region Nested types /// Container for nested types declared in the TypeProto message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static partial class Types { public sealed partial class Tensor : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE @@ -5779,19 +6098,23 @@ public sealed partial class Tensor : pb::IMessage private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Tensor()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Onnx.TypeProto.Descriptor.NestedTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Tensor() { OnConstruction(); } @@ -5799,6 +6122,7 @@ public Tensor() { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Tensor(Tensor other) : this() { elemType_ = other.elemType_; shape_ = other.shape_ != null ? other.shape_.Clone() : null; @@ -5806,6 +6130,7 @@ public Tensor(Tensor other) : this() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Tensor Clone() { return new Tensor(this); } @@ -5819,6 +6144,7 @@ public Tensor Clone() { /// This field MUST be present for this version of the IR. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int ElemType { get { return elemType_; } set { @@ -5830,6 +6156,7 @@ public int ElemType { public const int ShapeFieldNumber = 2; private global::Onnx.TensorShapeProto shape_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Onnx.TensorShapeProto Shape { get { return shape_; } set { @@ -5838,11 +6165,13 @@ public int ElemType { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Tensor); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Tensor other) { if (ReferenceEquals(other, null)) { return false; @@ -5856,6 +6185,7 @@ public bool Equals(Tensor other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (ElemType != 0) hash ^= ElemType.GetHashCode(); @@ -5867,11 +6197,13 @@ public override int GetHashCode() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -5892,6 +6224,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (ElemType != 0) { output.WriteRawTag(8); @@ -5908,6 +6241,7 @@ public void WriteTo(pb::CodedOutputStream output) { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (ElemType != 0) { @@ -5923,6 +6257,7 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Tensor other) { if (other == null) { return; @@ -5940,6 +6275,7 @@ public void MergeFrom(Tensor other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -5968,6 +6304,7 @@ public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -6004,19 +6341,23 @@ public sealed partial class Sequence : pb::IMessage private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Sequence()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Onnx.TypeProto.Descriptor.NestedTypes[1]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Sequence() { OnConstruction(); } @@ -6024,12 +6365,14 @@ public Sequence() { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Sequence(Sequence other) : this() { elemType_ = other.elemType_ != null ? other.elemType_.Clone() : null; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Sequence Clone() { return new Sequence(this); } @@ -6042,6 +6385,7 @@ public Sequence Clone() { /// This field MUST be present for this version of the IR. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Onnx.TypeProto ElemType { get { return elemType_; } set { @@ -6050,11 +6394,13 @@ public Sequence Clone() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Sequence); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Sequence other) { if (ReferenceEquals(other, null)) { return false; @@ -6067,6 +6413,7 @@ public bool Equals(Sequence other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (elemType_ != null) hash ^= ElemType.GetHashCode(); @@ -6077,11 +6424,13 @@ public override int GetHashCode() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -6098,6 +6447,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (elemType_ != null) { output.WriteRawTag(10); @@ -6110,6 +6460,7 @@ public void WriteTo(pb::CodedOutputStream output) { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (elemType_ != null) { @@ -6122,6 +6473,7 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Sequence other) { if (other == null) { return; @@ -6136,6 +6488,7 @@ public void MergeFrom(Sequence other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -6160,6 +6513,7 @@ public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -6192,19 +6546,23 @@ public sealed partial class Map : pb::IMessage private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Map()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Onnx.TypeProto.Descriptor.NestedTypes[2]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Map() { OnConstruction(); } @@ -6212,6 +6570,7 @@ public Map() { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Map(Map other) : this() { keyType_ = other.keyType_; valueType_ = other.valueType_ != null ? other.valueType_.Clone() : null; @@ -6219,6 +6578,7 @@ public Map(Map other) : this() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Map Clone() { return new Map(this); } @@ -6232,6 +6592,7 @@ public Map Clone() { /// This field MUST refer to an integral type ([U]INT{8|16|32|64}) or STRING /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int KeyType { get { return keyType_; } set { @@ -6246,6 +6607,7 @@ public int KeyType { /// This field MUST be present for this version of the IR. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Onnx.TypeProto ValueType { get { return valueType_; } set { @@ -6254,11 +6616,13 @@ public int KeyType { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Map); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Map other) { if (ReferenceEquals(other, null)) { return false; @@ -6272,6 +6636,7 @@ public bool Equals(Map other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (KeyType != 0) hash ^= KeyType.GetHashCode(); @@ -6283,11 +6648,13 @@ public override int GetHashCode() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -6308,6 +6675,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (KeyType != 0) { output.WriteRawTag(8); @@ -6324,6 +6692,7 @@ public void WriteTo(pb::CodedOutputStream output) { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (KeyType != 0) { @@ -6339,6 +6708,7 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Map other) { if (other == null) { return; @@ -6356,6 +6726,7 @@ public void MergeFrom(Map other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -6384,6 +6755,7 @@ public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -6420,19 +6792,23 @@ public sealed partial class Optional : pb::IMessage private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Optional()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Onnx.TypeProto.Descriptor.NestedTypes[3]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Optional() { OnConstruction(); } @@ -6440,12 +6816,14 @@ public Optional() { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Optional(Optional other) : this() { elemType_ = other.elemType_ != null ? other.elemType_.Clone() : null; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Optional Clone() { return new Optional(this); } @@ -6459,6 +6837,7 @@ public Optional Clone() { /// Possible values correspond to OptionalProto.DataType enum /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Onnx.TypeProto ElemType { get { return elemType_; } set { @@ -6467,11 +6846,13 @@ public Optional Clone() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Optional); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Optional other) { if (ReferenceEquals(other, null)) { return false; @@ -6484,6 +6865,7 @@ public bool Equals(Optional other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (elemType_ != null) hash ^= ElemType.GetHashCode(); @@ -6494,11 +6876,13 @@ public override int GetHashCode() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -6515,6 +6899,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (elemType_ != null) { output.WriteRawTag(10); @@ -6527,6 +6912,7 @@ public void WriteTo(pb::CodedOutputStream output) { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (elemType_ != null) { @@ -6539,6 +6925,7 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Optional other) { if (other == null) { return; @@ -6553,6 +6940,7 @@ public void MergeFrom(Optional other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -6577,6 +6965,7 @@ public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -6606,19 +6995,23 @@ public sealed partial class SparseTensor : pb::IMessage private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SparseTensor()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Onnx.TypeProto.Descriptor.NestedTypes[4]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SparseTensor() { OnConstruction(); } @@ -6626,6 +7019,7 @@ public SparseTensor() { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SparseTensor(SparseTensor other) : this() { elemType_ = other.elemType_; shape_ = other.shape_ != null ? other.shape_.Clone() : null; @@ -6633,6 +7027,7 @@ public SparseTensor(SparseTensor other) : this() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public SparseTensor Clone() { return new SparseTensor(this); } @@ -6646,6 +7041,7 @@ public SparseTensor Clone() { /// This field MUST be present for this version of the IR. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int ElemType { get { return elemType_; } set { @@ -6657,6 +7053,7 @@ public int ElemType { public const int ShapeFieldNumber = 2; private global::Onnx.TensorShapeProto shape_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public global::Onnx.TensorShapeProto Shape { get { return shape_; } set { @@ -6665,11 +7062,13 @@ public int ElemType { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as SparseTensor); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(SparseTensor other) { if (ReferenceEquals(other, null)) { return false; @@ -6683,6 +7082,7 @@ public bool Equals(SparseTensor other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (ElemType != 0) hash ^= ElemType.GetHashCode(); @@ -6694,11 +7094,13 @@ public override int GetHashCode() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -6719,6 +7121,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (ElemType != 0) { output.WriteRawTag(8); @@ -6735,6 +7138,7 @@ public void WriteTo(pb::CodedOutputStream output) { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (ElemType != 0) { @@ -6750,6 +7154,7 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(SparseTensor other) { if (other == null) { return; @@ -6767,6 +7172,7 @@ public void MergeFrom(SparseTensor other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -6795,6 +7201,7 @@ public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -6828,19 +7235,23 @@ public sealed partial class Opaque : pb::IMessage private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Opaque()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Onnx.TypeProto.Descriptor.NestedTypes[5]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Opaque() { OnConstruction(); } @@ -6848,6 +7259,7 @@ public Opaque() { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Opaque(Opaque other) : this() { domain_ = other.domain_; name_ = other.name_; @@ -6855,6 +7267,7 @@ public Opaque(Opaque other) : this() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public Opaque Clone() { return new Opaque(this); } @@ -6866,6 +7279,7 @@ public Opaque Clone() { /// When missing, the domain is the same as the model's. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Domain { get { return domain_; } set { @@ -6880,6 +7294,7 @@ public string Domain { /// The name is optional but significant when provided. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Name { get { return name_; } set { @@ -6888,11 +7303,13 @@ public string Name { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as Opaque); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(Opaque other) { if (ReferenceEquals(other, null)) { return false; @@ -6906,6 +7323,7 @@ public bool Equals(Opaque other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Domain.Length != 0) hash ^= Domain.GetHashCode(); @@ -6917,11 +7335,13 @@ public override int GetHashCode() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -6942,6 +7362,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (Domain.Length != 0) { output.WriteRawTag(10); @@ -6958,6 +7379,7 @@ public void WriteTo(pb::CodedOutputStream output) { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Domain.Length != 0) { @@ -6973,6 +7395,7 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(Opaque other) { if (other == null) { return; @@ -6987,6 +7410,7 @@ public void MergeFrom(Opaque other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -7012,6 +7436,7 @@ public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -7052,19 +7477,23 @@ public sealed partial class OperatorSetIdProto : pb::IMessage _parser = new pb::MessageParser(() => new OperatorSetIdProto()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Onnx.OnnxMlReflection.Descriptor.MessageTypes[12]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OperatorSetIdProto() { OnConstruction(); } @@ -7072,6 +7501,7 @@ public OperatorSetIdProto() { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OperatorSetIdProto(OperatorSetIdProto other) : this() { domain_ = other.domain_; version_ = other.version_; @@ -7079,6 +7509,7 @@ public OperatorSetIdProto(OperatorSetIdProto other) : this() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public OperatorSetIdProto Clone() { return new OperatorSetIdProto(this); } @@ -7093,6 +7524,7 @@ public OperatorSetIdProto Clone() { /// This field MUST be present in this version of the IR when referring to any other operator set. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Domain { get { return domain_; } set { @@ -7108,6 +7540,7 @@ public string Domain { /// This field MUST be present in this version of the IR. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public long Version { get { return version_; } set { @@ -7116,11 +7549,13 @@ public long Version { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as OperatorSetIdProto); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(OperatorSetIdProto other) { if (ReferenceEquals(other, null)) { return false; @@ -7134,6 +7569,7 @@ public bool Equals(OperatorSetIdProto other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Domain.Length != 0) hash ^= Domain.GetHashCode(); @@ -7145,11 +7581,13 @@ public override int GetHashCode() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -7170,6 +7608,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (Domain.Length != 0) { output.WriteRawTag(10); @@ -7186,6 +7625,7 @@ public void WriteTo(pb::CodedOutputStream output) { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Domain.Length != 0) { @@ -7201,6 +7641,7 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(OperatorSetIdProto other) { if (other == null) { return; @@ -7215,6 +7656,7 @@ public void MergeFrom(OperatorSetIdProto other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -7240,6 +7682,7 @@ public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -7270,19 +7713,23 @@ public sealed partial class FunctionProto : pb::IMessage private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FunctionProto()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { get { return global::Onnx.OnnxMlReflection.Descriptor.MessageTypes[13]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FunctionProto() { OnConstruction(); } @@ -7290,6 +7737,7 @@ public FunctionProto() { partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FunctionProto(FunctionProto other) : this() { name_ = other.name_; input_ = other.input_.Clone(); @@ -7303,6 +7751,7 @@ public FunctionProto(FunctionProto other) : this() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public FunctionProto Clone() { return new FunctionProto(this); } @@ -7316,6 +7765,7 @@ public FunctionProto Clone() { /// the FunctionProto. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Name { get { return name_; } set { @@ -7332,6 +7782,7 @@ public string Name { /// The inputs and outputs of the function. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Input { get { return input_; } } @@ -7342,6 +7793,7 @@ public string Name { = pb::FieldCodec.ForString(42); private readonly pbc::RepeatedField output_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Output { get { return output_; } } @@ -7355,6 +7807,7 @@ public string Name { /// The attributes of the function. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Attribute { get { return attribute_; } } @@ -7368,6 +7821,7 @@ public string Name { /// The nodes in the function. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField Node { get { return node_; } } @@ -7379,6 +7833,7 @@ public string Name { /// A human-readable documentation for this function. Markdown is allowed. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string DocString { get { return docString_; } set { @@ -7392,6 +7847,7 @@ public string DocString { = pb::FieldCodec.ForMessage(74, global::Onnx.OperatorSetIdProto.Parser); private readonly pbc::RepeatedField opsetImport_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public pbc::RepeatedField OpsetImport { get { return opsetImport_; } } @@ -7404,6 +7860,7 @@ public string DocString { /// the FunctionProto. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public string Domain { get { return domain_; } set { @@ -7412,11 +7869,13 @@ public string Domain { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { return Equals(other as FunctionProto); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public bool Equals(FunctionProto other) { if (ReferenceEquals(other, null)) { return false; @@ -7436,6 +7895,7 @@ public bool Equals(FunctionProto other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override int GetHashCode() { int hash = 1; if (Name.Length != 0) hash ^= Name.GetHashCode(); @@ -7453,11 +7913,13 @@ public override int GetHashCode() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE output.WriteRawMessage(this); @@ -7487,6 +7949,7 @@ public void WriteTo(pb::CodedOutputStream output) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { if (Name.Length != 0) { output.WriteRawTag(10); @@ -7512,6 +7975,7 @@ public void WriteTo(pb::CodedOutputStream output) { #endif [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public int CalculateSize() { int size = 0; if (Name.Length != 0) { @@ -7535,6 +7999,7 @@ public int CalculateSize() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(FunctionProto other) { if (other == null) { return; @@ -7557,6 +8022,7 @@ public void MergeFrom(FunctionProto other) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE input.ReadRawMessage(this); @@ -7606,6 +8072,7 @@ public void MergeFrom(pb::CodedInputStream input) { #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { uint tag; while ((tag = input.ReadTag()) != 0) { diff --git a/docs/OperatorKernels.md b/docs/OperatorKernels.md index 5869514a3be0e..102dce0737296 100644 --- a/docs/OperatorKernels.md +++ b/docs/OperatorKernels.md @@ -43,6 +43,7 @@ Do not modify directly.* |||[9, 13]|**T** = tensor(double), tensor(float)| |||[7, 8]|**T** = tensor(double), tensor(float)| |BitShift|*in* X:**T**
*in* Y:**T**
*out* Z:**T**|11+|**T** = tensor(uint32), tensor(uint64), tensor(uint8)| +|BlackmanWindow|*in* size:**T1**
*out* output:**T2**|17+|**T1** = tensor(int32), tensor(int64)
**T2** = tensor(double), tensor(float), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8)| |Cast|*in* input:**T1**
*out* output:**T2**|13+|**T1** = tensor(bfloat16), tensor(bool), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(string), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8)
**T2** = tensor(bfloat16), tensor(bool), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(string), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8)| |||[6, 12]|**T1** = tensor(bfloat16), tensor(bool), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(string), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8)
**T2** = tensor(bfloat16), tensor(bool), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(string), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8)| |Ceil|*in* X:**T**
*out* Y:**T**|13+|**T** = tensor(float)| @@ -69,6 +70,7 @@ Do not modify directly.* |Crop|*in* input:**T**
*out* output:**T**|1+|**T** = tensor(float)| |CumSum|*in* x:**T**
*in* axis:**T2**
*out* y:**T**|14+|**T** = tensor(double), tensor(float), tensor(int32), tensor(int64)
**T2** = tensor(int32), tensor(int64)| |||[11, 13]|**T** = tensor(double), tensor(float), tensor(int32), tensor(int64)
**T2** = tensor(int32), tensor(int64)| +|DFT|*in* input:**T1**
*in* dft_length:**T2**
*out* output:**T1**|17+|**T1** = tensor(double), tensor(float)
**T2** = tensor(int32), tensor(int64)| |DepthToSpace|*in* input:**T**
*out* output:**T**|13+|**T** = tensor(double), tensor(float)| |||[11, 12]|**T** = tensor(double), tensor(float)| |||[1, 10]|**T** = tensor(double), tensor(float)| @@ -125,6 +127,8 @@ Do not modify directly.* |GreaterOrEqual|*in* A:**T**
*in* B:**T**
*out* C:**T1**|16+|**T** = tensor(double), tensor(float), tensor(int32), tensor(int64)
**T1** = tensor(bool)| |||[12, 15]|**T** = tensor(double), tensor(float), tensor(int32), tensor(int64)
**T1** = tensor(bool)| |GridSample|*in* X:**T1**
*in* grid:**T1**
*out* Y:**T2**|16+|**T1** = tensor(float)
**T2** = tensor(float)| +|HammingWindow|*in* size:**T1**
*out* output:**T2**|17+|**T1** = tensor(int32), tensor(int64)
**T2** = tensor(double), tensor(float), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8)| +|HannWindow|*in* size:**T1**
*out* output:**T2**|17+|**T1** = tensor(int32), tensor(int64)
**T2** = tensor(double), tensor(float), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8)| |HardSigmoid|*in* X:**T**
*out* Y:**T**|6+|**T** = tensor(float)| |Hardmax|*in* input:**T**
*out* output:**T**|13+|**T** = tensor(float)| |||[11, 12]|**T** = tensor(float)| @@ -146,7 +150,7 @@ Do not modify directly.* |||[1, 12]|**T** = tensor(float)| |LSTM|*in* X:**T**
*in* W:**T**
*in* R:**T**
*in* B:**T**
*in* sequence_lens:**T1**
*in* initial_h:**T**
*in* initial_c:**T**
*in* P:**T**
*out* Y:**T**
*out* Y_h:**T**
*out* Y_c:**T**|14+|**T** = tensor(double), tensor(float)
**T1** = tensor(int32)| |||[7, 13]|**T** = tensor(double), tensor(float)
**T1** = tensor(int32)| -|LayerNormalization|*in* X:**T**
*in* Scale:**V**
*in* B:**V**
*out* Y:**V**
*out* Mean:**U**
*out* InvStdDev:**U**|1+|**T** = tensor(double), tensor(float)
**U** = tensor(double), tensor(float)
**V** = tensor(double), tensor(float)| +|LayerNormalization|*in* X:**T**
*in* Scale:**T**
*in* B:**T**
*out* Y:**T**
*out* Mean:**U**
*out* InvStdDev:**U**

or

*in* X:**T**
*in* Scale:**V**
*in* B:**V**
*out* Y:**V**
*out* Mean:**U**
*out* InvStdDev:**U**|1+|**T** = tensor(double), tensor(float)
**U** = tensor(double), tensor(float)
**V** = tensor(double), tensor(float)| |LeakyRelu|*in* X:**T**
*out* Y:**T**|16+|**T** = tensor(float)| |||[6, 15]|**T** = tensor(float)| |Less|*in* A:**T**
*in* B:**T**
*out* C:**T1**|13+|**T** = tensor(double), tensor(float), tensor(int32), tensor(int64)
**T1** = tensor(bool)| @@ -186,6 +190,7 @@ Do not modify directly.* |MeanVarianceNormalization|*in* X:**T**
*out* Y:**T**

or

*in* input:**T**
*out* output:**T**|13+|**T** = tensor(float)| |||[9, 12]|**T** = tensor(float)| |||[1, 8]|**T** = tensor(float)| +|MelWeightMatrix|*in* num_mel_bins:**T1**
*in* dft_length:**T1**
*in* sample_rate:**T1**
*in* lower_edge_hertz:**T2**
*in* upper_edge_hertz:**T2**
*out* output:**T3**|17+|**T1** = tensor(int32), tensor(int64)
**T2** = tensor(float)
**T3** = tensor(double), tensor(float), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8)| |Min|*in* data_0:**T**
*out* min:**T**|13+|**T** = tensor(double), tensor(float), tensor(float16), tensor(int32), tensor(int64), tensor(uint32), tensor(uint64)| |||12|**T** = tensor(double), tensor(float), tensor(float16), tensor(int32), tensor(int64), tensor(uint32), tensor(uint64)| |||[8, 11]|**T** = tensor(double), tensor(float)| @@ -277,6 +282,7 @@ Do not modify directly.* |RoiAlign|*in* X:**T1**
*in* rois:**T1**
*in* batch_indices:**T2**
*out* Y:**T1**|16+|**T1** = tensor(double), tensor(float)
**T2** = tensor(int64)| |||[10, 15]|**T1** = tensor(double), tensor(float)
**T2** = tensor(int64)| |Round|*in* X:**T**
*out* Y:**T**|11+|**T** = tensor(double), tensor(float), tensor(float16)| +|STFT|*in* signal:**T1**
*in* frame_step:**T2**
*in* window:**T1**
*in* frame_length:**T2**
*out* output:**T1**|17+|**T1** = tensor(double), tensor(float)
**T2** = tensor(int32), tensor(int64)| |Scale|*in* input:**T**
*out* output:**T**|1+|**T** = tensor(float)| |ScaledTanh|*in* input:**T**
*out* output:**T**|1+|**T** = tensor(float)| |Scan|*in* initial_state_and_scan_inputs:**V**
*out* final_state_and_scan_outputs:**V**

or

*in* sequence_lens:**I**
*in* initial_state_and_scan_inputs:**V**
*out* final_state_and_scan_outputs:**V**|16+|**V** = tensor(bfloat16), tensor(bool), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(string), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8)| @@ -561,7 +567,7 @@ Do not modify directly.* |||[1, 12]|**T** = tensor(double), tensor(float), tensor(float16)| |LSTM|*in* X:**T**
*in* W:**T**
*in* R:**T**
*in* B:**T**
*in* sequence_lens:**T1**
*in* initial_h:**T**
*in* initial_c:**T**
*in* P:**T**
*out* Y:**T**
*out* Y_h:**T**
*out* Y_c:**T**|14+|**T** = tensor(double), tensor(float), tensor(float16)
**T1** = tensor(int32)| |||[7, 13]|**T** = tensor(double), tensor(float), tensor(float16)
**T1** = tensor(int32)| -|LayerNormalization|*in* X:**T**
*in* Scale:**V**
*in* B:**V**
*out* Y:**V**
*out* Mean:**U**
*out* InvStdDev:**U**|1+|**T** = tensor(bfloat16), tensor(double), tensor(float), tensor(float16)
**U** = tensor(double), tensor(float)
**V** = tensor(bfloat16), tensor(double), tensor(float), tensor(float16)| +|LayerNormalization|*in* X:**T**
*in* Scale:**T**
*in* B:**T**
*out* Y:**T**
*out* Mean:**U**
*out* InvStdDev:**U**

or

*in* X:**T**
*in* Scale:**V**
*in* B:**V**
*out* Y:**V**
*out* Mean:**U**
*out* InvStdDev:**U**|1+|**T** = tensor(bfloat16), tensor(double), tensor(float), tensor(float16)
**U** = tensor(double), tensor(float)
**V** = tensor(bfloat16), tensor(double), tensor(float), tensor(float16)| |LeakyRelu|*in* X:**T**
*out* Y:**T**|16+|**T** = tensor(double), tensor(float), tensor(float16)| |||[6, 15]|**T** = tensor(double), tensor(float), tensor(float16)| |Less|*in* A:**T**
*in* B:**T**
*out* C:**T1**|13+|**T** = tensor(double), tensor(float), tensor(float16), tensor(int32), tensor(int64), tensor(uint32), tensor(uint64)
**T1** = tensor(bool)| diff --git a/include/onnxruntime/core/graph/graph.h b/include/onnxruntime/core/graph/graph.h index 37bd9e75cf121..73069ce7c3b7c 100644 --- a/include/onnxruntime/core/graph/graph.h +++ b/include/onnxruntime/core/graph/graph.h @@ -80,6 +80,22 @@ class Node { }; explicit Node() = default; + +#if !defined(ORT_MINIMAL_BUILD) || defined(ORT_EXTENDED_MINIMAL_BUILD) + Node(std::string_view name, + std::string_view op_type, + std::string_view description, + gsl::span input_args, + gsl::span output_args, + const NodeAttributes* attributes, + std::string_view domain) { + Init(std::string{name}, std::string{op_type}, std::string{description}, + std::vector{input_args.begin(), input_args.end()}, + std::vector{output_args.begin(), output_args.end()}, + attributes, std::string{domain}); + } +#endif + ~Node() = default; /** @@ -169,9 +185,8 @@ class Node { @remarks The graph containing this node must be resolved, otherwise nullptr will be returned. */ const ONNX_NAMESPACE::OpSchema* Op() const noexcept { return op_; } - Status InstantiateFunctionBody(); - - Status GetInstantiateFunctionBody(std::unique_ptr& output) const; + /** Create a copy of the called op's FunctionProto if it has one. Returns true if successful. */ + bool TryGetFunctionProto(ONNX_NAMESPACE::FunctionProto& func_proto) const; bool CanBeInlined() const; @@ -1289,9 +1304,9 @@ class Graph { */ Graph(Graph& parent_graph, const Node& parent_node, ONNX_NAMESPACE::GraphProto& subgraph_proto); - Graph(const Model& owning_model, - IOnnxRuntimeOpSchemaCollectionPtr schema_registry, - ONNX_NAMESPACE::GraphProto& subgraph_proto, + Graph(const Model& owning_model, + IOnnxRuntimeOpSchemaCollectionPtr schema_registry, + ONNX_NAMESPACE::GraphProto& subgraph_proto, const std::unordered_map& domain_version_map, const logging::Logger& logger, bool strict_shape_type_inference); @@ -1571,7 +1586,7 @@ class Graph { IOnnxRuntimeOpSchemaCollectionPtr schema_registry_; //Currently to make the ORT in-memory graph work, we have to create a temporary op schema - //for the fused kernel. I really don't like it. but for short-term solution, let's host + //for the fused kernel. I really don't like it. but for short-term solution, let's host //those schemas here. InlinedVector> fused_schemas_containers_; #endif // !defined(ORT_MINIMAL_BUILD) diff --git a/include/onnxruntime/core/platform/EigenNonBlockingThreadPool.h b/include/onnxruntime/core/platform/EigenNonBlockingThreadPool.h index 90c4329202db2..82573cea5a948 100644 --- a/include/onnxruntime/core/platform/EigenNonBlockingThreadPool.h +++ b/include/onnxruntime/core/platform/EigenNonBlockingThreadPool.h @@ -132,7 +132,7 @@ // // - When entering a parallel loop (or parallel section), a thread // maintains a set of "preferred" worker hints, and initially -// submits tasks to these workers. +// submits tasks to these workers. // When a task executes, it updates the submitting thread's // preferred workers to reflect the worker that the task ran on. // Hence, if a task is submitted to thread T1's queue, and then @@ -265,14 +265,14 @@ class ThreadPoolProfiler { std::string Reset(); }; bool enabled_ = false; - MainThreadStat& GetMainThreadStat(); //return thread local stat + MainThreadStat& GetMainThreadStat(); //return thread local stat int num_threads_; struct ChildThreadStat { std::thread::id thread_id_; uint64_t num_run_ = 0; onnxruntime::TimePoint last_logged_point_ = Clock::now(); - int32_t core_ = -1; //core that the child thread is running on - PaddingToAvoidFalseSharing padding_; //to prevent false sharing + int32_t core_ = -1; //core that the child thread is running on + PaddingToAvoidFalseSharing padding_; //to prevent false sharing }; std::vector child_thread_stats_; std::string thread_pool_name_; @@ -288,9 +288,9 @@ class ExtendedThreadPoolInterface : public Eigen::ThreadPoolInterface { // Start/end a parallel section, within which calls to // RunInParallelSection may be made. Parallel sections are // non-nesting. - virtual std::unique_ptr AllocateParallelSection() = 0; - virtual void StartParallelSection(ThreadPoolParallelSection &ps) = 0; - virtual void EndParallelSection(ThreadPoolParallelSection &ps) = 0; + virtual std::unique_ptr AllocateParallelSection() = 0; + virtual void StartParallelSection(ThreadPoolParallelSection& ps) = 0; + virtual void EndParallelSection(ThreadPoolParallelSection& ps) = 0; // Run fn with up to n degree-of-parallelism enlisting the thread // pool for help. The degree-of-parallelism includes the caller, @@ -302,7 +302,7 @@ class ExtendedThreadPoolInterface : public Eigen::ThreadPoolInterface { // // The parameter idx provides a loop-local thread ID in the range // [0,k) where k<=n. - virtual void RunInParallelSection(ThreadPoolParallelSection &ps, + virtual void RunInParallelSection(ThreadPoolParallelSection& ps, std::function fn, unsigned n, std::ptrdiff_t block_size) = 0; @@ -322,11 +322,10 @@ class ExtendedThreadPoolInterface : public Eigen::ThreadPoolInterface { // two loops execute in series in a parallel section. ] virtual void RunInParallel(std::function fn, unsigned n, std::ptrdiff_t block_size) = 0; - virtual void StartProfiling() = 0; + virtual void StartProfiling() = 0; virtual std::string StopProfiling() = 0; }; - class ThreadPoolParallelSection { public: // State accessed only by the main thread @@ -334,7 +333,7 @@ class ThreadPoolParallelSection { // Tasks successfully submitted to the work queues. This sets the // maximum degree of parallelism that the section will support. - std::vector> tasks; + std::vector> tasks; // Number of tasks revoked (i.e., removed from the queues prior to // execution). We count this at various points, and omit waiting @@ -368,11 +367,11 @@ class ThreadPoolParallelSection { // // - Writers wishing to deallocate *current_loop must first clear // current_loop and then wait for workers_in_loop==0 - std::atomic current_loop{nullptr}; + std::atomic current_loop{nullptr}; std::atomic workers_in_loop{0}; // Members to track asynchronous dispatching - int dispatch_q_idx = -1; // index of thread that dispatch work to all other threads + int dispatch_q_idx = -1; // index of thread that dispatch work to all other threads unsigned dispatch_w_idx = 0; // index of enqueued work std::atomic dispatch_started{false}; std::atomic dispatch_done{false}; @@ -381,8 +380,8 @@ class ThreadPoolParallelSection { class ThreadPoolLoop { public: - ThreadPoolLoop(std::function f, unsigned t) : fn(std::move(f)), threads_needed(t) { - } + ThreadPoolLoop(std::function f, unsigned t) : fn(std::move(f)), threads_needed(t) { + } const std::function fn; const unsigned threads_needed; @@ -410,7 +409,7 @@ class RunQueue { // If the queue was empty returns default-constructed Work. Work PopFront() { unsigned front; - Elem *e; + Elem* e; ElemState s; // Drain revoked items from the front of the queue. CAS to busy to synchronize with @@ -458,20 +457,20 @@ class RunQueue { return Work(); } - // PushBackWithTag adds w at the end of the queue. The tag value can be used on a + // PushBackWithTag adds w at the end of the queue. The tag value can be used on a // subsequent call to RevokeWithTag to remove the item from the queue in combination // with w_idx. Typically the tag will be a per-thread ID to distinguish work // submitted from different threads. - PushResult PushBackWithTag(Work w, Tag tag, unsigned &w_idx) { + PushResult PushBackWithTag(Work w, Tag tag, unsigned& w_idx) { std::unique_lock lock(mutex_); unsigned back = back_.load(std::memory_order_relaxed); - w_idx = (back-1) & kMask; + w_idx = (back - 1) & kMask; Elem& e = array_[w_idx]; ElemState s = e.state.load(std::memory_order_relaxed); if (s != ElemState::kEmpty || !e.state.compare_exchange_strong(s, ElemState::kBusy, std::memory_order_acquire)) return PushResult::REJECTED; /* Not enqueued */ - bool was_ready = (((back^(front_.load(std::memory_order_relaxed)))&kMask) == 0); + bool was_ready = (((back ^ (front_.load(std::memory_order_relaxed))) & kMask) == 0); back = ((back - 1) & kMask2) | (back & ~kMask2); back_.store(back, std::memory_order_relaxed); e.w = std::move(w); @@ -486,7 +485,7 @@ class RunQueue { return Work(); std::unique_lock lock(mutex_); unsigned back; - Elem *e; + Elem* e; ElemState s; // Drain revoked items from the back of the queue. CAS to busy to synchronize with @@ -513,10 +512,10 @@ class RunQueue { } // RevokeItem removes a work item from the queue. Items are identified positionally, - // and so a tag is used to detect whether the same position is occupied by a + // and so a tag is used to detect whether the same position is occupied by a // different work item at the time of removal. RevokeWithTags lets threads offer work - // for parallel execution, and then revoke the offer prior to the work executing (for - // instance if the thread itself completes all of the work). Revoking the work + // for parallel execution, and then revoke the offer prior to the work executing (for + // instance if the thread itself completes all of the work). Revoking the work // lets the thread deallocate state that might otherwise have been captured by the work item // and accessed by it. // @@ -631,12 +630,12 @@ class RunQueue { if (NeedSizeEstimate) { return CalculateSize(front, back); } - // This value will be 0 if the queue is empty, and undefined otherwise. - unsigned maybe_zero = ((front ^ back) & kMask2); - // Queue size estimate must agree with maybe zero check on the queue - // empty/non-empty state. - eigen_assert((CalculateSize(front, back) == 0) == (maybe_zero == 0)); - return maybe_zero; + // This value will be 0 if the queue is empty, and undefined otherwise. + unsigned maybe_zero = ((front ^ back) & kMask2); + // Queue size estimate must agree with maybe zero check on the queue + // empty/non-empty state. + eigen_assert((CalculateSize(front, back) == 0) == (maybe_zero == 0)); + return maybe_zero; } } @@ -663,7 +662,6 @@ static std::atomic next_tag{1}; template class ThreadPoolTempl : public onnxruntime::concurrency::ExtendedThreadPoolInterface { - private: struct PerThread; @@ -677,7 +675,6 @@ class ThreadPoolTempl : public onnxruntime::concurrency::ExtendedThreadPoolInter ThreadPoolProfiler profiler_; public: - void StartProfiling() override { profiler_.Start(); } @@ -772,7 +769,7 @@ class ThreadPoolTempl : public onnxruntime::concurrency::ExtendedThreadPoolInter void Schedule(std::function fn) override { PerThread* pt = GetPerThread(); int q_idx = Rand(&pt->rand) % num_threads_; - WorkerData &td = worker_data_[q_idx]; + WorkerData& td = worker_data_[q_idx]; Queue& q = td.queue; fn = q.PushBack(std::move(fn)); if (!fn) { @@ -784,511 +781,517 @@ class ThreadPoolTempl : public onnxruntime::concurrency::ExtendedThreadPoolInter } } -//...................................................................... -// -// Parallel sections -// ----------------- -// -// Allocate a new ThreadPoolParallelSection, owned by the returned -// unique_ptr. The explicit deleter avoids the Eigen-specific -// definition of ThreadPoolParallelSection needing to be avilable in -// threadpool.h where the user-facing parallel section API is defined. -GSL_SUPPRESS(r.11) -std::unique_ptr AllocateParallelSection() override { - return std::unique_ptr - (new ThreadPoolParallelSection, - [](ThreadPoolParallelSection *tps) { - delete tps; - }); -} - -// Start a parallel section, using a caller-provided -// ThreadPoolParallelSection for maintaining the per-section state. -// Starting a parallel section is just book-keeping; threads are -// "summoned" to help with the parallel section once it enters -// parallel loops. The threads are then retained until the end of the -// section, being re-used over subsequent loops. - -void StartParallelSectionInternal(PerThread &pt, - ThreadPoolParallelSection &ps) { - assert((!pt.leading_par_section) && "Nested parallelism not supported"); - assert((!ps.active) && "Starting parallel section, but active already"); - pt.leading_par_section = true; - if (!pt.tag.Get()) { - pt.tag = Tag::GetNext(); + //...................................................................... + // + // Parallel sections + // ----------------- + // + // Allocate a new ThreadPoolParallelSection, owned by the returned + // unique_ptr. The explicit deleter avoids the Eigen-specific + // definition of ThreadPoolParallelSection needing to be avilable in + // threadpool.h where the user-facing parallel section API is defined. + GSL_SUPPRESS(r .11) + std::unique_ptr AllocateParallelSection() override { + return std::unique_ptr(new ThreadPoolParallelSection, + [](ThreadPoolParallelSection* tps) { + delete tps; + }); } - ps.dispatch_q_idx = -1; - ps.dispatch_started = false; - ps.dispatch_done = false; - ps.work_done = false; - ps.tasks_revoked = 0; - ps.current_dop = 1; - ps.active = true; -} - -void StartParallelSection(ThreadPoolParallelSection &ps) override { - PerThread* pt = GetPerThread(); - StartParallelSectionInternal(*pt, ps); -} - -// End a parallel section, waiting for all worker threads to exit from -// section. Hence, on return, the ThreadPoolParallelSection object -// can be dealloacted. -void EndParallelSectionInternal(PerThread &pt, - ThreadPoolParallelSection &ps) { - assert((pt.leading_par_section) && "Ending parallel section, but none started"); - assert((ps.active) && "Ending parallel section, but not active"); - pt.leading_par_section = false; - - // Notify workers to exit from the section - ps.active = false; - - // First, attempt to revoke the dispatch task. If we succeed then - // we know we revoked _something_ pushed for the current loop. That - // may be the dispatch task itself, or it may be a task pushed by - // the dispatch task. Those cases are distinguished by whether or - // not the dispatch task itself has started -- if it has not started - // then it cannot have pushed tasks. - if (ps.dispatch_q_idx != -1) { - Queue& q = worker_data_[ps.dispatch_q_idx].queue; - if (q.RevokeWithTag(pt.tag, ps.dispatch_w_idx)) { - if (!ps.dispatch_started.load(std::memory_order_acquire)) { - // We successfully revoked a task, and saw the dispatch task - // not started. Hence we know we revoked the dispatch task. - // This should be the common case. - ps.dispatch_q_idx = -1; - } else { - // We successfully revoked a task, but saw the dispatch task - // had started. Hence we know we revoked one of the _new_ - // tasks created by the dispatcher (not the dispatcher - // itself). This should be the rare case, but can occur if - // one of the tasks created by the dispatcher occupies the - // exact same slot in a work queue that the dispatcher used. - ps.tasks_revoked ++; - } + + // Start a parallel section, using a caller-provided + // ThreadPoolParallelSection for maintaining the per-section state. + // Starting a parallel section is just book-keeping; threads are + // "summoned" to help with the parallel section once it enters + // parallel loops. The threads are then retained until the end of the + // section, being re-used over subsequent loops. + + void StartParallelSectionInternal(PerThread& pt, + ThreadPoolParallelSection& ps) { + assert((!pt.leading_par_section) && "Nested parallelism not supported"); + assert((!ps.active) && "Starting parallel section, but active already"); + pt.leading_par_section = true; + if (!pt.tag.Get()) { + pt.tag = Tag::GetNext(); } + ps.dispatch_q_idx = -1; + ps.dispatch_started = false; + ps.dispatch_done = false; + ps.work_done = false; + ps.tasks_revoked = 0; + ps.current_dop = 1; + ps.active = true; } - // Second, if we failed to revoke the dispatch task, wait for it to - // finish dispatch work. This avoids new tasks being started - // concurrently with us attempting to end the parallel section. - if (ps.dispatch_q_idx != -1) { - while (!ps.dispatch_done.load(std::memory_order_acquire)) { - onnxruntime::concurrency::SpinPause(); - } + void StartParallelSection(ThreadPoolParallelSection& ps) override { + PerThread* pt = GetPerThread(); + StartParallelSectionInternal(*pt, ps); } - // Now we know that dispatch is finshed, we synchronize with the - // tasks that were created (if any) for the parallel section. We - // revoke tasks still in queues, and then wait for any that are - // still running. - profiler_.LogStart(); - unsigned tasks_started = static_cast(ps.tasks.size()); - while (!ps.tasks.empty()) { - const auto& item = ps.tasks.back(); - Queue& q = worker_data_[item.first].queue; - if (q.RevokeWithTag(pt.tag, item.second)) { - ps.tasks_revoked++; + // End a parallel section, waiting for all worker threads to exit from + // section. Hence, on return, the ThreadPoolParallelSection object + // can be dealloacted. + void EndParallelSectionInternal(PerThread& pt, + ThreadPoolParallelSection& ps) { + assert((pt.leading_par_section) && "Ending parallel section, but none started"); + assert((ps.active) && "Ending parallel section, but not active"); + pt.leading_par_section = false; + + // Notify workers to exit from the section + ps.active = false; + + // First, attempt to revoke the dispatch task. If we succeed then + // we know we revoked _something_ pushed for the current loop. That + // may be the dispatch task itself, or it may be a task pushed by + // the dispatch task. Those cases are distinguished by whether or + // not the dispatch task itself has started -- if it has not started + // then it cannot have pushed tasks. + if (ps.dispatch_q_idx != -1) { + Queue& q = worker_data_[ps.dispatch_q_idx].queue; + if (q.RevokeWithTag(pt.tag, ps.dispatch_w_idx)) { + if (!ps.dispatch_started.load(std::memory_order_acquire)) { + // We successfully revoked a task, and saw the dispatch task + // not started. Hence we know we revoked the dispatch task. + // This should be the common case. + ps.dispatch_q_idx = -1; + } else { + // We successfully revoked a task, but saw the dispatch task + // had started. Hence we know we revoked one of the _new_ + // tasks created by the dispatcher (not the dispatcher + // itself). This should be the rare case, but can occur if + // one of the tasks created by the dispatcher occupies the + // exact same slot in a work queue that the dispatcher used. + ps.tasks_revoked++; + } + } } - ps.tasks.pop_back(); - } - profiler_.LogEnd(ThreadPoolProfiler::WAIT_REVOKE); - // Wait for the dispatch task's own work... - if (ps.dispatch_q_idx > -1) { - while (!ps.work_done.load(std::memory_order_acquire)) { + // Second, if we failed to revoke the dispatch task, wait for it to + // finish dispatch work. This avoids new tasks being started + // concurrently with us attempting to end the parallel section. + if (ps.dispatch_q_idx != -1) { + while (!ps.dispatch_done.load(std::memory_order_acquire)) { + onnxruntime::concurrency::SpinPause(); + } + } + + // Now we know that dispatch is finshed, we synchronize with the + // tasks that were created (if any) for the parallel section. We + // revoke tasks still in queues, and then wait for any that are + // still running. + profiler_.LogStart(); + unsigned tasks_started = static_cast(ps.tasks.size()); + while (!ps.tasks.empty()) { + const auto& item = ps.tasks.back(); + Queue& q = worker_data_[item.first].queue; + if (q.RevokeWithTag(pt.tag, item.second)) { + ps.tasks_revoked++; + } + ps.tasks.pop_back(); + } + profiler_.LogEnd(ThreadPoolProfiler::WAIT_REVOKE); + + // Wait for the dispatch task's own work... + if (ps.dispatch_q_idx > -1) { + while (!ps.work_done.load(std::memory_order_acquire)) { + onnxruntime::concurrency::SpinPause(); + } + } + + // ...and wait for any other tasks not revoked to finish their work + auto tasks_to_wait_for = tasks_started - ps.tasks_revoked; + while (ps.tasks_finished < tasks_to_wait_for) { onnxruntime::concurrency::SpinPause(); } + + // Clear status to allow the ThreadPoolParallelSection to be + // re-used. + ps.tasks_finished = 0; } - // ...and wait for any other tasks not revoked to finish their work - auto tasks_to_wait_for = tasks_started - ps.tasks_revoked; - while (ps.tasks_finished < tasks_to_wait_for) { - onnxruntime::concurrency::SpinPause(); + void EndParallelSection(ThreadPoolParallelSection& ps) override { + PerThread* pt = GetPerThread(); + EndParallelSectionInternal(*pt, ps); } - - // Clear status to allow the ThreadPoolParallelSection to be - // re-used. - ps.tasks_finished = 0; -} - -void EndParallelSection(ThreadPoolParallelSection &ps) override { - PerThread* pt = GetPerThread(); - EndParallelSectionInternal(*pt, ps); -} - -//---------------------------------------------------------------------- -// -// Preferred workers -// ----------------- -// -// Initialize the set of hints for preferred worker threads we will -// use. We do this once, covering the maximum num_threads_ items, -// in order to avoid resizing preferred_workers concurrent with -// access from worker threads. -// -// For simplicity we initialize with hints round-robin among the -// workers. For simple workloads with 1 main thread this means we -// will distribute work across the pool of workers. For workers -// with multiple main threads it attempts to balance the load. -// -// These hints are just used as a starting point, and are updated by -// the worker thread that actually claims an item (e.g., if an item -// initially assigned to thread T1 is stolen and executed by T2, -// then T2 is assigned at the new preferred worker). -// -// Note that the hints are held in the _main_ thread that submits -// work to the pool. We assume that a thread is primarily -// submitting work to just one pool, but allow for the pool to -// change over time. Hence we allow the hints vector to grow over -// time. -// -// A note on terminology used in the variable names here: -// -// dop - degree of parallelism, as seen by the user. For instance -// dop=4 means 4 threads in total: 1 main thread that enters the -// loop, plus 1 dispatcher thread, plus 2 additional worker -// threads. -// -// par_idx - a thread's index within the loop, in the range [0,dop). -// -// num_threads_ - the number of worker threads in the thread pool. A -// loop with dop=4 will be common on a pool with 3 threads -// (given that the main thread will also participate). -// -// q_idx - a worker queue index, in the range [0,num_threads_). -// -// preferred_workers - this maps from par_idx values to q_idx. Hence, -// with dop=4 the vector will have length 4, and will identify -// which of the workers (0,1,2) should run tasks for the loop. -// Note that mapping from par_idx values means that only slots -// [1,dop) are actually used in preferred_workers. -// -// Here are three examples, all assuming a machine with 4 h/w threads, -// and ORT configured to use dop=4. -// -// * First, suppose that a single job is running a series of loops. -// Its main thread enters a parallel loop. Initially, let's assume -// its preferred worker array is [_,0,1,2], writing "_" for the -// unusued element for the par_idx=0 work that the main thread will -// run. -// -// The main thread schedules the dispatcher task onto worker 0. -// -// The dispatcher task schedules worker tasks onto workers 1 and 2. -// -// The tasks all execute, without any work stealing, on the threads -// they were scheduled on. The preferred worker array remains -// [_,0,1,2]. -// -// * Next, assume we have the same job, and for whatever reason the -// preferred workers were initially [_,0,0,0]. -// -// The main thread schedules the dispatcher onto worker 0. -// -// This dispatcher task runs on worker 0, and pushes the worker -// tasks back onto worker 0's queue. -// -// Workers 1 and 2 are idle, and steal tasks from worker 0. As the -// tasks run, they update the preferred_workers array to record the -// workers that execute them. -// -// After the loop, the preferred worker array may now be [_,0,2,1] -// or [_,0,1,2], reflecting the fact that the work has got -// re-distributed. The next loop will start out by distributing the -// work to those same workers. -// -// * Finally, let's assume we have two jobs running on two main -// threads, and we are now using DoP=2 in the loops, and have 2 -// workers in the thread pool (so the machine is not -// over-subscribed). -// -// Each main thread has its own preferred_workers, and -// let's say initially these are both [_,0]. -// -// Here, with DoP=2, each main thread will just dispatch a single -// task immediately (there is no need for asynchrony with only one -// task to generate). -// -// Initially both main threads will submit these tasks to worker 0. -// -// Once worker 1 steals one of these tasks, the task will update its -// preferred worker to be 1. -// -// From that point onwards, the two main threads will dispatch tasks -// to separate workers, avoiding the need for further work stealing. - -void InitializePreferredWorkers(std::vector &preferred_workers) { - static std::atomic next_worker; - - // preferred_workers[0] isn't supposed to be used, so initializng it with -1 to: - // a) fault if inapropriately accessed - // b) avoid wasting next_worker value - if (preferred_workers.size() == 0) - preferred_workers.push_back(-1); - - // preferred_workers maps from a par_idx to a q_idx, hence we - // initialize slots in the range [0,num_threads_] - while (preferred_workers.size() <= num_threads_) { - preferred_workers.push_back(next_worker++ % num_threads_); + + //---------------------------------------------------------------------- + // + // Preferred workers + // ----------------- + // + // Initialize the set of hints for preferred worker threads we will + // use. We do this once, covering the maximum num_threads_ items, + // in order to avoid resizing preferred_workers concurrent with + // access from worker threads. + // + // For simplicity we initialize with hints round-robin among the + // workers. For simple workloads with 1 main thread this means we + // will distribute work across the pool of workers. For workers + // with multiple main threads it attempts to balance the load. + // + // These hints are just used as a starting point, and are updated by + // the worker thread that actually claims an item (e.g., if an item + // initially assigned to thread T1 is stolen and executed by T2, + // then T2 is assigned at the new preferred worker). + // + // Note that the hints are held in the _main_ thread that submits + // work to the pool. We assume that a thread is primarily + // submitting work to just one pool, but allow for the pool to + // change over time. Hence we allow the hints vector to grow over + // time. + // + // A note on terminology used in the variable names here: + // + // dop - degree of parallelism, as seen by the user. For instance + // dop=4 means 4 threads in total: 1 main thread that enters the + // loop, plus 1 dispatcher thread, plus 2 additional worker + // threads. + // + // par_idx - a thread's index within the loop, in the range [0,dop). + // + // num_threads_ - the number of worker threads in the thread pool. A + // loop with dop=4 will be common on a pool with 3 threads + // (given that the main thread will also participate). + // + // q_idx - a worker queue index, in the range [0,num_threads_). + // + // preferred_workers - this maps from par_idx values to q_idx. Hence, + // with dop=4 the vector will have length 4, and will identify + // which of the workers (0,1,2) should run tasks for the loop. + // Note that mapping from par_idx values means that only slots + // [1,dop) are actually used in preferred_workers. + // + // Here are three examples, all assuming a machine with 4 h/w threads, + // and ORT configured to use dop=4. + // + // * First, suppose that a single job is running a series of loops. + // Its main thread enters a parallel loop. Initially, let's assume + // its preferred worker array is [_,0,1,2], writing "_" for the + // unusued element for the par_idx=0 work that the main thread will + // run. + // + // The main thread schedules the dispatcher task onto worker 0. + // + // The dispatcher task schedules worker tasks onto workers 1 and 2. + // + // The tasks all execute, without any work stealing, on the threads + // they were scheduled on. The preferred worker array remains + // [_,0,1,2]. + // + // * Next, assume we have the same job, and for whatever reason the + // preferred workers were initially [_,0,0,0]. + // + // The main thread schedules the dispatcher onto worker 0. + // + // This dispatcher task runs on worker 0, and pushes the worker + // tasks back onto worker 0's queue. + // + // Workers 1 and 2 are idle, and steal tasks from worker 0. As the + // tasks run, they update the preferred_workers array to record the + // workers that execute them. + // + // After the loop, the preferred worker array may now be [_,0,2,1] + // or [_,0,1,2], reflecting the fact that the work has got + // re-distributed. The next loop will start out by distributing the + // work to those same workers. + // + // * Finally, let's assume we have two jobs running on two main + // threads, and we are now using DoP=2 in the loops, and have 2 + // workers in the thread pool (so the machine is not + // over-subscribed). + // + // Each main thread has its own preferred_workers, and + // let's say initially these are both [_,0]. + // + // Here, with DoP=2, each main thread will just dispatch a single + // task immediately (there is no need for asynchrony with only one + // task to generate). + // + // Initially both main threads will submit these tasks to worker 0. + // + // Once worker 1 steals one of these tasks, the task will update its + // preferred worker to be 1. + // + // From that point onwards, the two main threads will dispatch tasks + // to separate workers, avoiding the need for further work stealing. + + void InitializePreferredWorkers(std::vector& preferred_workers) { + static std::atomic next_worker{0}; + + // preferred_workers[0] isn't supposed to be used, so initializing it with -1 to: + // a) fault if inappropriately accessed + // b) avoid wasting next_worker value + if (preferred_workers.empty()) { + preferred_workers.push_back(-1); + } + + // preferred_workers maps from a par_idx to a q_idx, hence we + // initialize slots in the range [0,num_threads_] + while (preferred_workers.size() <= num_threads_) { + preferred_workers.push_back(next_worker++ % num_threads_); + } } -} - -// Update the preferred worker for par_idx to be the calling thread - -void UpdatePreferredWorker(std::vector &preferred_workers, - unsigned par_idx) { - unsigned ran_on_idx = GetPerThread()->thread_id; - assert(ran_on_idx < num_threads_); - assert(par_idx < preferred_workers.size()); - preferred_workers[par_idx] = ran_on_idx; -} - -// Schedule [par_idx_start,par_idx_end) across the preferred workers - -void ScheduleOnPreferredWorkers(PerThread& pt, - ThreadPoolParallelSection& ps, - std::vector &preferred_workers, - unsigned par_idx_start, - unsigned par_idx_end, - std::function worker_fn) { - for (auto par_idx = par_idx_start; par_idx < par_idx_end; ++par_idx) { - // Look up hint for par_idx. Note that the hints may have been - // recorded from a prior thread pool with a different number of - // threads, hence we must cap at num_threads_. + + // Update the preferred worker for par_idx to be the calling thread + + void UpdatePreferredWorker(std::vector& preferred_workers, + unsigned par_idx) { + unsigned ran_on_idx = GetPerThread()->thread_id; + assert(ran_on_idx < num_threads_); assert(par_idx < preferred_workers.size()); - unsigned q_idx = preferred_workers[par_idx] % num_threads_; - assert(q_idx < num_threads_); - WorkerData& td = worker_data_[q_idx]; - Queue& q = td.queue; - unsigned w_idx; + preferred_workers[par_idx] = ran_on_idx; + } - // Attempt to enqueue the task - auto push_status = q.PushBackWithTag([worker_fn, par_idx, &preferred_workers, &ps, this]() { + // Schedule [par_idx_start,par_idx_end) across the preferred workers + + void ScheduleOnPreferredWorkers(PerThread& pt, + ThreadPoolParallelSection& ps, + std::vector& preferred_workers, + unsigned par_idx_start, + unsigned par_idx_end, + std::function worker_fn) { + for (auto par_idx = par_idx_start; par_idx < par_idx_end; ++par_idx) { + // Look up hint for par_idx. Note that the hints may have been + // recorded from a prior thread pool with a different number of + // threads, hence we must cap at num_threads_. + assert(par_idx < preferred_workers.size()); + unsigned q_idx = preferred_workers[par_idx] % num_threads_; + assert(q_idx < num_threads_); + WorkerData& td = worker_data_[q_idx]; + Queue& q = td.queue; + unsigned w_idx; + + // Attempt to enqueue the task + auto push_status = q.PushBackWithTag([worker_fn, par_idx, &preferred_workers, &ps, this]() { // Record the worker thread that actually runs this task. // This will form the preferred worker for the next loop. UpdatePreferredWorker(preferred_workers, par_idx); worker_fn(par_idx); ps.tasks_finished++; }, - pt.tag, - w_idx); - - // Queue accepted the task; wake the thread that owns the queue. - // In addition, if the queue was non-empty, attempt to wake - // another thread (which may then steal the task). - if (push_status == PushResult::ACCEPTED_IDLE || push_status == PushResult::ACCEPTED_BUSY) { - ps.tasks.push_back({q_idx, w_idx}); - td.EnsureAwake(); - if (push_status == PushResult::ACCEPTED_BUSY) { - worker_data_[Rand(&pt.rand) % num_threads_].EnsureAwake(); - } - } - } -} + pt.tag, w_idx); -//...................................................................... -// -// Parallel loops -// -------------- -// -// Ensure that the ThreadPoolParallelSection has sufficient workers to -// execute a loop with degree of parallelism n. We track the number -// of workers already avaiable to the parallel section, prior to -// submitting tasks to the work queues to make up the total. -// -// Each worker will call in to worker_fn(idx) with a per-worker thread -// ID. Note there are different levels of indirection here: -// -// - In a single-loop parallel section, worker_fn will directly -// execute the threadpool.cc code that implements the parallel loop. -// -// - In a multi-loop parallel section, worker_fn is an intermediate -// function that is long-lived (i.e., that lasts until the end of -// the parallel section, as opposed to just a single loop's -// duration). -// -// For ordinary parallel sections, RunInParallelInternal dispatch -// tasks to a number of workers asynchronously. A worker thread will -// be selected as the dispatcher that distributes tasks. This removes -// the O(n) work off the critical path of starting the first loop -// iteration, helping maintain good performance on very short loops. -// -// See the note on terminology above for the use of variable names -// here. - -void RunInParallelInternal(PerThread& pt, - ThreadPoolParallelSection& ps, - unsigned new_dop, - bool dispatch_async, - std::function worker_fn) { - - // Ensure that the vector of preferred workers is sufficient for the - // size of the loop we are entering. We do this before dispatching - // tasks for the loop in order to avoid any races between changes to - // the size of the vector and recording the locations that tasks run - // in as they complete. - assert(new_dop <= (unsigned)(num_threads_+1)); - std::vector &preferred_workers = pt.preferred_workers; - InitializePreferredWorkers(preferred_workers); - - // current_dop is the degree of parallelism via any workers already - // participating in the current parallel section. Usually, for - // single-loop parallel sections, current_dop=1. - unsigned current_dop = ps.current_dop; - - if (current_dop < new_dop) { - unsigned extra_needed = new_dop - current_dop; - - // Attempt to summon additional workers asynchronously if we - // need more than one. Otherwise, we fall back to simple - // synchronous scheduling. - if (dispatch_async && extra_needed > 1) { - assert(current_dop == 1); - - // Task for dispatching work asynchronously. - Task dispatch_task = [current_dop, new_dop, worker_fn, &preferred_workers, &ps, &pt, this]() { - // Record that dispatch work has started. This must occur - // prior to scheduling tasks, in order to synchronize with - // EndParallelSectionInternal. [ If EndParallelSection - // revoked a task, and then sees distpatch_started=false, then - // it knows that it revoked the dispatcher. Conversely, if it - // revokes a task, and then sees dispatch_started=true, then - // it knows it revoked a worker task. ] - ps.dispatch_started.store(true, std::memory_order_seq_cst); - - // Schedule tasks par_idx=[current_dop+1,new_dop) - ScheduleOnPreferredWorkers(pt, ps, preferred_workers, current_dop+1, new_dop, worker_fn); - ps.dispatch_done.store(true, std::memory_order_release); - - // Record the worker thread that actually runs this task. - // This will form the preferred worker for the next loop. - UpdatePreferredWorker(preferred_workers, current_dop); - - // Run dispatcher task's own work, par_idx=current_dop - worker_fn(current_dop); - - // Dispatcher's work complete - ps.work_done.store(true, std::memory_order_release); - }; - - profiler_.LogStart(); - ps.dispatch_q_idx = preferred_workers[current_dop] % num_threads_; - WorkerData& dispatch_td = worker_data_[ps.dispatch_q_idx]; - Queue& dispatch_que = dispatch_td.queue; - - // assign dispatch task to selected dispatcher - auto push_status = dispatch_que.PushBackWithTag(dispatch_task, pt.tag, ps.dispatch_w_idx); // Queue accepted the task; wake the thread that owns the queue. // In addition, if the queue was non-empty, attempt to wake // another thread (which may then steal the task). if (push_status == PushResult::ACCEPTED_IDLE || push_status == PushResult::ACCEPTED_BUSY) { - dispatch_td.EnsureAwake(); + ps.tasks.push_back({q_idx, w_idx}); + td.EnsureAwake(); if (push_status == PushResult::ACCEPTED_BUSY) { worker_data_[Rand(&pt.rand) % num_threads_].EnsureAwake(); } - } else { - ps.dispatch_q_idx = -1; // failed to enqueue dispatch_task } - profiler_.LogEnd(ThreadPoolProfiler::DISTRIBUTION_ENQUEUE); - } else { - // Synchronous dispatch - ScheduleOnPreferredWorkers(pt, ps, preferred_workers, current_dop, new_dop, std::move(worker_fn)); } - ps.current_dop = new_dop; } -} - -// Run a single parallel loop in an existing parallel section. This -// maps directly onto SummonWorkers to create sufficient worker -// threads for the desired degree of parallelism, followed by -// dispatching the loop to those workers. -void RunInParallelSection(ThreadPoolParallelSection &ps, - std::function fn, - unsigned n, - std::ptrdiff_t block_size) override { - ORT_ENFORCE(n <= num_threads_+1, "More work items than threads"); - profiler_.LogStartAndCoreAndBlock(block_size); - PerThread* pt = GetPerThread(); - assert(pt->leading_par_section && "RunInParallel, but not in parallel section"); - assert((n > 1) && "Trivial parallel section; should be avoided by caller"); - - // Publish the work to any existing workers in the parallel - // section, and ensure it is visible to any new threads created - // below. - assert((!ps.current_loop) && "RunInParallelSection, but loop already active"); - ThreadPoolLoop loop{std::move(fn), n}; - ps.current_loop = &loop; - - // Increase the worker count if needed. Each worker will pick up - // loops to execute from the current parallel section. - std::function worker_fn = [&ps](unsigned par_idx) { - while (ps.active) { - if (ps.current_loop.load() == nullptr) { - onnxruntime::concurrency::SpinPause(); + + //...................................................................... + // + // Parallel loops + // -------------- + // + // Ensure that the ThreadPoolParallelSection has sufficient workers to + // execute a loop with degree of parallelism n. We track the number + // of workers already avaiable to the parallel section, prior to + // submitting tasks to the work queues to make up the total. + // + // Each worker will call in to worker_fn(idx) with a per-worker thread + // ID. Note there are different levels of indirection here: + // + // - In a single-loop parallel section, worker_fn will directly + // execute the threadpool.cc code that implements the parallel loop. + // + // - In a multi-loop parallel section, worker_fn is an intermediate + // function that is long-lived (i.e., that lasts until the end of + // the parallel section, as opposed to just a single loop's + // duration). + // + // For ordinary parallel sections, RunInParallelInternal dispatch + // tasks to a number of workers asynchronously. A worker thread will + // be selected as the dispatcher that distributes tasks. This removes + // the O(n) work off the critical path of starting the first loop + // iteration, helping maintain good performance on very short loops. + // + // See the note on terminology above for the use of variable names + // here. + + void RunInParallelInternal(PerThread& pt, + ThreadPoolParallelSection& ps, + unsigned new_dop, + bool dispatch_async, + std::function worker_fn) { + // Ensure that the vector of preferred workers is sufficient for the + // size of the loop we are entering. We do this before dispatching + // tasks for the loop in order to avoid any races between changes to + // the size of the vector and recording the locations that tasks run + // in as they complete. + assert(new_dop <= (unsigned)(num_threads_ + 1)); + std::vector& preferred_workers = pt.preferred_workers; + InitializePreferredWorkers(preferred_workers); + + // current_dop is the degree of parallelism via any workers already + // participating in the current parallel section. Usually, for + // single-loop parallel sections, current_dop=1. + unsigned current_dop = ps.current_dop; + + if (current_dop < new_dop) { + unsigned extra_needed = new_dop - current_dop; + + // Attempt to summon additional workers asynchronously if we + // need more than one. Otherwise, we fall back to simple + // synchronous scheduling. + if (dispatch_async && extra_needed > 1) { + assert(current_dop == 1); + + // Task for dispatching work asynchronously. + Task dispatch_task = [current_dop, new_dop, worker_fn, &preferred_workers, &ps, &pt, this]() { + // Record that dispatch work has started. This must occur + // prior to scheduling tasks, in order to synchronize with + // EndParallelSectionInternal. [ If EndParallelSection + // revoked a task, and then sees distpatch_started=false, then + // it knows that it revoked the dispatcher. Conversely, if it + // revokes a task, and then sees dispatch_started=true, then + // it knows it revoked a worker task. ] + ps.dispatch_started.store(true, std::memory_order_seq_cst); + + // Schedule tasks par_idx=[current_dop+1,new_dop) + ScheduleOnPreferredWorkers(pt, ps, preferred_workers, current_dop + 1, new_dop, worker_fn); + ps.dispatch_done.store(true, std::memory_order_release); + + // Record the worker thread that actually runs this task. + // This will form the preferred worker for the next loop. + UpdatePreferredWorker(preferred_workers, current_dop); + + // Run dispatcher task's own work, par_idx=current_dop + worker_fn(current_dop); + + // Dispatcher's work complete + ps.work_done.store(true, std::memory_order_release); + }; + + profiler_.LogStart(); + ps.dispatch_q_idx = preferred_workers[current_dop] % num_threads_; + WorkerData& dispatch_td = worker_data_[ps.dispatch_q_idx]; + Queue& dispatch_que = dispatch_td.queue; + + // assign dispatch task to selected dispatcher + auto push_status = dispatch_que.PushBackWithTag(dispatch_task, pt.tag, ps.dispatch_w_idx); + // Queue accepted the task; wake the thread that owns the queue. + // In addition, if the queue was non-empty, attempt to wake + // another thread (which may then steal the task). + if (push_status == PushResult::ACCEPTED_IDLE || push_status == PushResult::ACCEPTED_BUSY) { + dispatch_td.EnsureAwake(); + if (push_status == PushResult::ACCEPTED_BUSY) { + worker_data_[Rand(&pt.rand) % num_threads_].EnsureAwake(); + } + } else { + ps.dispatch_q_idx = -1; // failed to enqueue dispatch_task + } + profiler_.LogEnd(ThreadPoolProfiler::DISTRIBUTION_ENQUEUE); } else { - ps.workers_in_loop++; - ThreadPoolLoop *work_item = ps.current_loop; - if (work_item && par_idx < work_item->threads_needed) { - work_item->fn(par_idx); + // Synchronous dispatch + ScheduleOnPreferredWorkers(pt, ps, preferred_workers, current_dop, new_dop, std::move(worker_fn)); + } + ps.current_dop = new_dop; + } + } + + // Run a single parallel loop in an existing parallel section. This + // maps directly onto SummonWorkers to create sufficient worker + // threads for the desired degree of parallelism, followed by + // dispatching the loop to those workers. + void RunInParallelSection(ThreadPoolParallelSection& ps, + std::function fn, + unsigned n, + std::ptrdiff_t block_size) override { + ORT_ENFORCE(n <= num_threads_ + 1, "More work items than threads"); + profiler_.LogStartAndCoreAndBlock(block_size); + PerThread* pt = GetPerThread(); + assert(pt->leading_par_section && "RunInParallel, but not in parallel section"); + assert((n > 1) && "Trivial parallel section; should be avoided by caller"); + + // Publish the work to any existing workers in the parallel + // section, and ensure it is visible to any new threads created + // below. + assert((!ps.current_loop) && "RunInParallelSection, but loop already active"); + ThreadPoolLoop loop{std::move(fn), n}; + ps.current_loop = &loop; + + // Increase the worker count if needed. Each worker will pick up + // loops to execute from the current parallel section. + std::function worker_fn = [&ps](unsigned par_idx) { + while (ps.active) { + if (ps.current_loop.load() == nullptr) { + onnxruntime::concurrency::SpinPause(); + } else { + ps.workers_in_loop++; + ThreadPoolLoop* work_item = ps.current_loop; + if (work_item && par_idx < work_item->threads_needed) { + work_item->fn(par_idx); + } + ps.workers_in_loop--; } - ps.workers_in_loop--; } + }; + RunInParallelInternal(*pt, ps, n, false, std::move(worker_fn)); + assert(ps.dispatch_q_idx == -1); + profiler_.LogEndAndStart(ThreadPoolProfiler::DISTRIBUTION); + + // Run work in the main thread + loop.fn(0); + profiler_.LogEndAndStart(ThreadPoolProfiler::RUN); + + // Wait for workers to exit the loop + ps.current_loop = 0; + while (ps.workers_in_loop) { + onnxruntime::concurrency::SpinPause(); } - }; - RunInParallelInternal(*pt, ps, n, false, std::move(worker_fn)); - assert(ps.dispatch_q_idx == -1); - profiler_.LogEndAndStart(ThreadPoolProfiler::DISTRIBUTION); - - // Run work in the main thread - loop.fn(0); - profiler_.LogEndAndStart(ThreadPoolProfiler::RUN); - - // Wait for workers to exit the loop - ps.current_loop = 0; - while (ps.workers_in_loop) { - onnxruntime::concurrency::SpinPause(); + profiler_.LogEnd(ThreadPoolProfiler::WAIT); + } + + // Run a single parallel loop _without_ a parallel section. This is a + // special case of RunInParallelSection, avoiding code paths for + // handing off multiple loops to the pool of workers. + // For main thread: + // 1. select a dispatcher and do job distribution; + // 2. run fn(0); + // 3, wait for all; + // For dispatcher: + // 1. distribute jobs to all other threads; + // 2. run fn(...) itself. + // For all other threads: + // 1. run fn(...); + void RunInParallel(std::function fn, unsigned n, std::ptrdiff_t block_size) override { + ORT_ENFORCE(n <= num_threads_ + 1, "More work items than threads"); + profiler_.LogStartAndCoreAndBlock(block_size); + PerThread* pt = GetPerThread(); + ThreadPoolParallelSection ps; + StartParallelSectionInternal(*pt, ps); + RunInParallelInternal(*pt, ps, n, true, fn); // select dispatcher and do job distribution; + profiler_.LogEndAndStart(ThreadPoolProfiler::DISTRIBUTION); + fn(0); // run fn(0) + profiler_.LogEndAndStart(ThreadPoolProfiler::RUN); + EndParallelSectionInternal(*pt, ps); // wait for all + profiler_.LogEnd(ThreadPoolProfiler::WAIT); + } + + int NumThreads() const final { + return num_threads_; + } + + int CurrentThreadId() const final { + const PerThread* pt = const_cast(this)->GetPerThread(); + if (pt->pool == this) { + return pt->thread_id; + } + return -1; + } + + void EnableSpinning() { + spin_loop_status_ = SpinLoopStatus::kBusy; } - profiler_.LogEnd(ThreadPoolProfiler::WAIT); -} - -// Run a single parallel loop _without_ a parallel section. This is a -// special case of RunInParallelSection, avoiding code paths for -// handing off multiple loops to the pool of workers. -// For main thread: -// 1. select a dispatcher and do job distribution; -// 2. run fn(0); -// 3, wait for all; -// For dispatcher: -// 1. distribute jobs to all other threads; -// 2. run fn(...) itself. -// For all other threads: -// 1. run fn(...); -void RunInParallel(std::function fn, unsigned n, std::ptrdiff_t block_size) override { - ORT_ENFORCE(n <= num_threads_+1, "More work items than threads"); - profiler_.LogStartAndCoreAndBlock(block_size); - PerThread* pt = GetPerThread(); - ThreadPoolParallelSection ps; - StartParallelSectionInternal(*pt, ps); - RunInParallelInternal(*pt, ps, n, true, fn); // select dispatcher and do job distribution; - profiler_.LogEndAndStart(ThreadPoolProfiler::DISTRIBUTION); - fn(0); // run fn(0) - profiler_.LogEndAndStart(ThreadPoolProfiler::RUN); - EndParallelSectionInternal(*pt, ps); // wait for all - profiler_.LogEnd(ThreadPoolProfiler::WAIT); -} - -int NumThreads() const final { - return num_threads_; -} - -int CurrentThreadId() const final { - const PerThread* pt = const_cast(this)->GetPerThread(); - if (pt->pool == this) { - return pt->thread_id; + + void DisableSpinning() { + spin_loop_status_ = SpinLoopStatus::kIdle; } - return -1; -} private: void ComputeCoprimes(int N, Eigen::MaxSizeVector* coprimes) { @@ -1392,6 +1395,7 @@ int CurrentThreadId() const final { assert(seen != ThreadStatus::Blocking); if (seen == ThreadStatus::Blocked) { status = ThreadStatus::Waking; + lk.unlock(); cv.notify_one(); } } @@ -1400,12 +1404,12 @@ int CurrentThreadId() const final { // State transitions, called only from the thread itself void SetActive() { - std::unique_lock lk(mutex); + std::lock_guard lk(mutex); status = ThreadStatus::Active; } void SetSpinning() { - std::unique_lock lk(mutex); + std::lock_guard lk(mutex); status = ThreadStatus::Spinning; } @@ -1424,7 +1428,7 @@ int CurrentThreadId() const final { status = ThreadStatus::Spinning; } - private: + private: std::atomic status{ThreadStatus::Spinning}; OrtMutex mutex; OrtCondVar cv; @@ -1439,13 +1443,25 @@ int CurrentThreadId() const final { std::atomic blocked_; // Count of blocked workers, used as a termination condition std::atomic done_; + // SpinLoopStatus indicates whether the main worker spinning (inner) loop should exit immediately when there is + // no work available (kIdle) or whether it should follow the configured spin-then-block policy (kBusy). + // This lets the ORT session layer hint to the thread pool that it should stop spinning in between + // requests. + enum class SpinLoopStatus { + kIdle, + kBusy + }; + + // Default is no control over spinning + std::atomic spin_loop_status_{SpinLoopStatus::kBusy}; + // Wake any blocked workers so that they can cleanly exit WorkerLoop(). For // a clean exit, each thread will observe (1) done_ set, indicating that the // destructor has been called, (2) all threads blocked, and (3) no // items in the work queues. void WakeAllWorkersForExit() { - for (auto &td: worker_data_) { + for (auto& td : worker_data_) { td.EnsureAwake(); } } @@ -1462,8 +1478,8 @@ int CurrentThreadId() const final { assert(td.GetStatus() == WorkerData::ThreadStatus::Spinning); constexpr int log2_spin = 20; - const int spin_count = allow_spinning_ ? (1ull< bool { - bool should_block = true; - // Check whether work was pushed to us while attempting to block. We make - // this test while holding the per-thread status lock, and after setting - // our status to ThreadStatus::Blocking. - // - // This synchronizes with ThreadPool::Schedule which pushes work to the queue - // and then tests for ThreadStatus::Blocking/Blocked (via EnsureAwake): - // - // Main thread: Worker: - // #1 Push work #A Set status blocking - // #2 Read worker status #B Check queue - // #3 Wake if blocking/blocked - // - // If #A is before #2 then main sees worker blocked and wakes - // - // If #A if after #2 then #B will see #1, and we abandon blocking - assert(!t); - t = q.PopFront(); - if (t) { - should_block = false; - } - - // No work pushed to us, continue attempting to block. The remaining - // test is to synchronize with termination requests. If we are - // shutting down and all worker threads blocked without work, that's - // we are done. - if (should_block) { - blocked_++; - if (done_ && blocked_ == num_threads_) { - should_block = false; - // Almost done, but need to re-check queues. - // Consider that all queues are empty and all worker threads are preempted - // right after incrementing blocked_ above. Now a free-standing thread - // submits work and calls destructor (which sets done_). If we don't - // re-check queues, we will exit leaving the work unexecuted. - if (NonEmptyQueueIndex() != -1) { - // Note: we must not pop from queues before we decrement blocked_, - // otherwise the following scenario is possible. Consider that instead - // of checking for emptiness we popped the only element from queues. - // Now other worker threads can start exiting, which is bad if the - // work item submits other work. So we just check emptiness here, - // which ensures that all worker threads exit at the same time. - blocked_--; - } else { - should_exit = true; - } - } - } - return should_block; - }, - // Post-block update (executed only if we blocked) - [&]() { - blocked_--; - }); + td.SetBlocked( // Pre-block test + [&]() -> bool { + bool should_block = true; + // Check whether work was pushed to us while attempting to block. We make + // this test while holding the per-thread status lock, and after setting + // our status to ThreadStatus::Blocking. + // + // This synchronizes with ThreadPool::Schedule which pushes work to the queue + // and then tests for ThreadStatus::Blocking/Blocked (via EnsureAwake): + // + // Main thread: Worker: + // #1 Push work #A Set status blocking + // #2 Read worker status #B Check queue + // #3 Wake if blocking/blocked + // + // If #A is before #2 then main sees worker blocked and wakes + // + // If #A if after #2 then #B will see #1, and we abandon blocking + assert(!t); + t = q.PopFront(); + if (t) { + should_block = false; + } + + // No work pushed to us, continue attempting to block. The remaining + // test is to synchronize with termination requests. If we are + // shutting down and all worker threads blocked without work, that's + // we are done. + if (should_block) { + blocked_++; + if (done_ && blocked_ == num_threads_) { + should_block = false; + // Almost done, but need to re-check queues. + // Consider that all queues are empty and all worker threads are preempted + // right after incrementing blocked_ above. Now a free-standing thread + // submits work and calls destructor (which sets done_). If we don't + // re-check queues, we will exit leaving the work unexecuted. + if (NonEmptyQueueIndex() != -1) { + // Note: we must not pop from queues before we decrement blocked_, + // otherwise the following scenario is possible. Consider that instead + // of checking for emptiness we popped the only element from queues. + // Now other worker threads can start exiting, which is bad if the + // work item submits other work. So we just check emptiness here, + // which ensures that all worker threads exit at the same time. + blocked_--; + } else { + should_exit = true; + } + } + } + return should_block; + }, + // Post-block update (executed only if we blocked) + [&]() { + blocked_--; + }); // Thread just unblocked. Unless we picked up work while // blocking, or are exiting, then either work was pushed to // us, or it was pushed to an overloaded queue @@ -1548,6 +1567,7 @@ int CurrentThreadId() const final { if (!t) t = Steal(StealAttemptKind::TRY_ALL); } } + if (t) { td.SetActive(); t(); @@ -1555,7 +1575,7 @@ int CurrentThreadId() const final { td.SetSpinning(); } } - + // Whichever thread(s) observe the termination conditions are responsible for waking // any other threads that have remained blocked. if (should_exit) { @@ -1577,7 +1597,7 @@ int CurrentThreadId() const final { unsigned r = Rand(&pt->rand); unsigned inc = all_coprimes_[size - 1][r % all_coprimes_[size - 1].size()]; unsigned victim = r % size; - + for (unsigned i = 0; i < num_attempts; i++) { assert(victim < size); if (worker_data_[victim].GetStatus() == WorkerData::ThreadStatus::Active) { @@ -1636,6 +1656,6 @@ int CurrentThreadId() const final { } }; - } // namespace concurrency +} // namespace concurrency } // namespace onnxruntime diff --git a/include/onnxruntime/core/platform/threadpool.h b/include/onnxruntime/core/platform/threadpool.h index 23f317f977517..10e8c1db5b380 100644 --- a/include/onnxruntime/core/platform/threadpool.h +++ b/include/onnxruntime/core/platform/threadpool.h @@ -221,6 +221,14 @@ class ThreadPool { "Per-thread state should be trivially destructible"); }; + // The below API allows to disable spinning + // This is used to support real-time scenarios where + // spinning between relatively infrequent requests + // contributes to high CPU usage while not processing anything. + void EnableSpinning(); + + void DisableSpinning(); + // Schedules fn() for execution in the pool of threads. The function may run // synchronously if it cannot be enqueued. This will occur if the thread pool's // degree-of-parallelism is 1, but it may also occur for implementation-dependent diff --git a/include/onnxruntime/core/session/experimental_onnxruntime_cxx_inline.h b/include/onnxruntime/core/session/experimental_onnxruntime_cxx_inline.h index 075de83ead0bd..e754d59832c39 100644 --- a/include/onnxruntime/core/session/experimental_onnxruntime_cxx_inline.h +++ b/include/onnxruntime/core/session/experimental_onnxruntime_cxx_inline.h @@ -35,9 +35,8 @@ inline std::vector Session::GetInputNames() const { size_t node_count = GetInputCount(); std::vector out(node_count); for (size_t i = 0; i < node_count; i++) { - char* tmp = GetInputName(i, allocator); - out[i] = tmp; - allocator.Free(tmp); // prevent memory leak + auto tmp = GetInputNameAllocated(i, allocator); + out[i] = tmp.get(); } return out; } @@ -47,9 +46,8 @@ inline std::vector Session::GetOutputNames() const { size_t node_count = GetOutputCount(); std::vector out(node_count); for (size_t i = 0; i < node_count; i++) { - char* tmp = GetOutputName(i, allocator); - out[i] = tmp; - allocator.Free(tmp); // prevent memory leak + auto tmp = GetOutputNameAllocated(i, allocator); + out[i] = tmp.get(); } return out; } @@ -59,9 +57,8 @@ inline std::vector Session::GetOverridableInitializerNames() const size_t init_count = GetOverridableInitializerCount(); std::vector out(init_count); for (size_t i = 0; i < init_count; i++) { - char* tmp = GetOverridableInitializerName(i, allocator); - out[i] = tmp; - allocator.Free(tmp); // prevent memory leak + auto tmp = GetOverridableInitializerNameAllocated(i, allocator); + out[i] = tmp.get(); } return out; } diff --git a/include/onnxruntime/core/session/onnxruntime_c_api.h b/include/onnxruntime/core/session/onnxruntime_c_api.h index ce8d83a18a33d..24697f4e714c1 100644 --- a/include/onnxruntime/core/session/onnxruntime_c_api.h +++ b/include/onnxruntime/core/session/onnxruntime_c_api.h @@ -3347,11 +3347,11 @@ struct OrtApi { /** \brief: Create attribute of onnxruntime operator * - * \param[in] name of the attribute - * \param[in] data of the attribute - * \param[in] data length - * \param[in] data type - * \param[out] attribute that has been created, which must be released by OrtApi::ReleaseOpAttr + * \param[in] name Name of the attribute + * \param[in] data Data content of the attribute + * \param[in] len Number of bytes stored in data + * \param[in] type Data type + * \param[out] op_attr Attribute that has been created, which must be released by OrtApi::ReleaseOpAttr * * \since Version 1.12. */ @@ -3364,7 +3364,7 @@ struct OrtApi { /* \brief: Release op attribute * - * \param[in] attribute created by OrtApi::CreateOpAttr + * \param[in] opAttr Attribute created by OrtApi::CreateOpAttr * * \since Version 1.12. */ @@ -3372,16 +3372,18 @@ struct OrtApi { /** \brief: Create onnxruntime native operator * - * \param[in] kernel info - * \param[in] operator name - * \param[in] operator domain - * \param[in] operator opset - * \param[in] name of the type contraints, such as "T" or "T1" - * \param[in] type of each contraints - * \param[in] number of contraints - * \param[in] attributes used to initialize the operator - * \param[in] number of the attributes - * \param[out] operator that has been created + * \param[in] info Kernel info + * \param[in] op_name Operator name + * \param[in] domain Operator domain + * \param[in] version Operator opset version + * \param[in] type_constraint_names Name of the type contraints, such as "T" or "T1" + * \param[in] type_constraint_values Type of each contraints + * \param[in] type_constraint_count Number of contraints + * \param[in] attr_values Attributes used to initialize the operator + * \param[in] attr_count Number of the attributes + * \param[in] input_count Number of inputs + * \param[in] output_count Number of outputs + * \param[out] ort_op Operator that has been created * * \since Version 1.12. */ @@ -3395,17 +3397,19 @@ struct OrtApi { _In_opt_ int type_constraint_count, _In_opt_ const OrtOpAttr* const* attr_values, _In_opt_ int attr_count, + _In_ int input_count, + _In_ int output_count, _Outptr_ OrtOp** ort_op); /** \brief: Invoke the operator created by OrtApi::CreateOp * The inputs must follow the order as specified in onnx specification * - * \param[in] kernel context - * \param[in] operator that has been created - * \param[in] inputs - * \param[in] number of inputs - * \param[in] outputs - * \param[in] number of outputs + * \param[in] context Kernel context + * \param[in] ort_op Operator that has been created + * \param[in] input_values Array of inputs + * \param[in] input_count Number of inputs + * \param[in] output_values Array of outputs + * \param[in] output_count Number of outputs * * \since Version 1.12. */ @@ -3419,7 +3423,7 @@ struct OrtApi { /* \brief: Release an onnxruntime operator * - * \param[in] operator created by OrtApi::CreateOp + * \param[in] Op Operator created by OrtApi::CreateOp * * \since Version 1.12. */ @@ -3463,6 +3467,25 @@ struct OrtApi { _In_reads_(num_keys) const char* const* provider_options_keys, _In_reads_(num_keys) const char* const* provider_options_values, _In_ size_t num_keys); + + /* \brief: Get a copy of kernel info + * + * \param[in] info Kernel info + * \param[out] info_copy Copy of kernel info + * + * \since Version 1.12. + */ + ORT_API2_STATUS(CopyKernelInfo, + _In_ const OrtKernelInfo* info, + _Outptr_ OrtKernelInfo** info_copy); + + /* \brief: Release kernel info + * + * \param[in] KernelInfo A copy of kernel info returned by CopyKernelInfo + * + * \since Version 1.12. + */ + ORT_CLASS_RELEASE(KernelInfo); }; /* diff --git a/include/onnxruntime/core/session/onnxruntime_cxx_api.h b/include/onnxruntime/core/session/onnxruntime_cxx_api.h index 4dedec707d627..90659f06c568d 100644 --- a/include/onnxruntime/core/session/onnxruntime_cxx_api.h +++ b/include/onnxruntime/core/session/onnxruntime_cxx_api.h @@ -250,6 +250,22 @@ struct TypeInfo; struct Value; struct ModelMetadata; +namespace detail { +// Light functor to release memory with OrtAllocator +struct AllocatedFree { + OrtAllocator* allocator_; + explicit AllocatedFree(OrtAllocator* allocator) + : allocator_(allocator) {} + void operator()(void* ptr) const { if(ptr) allocator_->Free(allocator_, ptr); } +}; +} // namespace detail + +/** \brief unique_ptr typedef used to own strings allocated by OrtAllocators + * and release them at the end of the scope. The lifespan of the given allocator + * must eclipse the lifespan of AllocatedStringPtr instance + */ +using AllocatedStringPtr = std::unique_ptr; + /** \brief The Env (Environment) * * The Env holds the logging state used by all other objects. @@ -385,13 +401,108 @@ struct ModelMetadata : Base { explicit ModelMetadata(std::nullptr_t) {} ///< Create an empty ModelMetadata object, must be assigned a valid one to be used explicit ModelMetadata(OrtModelMetadata* p) : Base{p} {} ///< Used for interop with the C API - char* GetProducerName(OrtAllocator* allocator) const; ///< Wraps OrtApi::ModelMetadataGetProducerName - char* GetGraphName(OrtAllocator* allocator) const; ///< Wraps OrtApi::ModelMetadataGetGraphName - char* GetDomain(OrtAllocator* allocator) const; ///< Wraps OrtApi::ModelMetadataGetDomain + /** \deprecated use GetProducerNameAllocated() + * [[deprecated]] + * This interface produces a pointer that must be released + * by the specified allocator and is often leaked. Not exception safe. + */ + char* GetProducerName(OrtAllocator* allocator) const; ///< Wraps OrtApi::ModelMetadataGetProducerName + + /** \brief Returns a copy of the producer name. + * + * \param allocator to allocate memory for the copy of the name returned + * \return a instance of smart pointer that would deallocate the buffer when out of scope. + * The OrtAllocator instances must be valid at the point of memory release. + */ + AllocatedStringPtr GetProducerNameAllocated(OrtAllocator* allocator) const; ///< Wraps OrtApi::ModelMetadataGetProducerName + + /** \deprecated use GetGraphNameAllocated() + * [[deprecated]] + * This interface produces a pointer that must be released + * by the specified allocator and is often leaked. Not exception safe. + */ + char* GetGraphName(OrtAllocator* allocator) const; ///< Wraps OrtApi::ModelMetadataGetGraphName + + /** \brief Returns a copy of the graph name. + * + * \param allocator to allocate memory for the copy of the name returned + * \return a instance of smart pointer that would deallocate the buffer when out of scope. + * The OrtAllocator instances must be valid at the point of memory release. + */ + AllocatedStringPtr GetGraphNameAllocated(OrtAllocator* allocator) const; ///< Wraps OrtApi::ModelMetadataGetGraphName + + /** \deprecated use GetDomainAllocated() + * [[deprecated]] + * This interface produces a pointer that must be released + * by the specified allocator and is often leaked. Not exception safe. + */ + char* GetDomain(OrtAllocator* allocator) const; ///< Wraps OrtApi::ModelMetadataGetDomain + + /** \brief Returns a copy of the domain name. + * + * \param allocator to allocate memory for the copy of the name returned + * \return a instance of smart pointer that would deallocate the buffer when out of scope. + * The OrtAllocator instances must be valid at the point of memory release. + */ + AllocatedStringPtr GetDomainAllocated(OrtAllocator* allocator) const; ///< Wraps OrtApi::ModelMetadataGetDomain + + /** \deprecated use GetDescriptionAllocated() + * [[deprecated]] + * This interface produces a pointer that must be released + * by the specified allocator and is often leaked. Not exception safe. + */ char* GetDescription(OrtAllocator* allocator) const; ///< Wraps OrtApi::ModelMetadataGetDescription + + /** \brief Returns a copy of the description. + * + * \param allocator to allocate memory for the copy of the string returned + * \return a instance of smart pointer that would deallocate the buffer when out of scope. + * The OrtAllocator instances must be valid at the point of memory release. + */ + AllocatedStringPtr GetDescriptionAllocated(OrtAllocator* allocator) const; ///< Wraps OrtApi::ModelMetadataGetDescription + + /** \deprecated use GetGraphDescriptionAllocated() + * [[deprecated]] + * This interface produces a pointer that must be released + * by the specified allocator and is often leaked. Not exception safe. + */ char* GetGraphDescription(OrtAllocator* allocator) const; ///< Wraps OrtApi::ModelMetadataGetGraphDescription + + /** \brief Returns a copy of the graph description. + * + * \param allocator to allocate memory for the copy of the string returned + * \return a instance of smart pointer that would deallocate the buffer when out of scope. + * The OrtAllocator instances must be valid at the point of memory release. + */ + AllocatedStringPtr GetGraphDescriptionAllocated(OrtAllocator* allocator) const; ///< Wraps OrtApi::ModelMetadataGetGraphDescription + + /** \deprecated use GetCustomMetadataMapKeysAllocated() + * [[deprecated]] + * This interface produces multiple pointers that must be released + * by the specified allocator and is often leaked. Not exception safe. + */ char** GetCustomMetadataMapKeys(OrtAllocator* allocator, _Out_ int64_t& num_keys) const; ///< Wraps OrtApi::ModelMetadataGetCustomMetadataMapKeys + + std::vector GetCustomMetadataMapKeysAllocated(OrtAllocator* allocator) const; ///< Wraps OrtApi::ModelMetadataGetCustomMetadataMapKeys + + /** \deprecated use LookupCustomMetadataMapAllocated() + * [[deprecated]] + * This interface produces a pointer that must be released + * by the specified allocator and is often leaked. Not exception safe. + */ char* LookupCustomMetadataMap(const char* key, OrtAllocator* allocator) const; ///< Wraps OrtApi::ModelMetadataLookupCustomMetadataMap + + /** \brief Looks up a value by a key in the Custom Metadata map + * + * \param zero terminated string key to lookup + * \param allocator to allocate memory for the copy of the string returned + * \return a instance of smart pointer that would deallocate the buffer when out of scope. + * maybe nullptr if key is not found. + * + * The OrtAllocator instances must be valid at the point of memory release. + */ + AllocatedStringPtr LookupCustomMetadataMapAllocated(const char* key, OrtAllocator* allocator) const; ///< Wraps OrtApi::ModelMetadataLookupCustomMetadataMap + int64_t GetVersion() const; ///< Wraps OrtApi::ModelMetadataGetVersion }; @@ -436,12 +547,70 @@ struct Session : Base { size_t GetOutputCount() const; ///< Returns the number of model outputs size_t GetOverridableInitializerCount() const; ///< Returns the number of inputs that have defaults that can be overridden - char* GetInputName(size_t index, OrtAllocator* allocator) const; ///< Wraps OrtApi::SessionGetInputName - char* GetOutputName(size_t index, OrtAllocator* allocator) const; ///< Wraps OrtApi::SessionGetOutputName + /** \deprecated use GetInputNameAllocated() + * [[deprecated]] + * This interface produces a pointer that must be released + * by the specified allocator and is often leaked. Not exception safe. + */ + char* GetInputName(size_t index, OrtAllocator* allocator) const; ///< Wraps OrtApi::SessionGetInputName + + /** \brief Returns a copy of input name at the specified index. + * + * \param index must less than the value returned by GetInputCount() + * \param allocator to allocate memory for the copy of the name returned + * \return a instance of smart pointer that would deallocate the buffer when out of scope. + * The OrtAllocator instances must be valid at the point of memory release. + */ + AllocatedStringPtr GetInputNameAllocated(size_t index, OrtAllocator* allocator) const; + + /** \deprecated use GetOutputNameAllocated() + * [[deprecated]] + * This interface produces a pointer that must be released + * by the specified allocator and is often leaked. Not exception safe. + */ + char* GetOutputName(size_t index, OrtAllocator* allocator) const; ///< Wraps OrtApi::SessionGetOutputName + + /** \brief Returns a copy of output name at then specified index. + * + * \param index must less than the value returned by GetOutputCount() + * \param allocator to allocate memory for the copy of the name returned + * \return a instance of smart pointer that would deallocate the buffer when out of scope. + * The OrtAllocator instances must be valid at the point of memory release. + */ + AllocatedStringPtr GetOutputNameAllocated(size_t index, OrtAllocator* allocator) const; + + /** \deprecated use GetOverridableInitializerNameAllocated() + * [[deprecated]] + * This interface produces a pointer that must be released + * by the specified allocator and is often leaked. Not exception safe. + */ char* GetOverridableInitializerName(size_t index, OrtAllocator* allocator) const; ///< Wraps OrtApi::SessionGetOverridableInitializerName - char* EndProfiling(OrtAllocator* allocator) const; ///< Wraps OrtApi::SessionEndProfiling - uint64_t GetProfilingStartTimeNs() const; ///< Wraps OrtApi::SessionGetProfilingStartTimeNs - ModelMetadata GetModelMetadata() const; ///< Wraps OrtApi::SessionGetModelMetadata + + /** \brief Returns a copy of the overridable initializer name at then specified index. + * + * \param index must less than the value returned by GetOverridableInitializerCount() + * \param allocator to allocate memory for the copy of the name returned + * \return a instance of smart pointer that would deallocate the buffer when out of scope. + * The OrtAllocator instances must be valid at the point of memory release. + */ + AllocatedStringPtr GetOverridableInitializerNameAllocated(size_t index, OrtAllocator* allocator) const; ///< Wraps OrtApi::SessionGetOverridableInitializerName + + /** \deprecated use EndProfilingAllocated() + * [[deprecated]] + * This interface produces a pointer that must be released + * by the specified allocator and is often leaked. Not exception safe. + */ + char* EndProfiling(OrtAllocator* allocator) const; ///< Wraps OrtApi::SessionEndProfiling + + /** \brief Returns a copy of the profiling file name. + * + * \param allocator to allocate memory for the copy of the string returned + * \return a instance of smart pointer that would deallocate the buffer when out of scope. + * The OrtAllocator instances must be valid at the point of memory release. + */ + AllocatedStringPtr EndProfilingAllocated(OrtAllocator* allocator) const; ///< Wraps OrtApi::SessionEndProfiling + uint64_t GetProfilingStartTimeNs() const; ///< Wraps OrtApi::SessionGetProfilingStartTimeNs + ModelMetadata GetModelMetadata() const; ///< Wraps OrtApi::SessionGetModelMetadata TypeInfo GetInputTypeInfo(size_t index) const; ///< Wraps OrtApi::SessionGetInputTypeInfo TypeInfo GetOutputTypeInfo(size_t index) const; ///< Wraps OrtApi::SessionGetOutputTypeInfo @@ -977,24 +1146,24 @@ struct CustomOpApi { void ThrowOnError(OrtStatus* result); - void CreateOpAttr(_In_ const char* name, - _In_ const void* data, - _In_ int len, - _In_ OrtOpAttrType type, - _Outptr_ OrtOpAttr** op_attr); + OrtOpAttr* CreateOpAttr(_In_ const char* name, + _In_ const void* data, + _In_ int len, + _In_ OrtOpAttrType type); void ReleaseOpAttr(_Frees_ptr_opt_ OrtOpAttr* op_attr); - void CreateOp(_In_ const OrtKernelInfo* info, - _In_ const char* op_name, - _In_ const char* domain, - int version, - _In_opt_ const char** type_constraint_names, - _In_opt_ const ONNXTensorElementDataType* type_constraint_values, - int type_constraint_count, - _In_opt_ const OrtOpAttr* const* attr_values, - int attr_count, - _Outptr_ OrtOp** ort_op); + OrtOp* CreateOp(_In_ const OrtKernelInfo* info, + _In_ const char* op_name, + _In_ const char* domain, + _In_ int version, + _In_opt_ const char** type_constraint_names, + _In_opt_ const ONNXTensorElementDataType* type_constraint_values, + _In_opt_ int type_constraint_count, + _In_opt_ const OrtOpAttr* const* attr_values, + _In_opt_ int attr_count, + _In_ int input_count, + _In_ int output_count); void InvokeOp(_In_ const OrtKernelContext* context, _In_ const OrtOp* ort_op, @@ -1005,6 +1174,10 @@ struct CustomOpApi { void ReleaseOp(_Frees_ptr_opt_ OrtOp* ort_op); + OrtKernelInfo* CopyKernelInfo(_In_ const OrtKernelInfo* info); + + void ReleaseKernelInfo(_Frees_ptr_opt_ OrtKernelInfo* info_copy); + private: const OrtApi& api_; }; diff --git a/include/onnxruntime/core/session/onnxruntime_cxx_inline.h b/include/onnxruntime/core/session/onnxruntime_cxx_inline.h index 4d4ab50bc89d9..9a572fa8d64a3 100644 --- a/include/onnxruntime/core/session/onnxruntime_cxx_inline.h +++ b/include/onnxruntime/core/session/onnxruntime_cxx_inline.h @@ -200,7 +200,7 @@ inline void IoBinding::BindOutput(const char* name, const MemoryInfo& mem_info) inline std::vector IoBinding::GetOutputNamesHelper(OrtAllocator* allocator) const { std::vector result; - auto free_fn = [allocator](void* p) { if (p) allocator->Free(allocator, p); }; + auto free_fn = detail::AllocatedFree(allocator); using Ptr = std::unique_ptr; char* buffer = nullptr; @@ -656,18 +656,42 @@ inline char* Session::GetOutputName(size_t index, OrtAllocator* allocator) const return out; } +inline AllocatedStringPtr Session::GetInputNameAllocated(size_t index, OrtAllocator* allocator) const { + char* out; + ThrowOnError(GetApi().SessionGetInputName(p_, index, allocator, &out)); + return AllocatedStringPtr(out, detail::AllocatedFree(allocator)); +} + +inline AllocatedStringPtr Session::GetOutputNameAllocated(size_t index, OrtAllocator* allocator) const { + char* out; + ThrowOnError(GetApi().SessionGetOutputName(p_, index, allocator, &out)); + return AllocatedStringPtr(out, detail::AllocatedFree(allocator)); +} + inline char* Session::GetOverridableInitializerName(size_t index, OrtAllocator* allocator) const { char* out; ThrowOnError(GetApi().SessionGetOverridableInitializerName(p_, index, allocator, &out)); return out; } +inline AllocatedStringPtr Session::GetOverridableInitializerNameAllocated(size_t index, OrtAllocator* allocator) const { + char* out; + ThrowOnError(GetApi().SessionGetOverridableInitializerName(p_, index, allocator, &out)); + return AllocatedStringPtr(out, detail::AllocatedFree(allocator)); +} + inline char* Session::EndProfiling(OrtAllocator* allocator) const { char* out; ThrowOnError(GetApi().SessionEndProfiling(p_, allocator, &out)); return out; } +inline AllocatedStringPtr Session::EndProfilingAllocated(OrtAllocator* allocator) const { + char* out; + ThrowOnError(GetApi().SessionEndProfiling(p_, allocator, &out)); + return AllocatedStringPtr(out, detail::AllocatedFree(allocator)); +} + inline uint64_t Session::GetProfilingStartTimeNs() const { uint64_t out; ThrowOnError(GetApi().SessionGetProfilingStartTimeNs(p_, &out)); @@ -686,42 +710,103 @@ inline char* ModelMetadata::GetProducerName(OrtAllocator* allocator) const { return out; } +inline AllocatedStringPtr ModelMetadata::GetProducerNameAllocated(OrtAllocator* allocator) const { + char* out; + ThrowOnError(GetApi().ModelMetadataGetProducerName(p_, allocator, &out)); + return AllocatedStringPtr(out, detail::AllocatedFree(allocator)); +} + inline char* ModelMetadata::GetGraphName(OrtAllocator* allocator) const { char* out; ThrowOnError(GetApi().ModelMetadataGetGraphName(p_, allocator, &out)); return out; } +inline AllocatedStringPtr ModelMetadata::GetGraphNameAllocated(OrtAllocator* allocator) const { + char* out; + ThrowOnError(GetApi().ModelMetadataGetGraphName(p_, allocator, &out)); + return AllocatedStringPtr(out, detail::AllocatedFree(allocator)); +} + inline char* ModelMetadata::GetDomain(OrtAllocator* allocator) const { char* out; ThrowOnError(GetApi().ModelMetadataGetDomain(p_, allocator, &out)); return out; } +inline AllocatedStringPtr ModelMetadata::GetDomainAllocated(OrtAllocator* allocator) const { + char* out; + ThrowOnError(GetApi().ModelMetadataGetDomain(p_, allocator, &out)); + return AllocatedStringPtr(out, detail::AllocatedFree(allocator)); +} + inline char* ModelMetadata::GetDescription(OrtAllocator* allocator) const { char* out; ThrowOnError(GetApi().ModelMetadataGetDescription(p_, allocator, &out)); return out; } +inline AllocatedStringPtr Ort::ModelMetadata::GetDescriptionAllocated(OrtAllocator* allocator) const { + char* out; + ThrowOnError(GetApi().ModelMetadataGetDescription(p_, allocator, &out)); + return AllocatedStringPtr(out, detail::AllocatedFree(allocator)); +} + inline char* ModelMetadata::GetGraphDescription(OrtAllocator* allocator) const { char* out; ThrowOnError(GetApi().ModelMetadataGetGraphDescription(p_, allocator, &out)); return out; } +inline AllocatedStringPtr ModelMetadata::GetGraphDescriptionAllocated(OrtAllocator* allocator) const { + char* out; + ThrowOnError(GetApi().ModelMetadataGetGraphDescription(p_, allocator, &out)); + return AllocatedStringPtr(out, detail::AllocatedFree(allocator)); +} + inline char* ModelMetadata::LookupCustomMetadataMap(const char* key, OrtAllocator* allocator) const { char* out; ThrowOnError(GetApi().ModelMetadataLookupCustomMetadataMap(p_, allocator, key, &out)); return out; } +inline AllocatedStringPtr ModelMetadata::LookupCustomMetadataMapAllocated(const char* key, OrtAllocator* allocator) const { + char* out; + ThrowOnError(GetApi().ModelMetadataLookupCustomMetadataMap(p_, allocator, key, &out)); + return AllocatedStringPtr(out, detail::AllocatedFree(allocator)); +} + inline char** ModelMetadata::GetCustomMetadataMapKeys(OrtAllocator* allocator, _Out_ int64_t& num_keys) const { char** out; ThrowOnError(GetApi().ModelMetadataGetCustomMetadataMapKeys(p_, allocator, &out, &num_keys)); return out; } +inline std::vector ModelMetadata::GetCustomMetadataMapKeysAllocated(OrtAllocator* allocator) const { + auto deletor = detail::AllocatedFree(allocator); + std::vector result; + + char** out = nullptr; + int64_t num_keys = 0; + ThrowOnError(GetApi().ModelMetadataGetCustomMetadataMapKeys(p_, allocator, &out, &num_keys)); + if (num_keys <= 0) { + return result; + } + + // array of pointers will be freed + std::unique_ptr array_guard(out, deletor); + // reserve may throw + auto strings_deletor = [&deletor, num_keys](char** out) { for(int64_t i = 0; i < num_keys; ++i) deletor(out[i]); }; + std::unique_ptr strings_guard(out, strings_deletor); + result.reserve(static_cast(num_keys)); + strings_guard.release(); + for (int64_t i = 0; i < num_keys; ++i) { + result.push_back(AllocatedStringPtr(out[i], deletor)); + } + + return result; +} + inline int64_t ModelMetadata::GetVersion() const { int64_t out; ThrowOnError(GetApi().ModelMetadataGetVersion(p_, &out)); @@ -1227,29 +1312,34 @@ inline void* CustomOpApi::KernelContext_GetGPUComputeStream(const OrtKernelConte return out; } -inline void CustomOpApi::CreateOpAttr(_In_ const char* name, - _In_ const void* data, - _In_ int len, - _In_ OrtOpAttrType type, - _Outptr_ OrtOpAttr** op_attr) { - ThrowOnError(api_.CreateOpAttr(name, data, len, type, op_attr)); +inline OrtOpAttr* CustomOpApi::CreateOpAttr(_In_ const char* name, + _In_ const void* data, + _In_ int len, + _In_ OrtOpAttrType type) { + OrtOpAttr* op_attr{}; + ThrowOnError(api_.CreateOpAttr(name, data, len, type, &op_attr)); + return op_attr; } inline void CustomOpApi::ReleaseOpAttr(_Frees_ptr_opt_ OrtOpAttr* op_attr) { api_.ReleaseOpAttr(op_attr); } -inline void CustomOpApi::CreateOp(_In_ const OrtKernelInfo* info, - _In_ const char* op_name, - _In_ const char* domain, - int version, - _In_opt_ const char** type_constraint_names, - _In_opt_ const ONNXTensorElementDataType* type_constraint_values, - int type_constraint_count, - _In_opt_ const OrtOpAttr* const* attr_values, - int attr_count, - _Outptr_ OrtOp** ort_op) { - ThrowOnError(api_.CreateOp(info, op_name, domain, version, type_constraint_names, type_constraint_values, type_constraint_count, attr_values, attr_count, ort_op)); +inline OrtOp* CustomOpApi::CreateOp(_In_ const OrtKernelInfo* info, + _In_ const char* op_name, + _In_ const char* domain, + _In_ int version, + _In_opt_ const char** type_constraint_names, + _In_opt_ const ONNXTensorElementDataType* type_constraint_values, + _In_opt_ int type_constraint_count, + _In_opt_ const OrtOpAttr* const* attr_values, + _In_opt_ int attr_count, + _In_ int input_count, + _In_ int output_count) { + OrtOp* ort_op{}; + ThrowOnError(api_.CreateOp(info, op_name, domain, version, type_constraint_names, type_constraint_values, + type_constraint_count, attr_values, attr_count, input_count, output_count, &ort_op)); + return ort_op; } inline void CustomOpApi::InvokeOp(_In_ const OrtKernelContext* context, @@ -1265,6 +1355,16 @@ inline void CustomOpApi::ReleaseOp(_Frees_ptr_opt_ OrtOp* ort_op) { api_.ReleaseOp(ort_op); } +inline OrtKernelInfo* CustomOpApi::CopyKernelInfo(_In_ const OrtKernelInfo* info) { + OrtKernelInfo* info_copy{}; + ThrowOnError(api_.CopyKernelInfo(info, &info_copy)); + return info_copy; +} + +inline void CustomOpApi::ReleaseKernelInfo(_Frees_ptr_opt_ OrtKernelInfo* info_copy) { + api_.ReleaseKernelInfo(info_copy); +} + inline SessionOptions& SessionOptions::DisablePerSessionThreads() { ThrowOnError(GetApi().DisablePerSessionThreads(p_)); return *this; diff --git a/include/onnxruntime/core/session/onnxruntime_session_options_config_keys.h b/include/onnxruntime/core/session/onnxruntime_session_options_config_keys.h index f1a7009a89971..01d49b16a85e7 100644 --- a/include/onnxruntime/core/session/onnxruntime_session_options_config_keys.h +++ b/include/onnxruntime/core/session/onnxruntime_session_options_config_keys.h @@ -114,6 +114,13 @@ static const char* const kOrtSessionOptionsConfigNnapiEpPartitioningStopOps = "e // Available since version 1.11. static const char* const kOrtSessionOptionsConfigDynamicBlockBase = "session.dynamic_block_base"; +// This option allows to decrease CPU usage between infrequent +// requests and forces any TP threads spinning stop immediately when the last of +// concurrent Run() call returns. +// Spinning is restarted on the next Run() call. +// Applies only to internal thread-pools +static const char* const kOrtSessionOptionsConfigForceSpinningStop = "session.force_spinning_stop"; + // "1": all inconsistencies encountered during shape and type inference // will result in failures. // "0": in some cases warnings will be logged but processing will continue. The default. diff --git a/java/src/main/native/ai_onnxruntime_OrtSession_SessionOptions.c b/java/src/main/native/ai_onnxruntime_OrtSession_SessionOptions.c index ab129bb0eb840..edaad23e873e9 100644 --- a/java/src/main/native/ai_onnxruntime_OrtSession_SessionOptions.c +++ b/java/src/main/native/ai_onnxruntime_OrtSession_SessionOptions.c @@ -117,6 +117,10 @@ JNIEXPORT jlong JNICALL Java_ai_onnxruntime_OrtSession_00024SessionOptions_creat OrtSessionOptions* opts; checkOrtStatus(jniEnv,api,api->CreateSessionOptions(&opts)); checkOrtStatus(jniEnv,api,api->SetInterOpNumThreads(opts, 1)); +#ifdef ENABLE_EXTENSION_CUSTOM_OPS + // including all custom ops from onnxruntime-extensions + checkOrtStatus(jniEnv,api,api->EnableOrtCustomOps(opts)); +#endif // Commented out due to constant OpenMP warning as this API is invalid when running with OpenMP. // Not sure how to detect that from within the C API though. //checkOrtStatus(jniEnv,api,api->SetIntraOpNumThreads(opts, 1)); diff --git a/js/web/docs/operators.md b/js/web/docs/operators.md index 356603402259c..731547ddffdc3 100644 --- a/js/web/docs/operators.md +++ b/js/web/docs/operators.md @@ -23,6 +23,7 @@ See [Compatibility](../README.md#Compatibility) for a list of the supported plat | [BatchNormalization](https://github.com/onnx/onnx/blob/master/docs/Operators.md#BatchNormalization) | [7-8](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#BatchNormalization-7), [9-13](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#BatchNormalization-9), [14](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#BatchNormalization-14), [15+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#BatchNormalization-15) | | [Bernoulli](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Bernoulli) | | | [BitShift](https://github.com/onnx/onnx/blob/master/docs/Operators.md#BitShift) | | +| [BlackmanWindow](https://github.com/onnx/onnx/blob/master/docs/Operators.md#BlackmanWindow) | | | [Cast](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Cast) | [6-8](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Cast-6), [9-12](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Cast-9), [13+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Cast-13) | | [CastLike](https://github.com/onnx/onnx/blob/master/docs/Operators.md#CastLike) | | | [Ceil](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Ceil) | [6-12](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Ceil-6), [13+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Ceil-13) | @@ -39,6 +40,7 @@ See [Compatibility](../README.md#Compatibility) for a list of the supported plat | [Cos](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Cos) | [7+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Cos-7) | | [Cosh](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Cosh) | | | [CumSum](https://github.com/onnx/onnx/blob/master/docs/Operators.md#CumSum) | | +| [DFT](https://github.com/onnx/onnx/blob/master/docs/Operators.md#DFT) | | | [DepthToSpace](https://github.com/onnx/onnx/blob/master/docs/Operators.md#DepthToSpace) | [1-10](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#DepthToSpace-1), [11-12](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#DepthToSpace-11), [13+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#DepthToSpace-13) | | [DequantizeLinear](https://github.com/onnx/onnx/blob/master/docs/Operators.md#DequantizeLinear) | | | [Det](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Det) | | @@ -65,6 +67,8 @@ See [Compatibility](../README.md#Compatibility) for a list of the supported plat | [Greater](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Greater) | [7-8](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Greater-7), [9-12](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Greater-9), [13+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Greater-13) | | [GreaterOrEqual](https://github.com/onnx/onnx/blob/master/docs/Operators.md#GreaterOrEqual) | | | [GridSample](https://github.com/onnx/onnx/blob/master/docs/Operators.md#GridSample) | | +| [HammingWindow](https://github.com/onnx/onnx/blob/master/docs/Operators.md#HammingWindow) | | +| [HannWindow](https://github.com/onnx/onnx/blob/master/docs/Operators.md#HannWindow) | | | [HardSigmoid](https://github.com/onnx/onnx/blob/master/docs/Operators.md#HardSigmoid) | | | [HardSwish](https://github.com/onnx/onnx/blob/master/docs/Operators.md#HardSwish) | | | [Hardmax](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Hardmax) | | @@ -75,6 +79,7 @@ See [Compatibility](../README.md#Compatibility) for a list of the supported plat | [IsNaN](https://github.com/onnx/onnx/blob/master/docs/Operators.md#IsNaN) | | | [LRN](https://github.com/onnx/onnx/blob/master/docs/Operators.md#LRN) | | | [LSTM](https://github.com/onnx/onnx/blob/master/docs/Operators.md#LSTM) | | +| [LayerNormalization](https://github.com/onnx/onnx/blob/master/docs/Operators.md#LayerNormalization) | | | [LeakyRelu](https://github.com/onnx/onnx/blob/master/docs/Operators.md#LeakyRelu) | [6-15](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#LeakyRelu-6), [16+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#LeakyRelu-16) | | [Less](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Less) | [7-8](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Less-7), [9-12](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Less-9), [13+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Less-13) | | [LessOrEqual](https://github.com/onnx/onnx/blob/master/docs/Operators.md#LessOrEqual) | | @@ -91,6 +96,7 @@ See [Compatibility](../README.md#Compatibility) for a list of the supported plat | [MaxUnpool](https://github.com/onnx/onnx/blob/master/docs/Operators.md#MaxUnpool) | | | [Mean](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Mean) | | | [MeanVarianceNormalization](https://github.com/onnx/onnx/blob/master/docs/Operators.md#MeanVarianceNormalization) | | +| [MelWeightMatrix](https://github.com/onnx/onnx/blob/master/docs/Operators.md#MelWeightMatrix) | | | [Min](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Min) | | | [Mod](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Mod) | | | [Mul](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Mul) | [7-12](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Mul-7), [13](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Mul-13), [14+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Mul-14) | @@ -134,6 +140,7 @@ See [Compatibility](../README.md#Compatibility) for a list of the supported plat | [ReverseSequence](https://github.com/onnx/onnx/blob/master/docs/Operators.md#ReverseSequence) | | | [RoiAlign](https://github.com/onnx/onnx/blob/master/docs/Operators.md#RoiAlign) | | | [Round](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Round) | | +| [STFT](https://github.com/onnx/onnx/blob/master/docs/Operators.md#STFT) | | | [Scan](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Scan) | | | [Scatter](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Scatter) | | | [ScatterElements](https://github.com/onnx/onnx/blob/master/docs/Operators.md#ScatterElements) | | @@ -145,6 +152,7 @@ See [Compatibility](../README.md#Compatibility) for a list of the supported plat | [SequenceErase](https://github.com/onnx/onnx/blob/master/docs/Operators.md#SequenceErase) | | | [SequenceInsert](https://github.com/onnx/onnx/blob/master/docs/Operators.md#SequenceInsert) | | | [SequenceLength](https://github.com/onnx/onnx/blob/master/docs/Operators.md#SequenceLength) | | +| [SequenceMap](https://github.com/onnx/onnx/blob/master/docs/Operators.md#SequenceMap) | | | [Shape](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Shape) | [1-12](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Shape-1), [13-14](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Shape-13), [15+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Shape-15) | | [Shrink](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Shrink) | | | [Sigmoid](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Sigmoid) | [6-12](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Sigmoid-6), [13+](https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Sigmoid-13) | diff --git a/onnxruntime/contrib_ops/cpu/cpu_contrib_kernels.cc b/onnxruntime/contrib_ops/cpu/cpu_contrib_kernels.cc index 2068b3c3e3f1f..d89d30b62c737 100644 --- a/onnxruntime/contrib_ops/cpu/cpu_contrib_kernels.cc +++ b/onnxruntime/contrib_ops/cpu/cpu_contrib_kernels.cc @@ -41,16 +41,6 @@ class ONNX_OPERATOR_KERNEL_CLASS_NAME(kCpuExecutionProvider, kMSDomain, 1, FastG class ONNX_OPERATOR_KERNEL_CLASS_NAME(kCpuExecutionProvider, kMSDomain, 1, NGramRepeatBlock); class ONNX_OPERATOR_KERNEL_CLASS_NAME(kCpuExecutionProvider, kMSDomain, 1, BifurcationDetector); -#ifdef BUILD_MS_EXPERIMENTAL_OPS -class ONNX_OPERATOR_KERNEL_CLASS_NAME(kCpuExecutionProvider, kMSExperimentalDomain, 1, DFT); -class ONNX_OPERATOR_KERNEL_CLASS_NAME(kCpuExecutionProvider, kMSExperimentalDomain, 1, IDFT); -class ONNX_OPERATOR_KERNEL_CLASS_NAME(kCpuExecutionProvider, kMSExperimentalDomain, 1, HannWindow); -class ONNX_OPERATOR_KERNEL_CLASS_NAME(kCpuExecutionProvider, kMSExperimentalDomain, 1, HammingWindow); -class ONNX_OPERATOR_KERNEL_CLASS_NAME(kCpuExecutionProvider, kMSExperimentalDomain, 1, BlackmanWindow); -class ONNX_OPERATOR_KERNEL_CLASS_NAME(kCpuExecutionProvider, kMSExperimentalDomain, 1, MelWeightMatrix); -class ONNX_OPERATOR_KERNEL_CLASS_NAME(kCpuExecutionProvider, kMSExperimentalDomain, 1, STFT); -#endif - // ******** Start: Quantization ******************* // class ONNX_OPERATOR_KERNEL_CLASS_NAME(kCpuExecutionProvider, kMSDomain, 1, MatMulInteger16); class ONNX_OPERATOR_KERNEL_CLASS_NAME(kCpuExecutionProvider, kMSDomain, 1, QLinearGlobalAveragePool); @@ -224,16 +214,6 @@ Status RegisterCpuContribKernels(KernelRegistry& kernel_registry) { BuildKernelCreateInfo, BuildKernelCreateInfo, BuildKernelCreateInfo, - -#ifdef BUILD_MS_EXPERIMENTAL_OPS - BuildKernelCreateInfo, - BuildKernelCreateInfo, - BuildKernelCreateInfo, - BuildKernelCreateInfo, - BuildKernelCreateInfo, - BuildKernelCreateInfo, - BuildKernelCreateInfo, -#endif // These ops were experimental ops in onnx domain which have been removed now. We add them here as // contrib ops to main backward compatibility BuildKernelCreateInfo, diff --git a/onnxruntime/contrib_ops/cpu/signal/dft.cc b/onnxruntime/contrib_ops/cpu/signal/dft.cc deleted file mode 100644 index 87aac44976540..0000000000000 --- a/onnxruntime/contrib_ops/cpu/signal/dft.cc +++ /dev/null @@ -1,606 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -#ifdef BUILD_MS_EXPERIMENTAL_OPS - -#include "core/providers/common.h" -#include "core/framework/op_kernel.h" -#include "core/util/math_cpuonly.h" -#include "Eigen/src/Core/Map.h" -#include "dft.h" -#include - -#include "core/platform/threadpool.h" - -#include -#include - -namespace onnxruntime { -namespace contrib { - -ONNX_OPERATOR_KERNEL_EX( - DFT, - kMSExperimentalDomain, - 1, - kCpuExecutionProvider, - KernelDefBuilder().TypeConstraint("T1", BuildKernelDefConstraints()) - .TypeConstraint("T2", BuildKernelDefConstraints()), - DFT); - -ONNX_OPERATOR_KERNEL_EX( - IDFT, - kMSExperimentalDomain, - 1, - kCpuExecutionProvider, - KernelDefBuilder().TypeConstraint("T1", BuildKernelDefConstraints()) - .TypeConstraint("T2", BuildKernelDefConstraints()), - IDFT); - -ONNX_OPERATOR_KERNEL_EX( - STFT, - kMSExperimentalDomain, - 1, - kCpuExecutionProvider, - KernelDefBuilder().MayInplace(0, 0).TypeConstraint("T1", BuildKernelDefConstraints()) - .TypeConstraint("T2", BuildKernelDefConstraints()), - STFT); - -// dedupe with the other one in window_functions.cc -template -static T get_scalar_value_from_tensor(const Tensor* tensor) { - ORT_ENFORCE(tensor->Shape().Size() == 1, "ratio input should have a single value."); - - auto data_type = tensor->DataType()->AsPrimitiveDataType()->GetDataType(); - switch (data_type) { - case ONNX_NAMESPACE::TensorProto_DataType_FLOAT: - return static_cast(*reinterpret_cast(tensor->DataRaw())); - case ONNX_NAMESPACE::TensorProto_DataType_DOUBLE: - return static_cast(*reinterpret_cast(tensor->DataRaw())); - case ONNX_NAMESPACE::TensorProto_DataType_INT32: - return static_cast(*reinterpret_cast(tensor->DataRaw())); - case ONNX_NAMESPACE::TensorProto_DataType_INT64: - return static_cast(*reinterpret_cast(tensor->DataRaw())); - default: - ORT_THROW("Unsupported input data type of ", data_type); - } -} - -static bool is_real_valued_signal(const onnxruntime::TensorShape & shape) { - return shape.NumDimensions() == 2 || shape[shape.NumDimensions() - 1] == 1; -} - -static bool is_complex_valued_signal(const onnxruntime::TensorShape& shape) { - return shape.NumDimensions() > 2 && shape[shape.NumDimensions() - 1] == 2; -} - -static bool is_power_of_2(size_t size) { - unsigned n_bits = 0; - while (size != 0) { - n_bits += size & 1; - size = size >> 1; - } - return n_bits == 1; -} - -static const unsigned char BitReverseTable256[] = -{ - 0x00, 0x80, 0x40, 0xC0, 0x20, 0xA0, 0x60, 0xE0, 0x10, 0x90, 0x50, 0xD0, 0x30, 0xB0, 0x70, 0xF0, - 0x08, 0x88, 0x48, 0xC8, 0x28, 0xA8, 0x68, 0xE8, 0x18, 0x98, 0x58, 0xD8, 0x38, 0xB8, 0x78, 0xF8, - 0x04, 0x84, 0x44, 0xC4, 0x24, 0xA4, 0x64, 0xE4, 0x14, 0x94, 0x54, 0xD4, 0x34, 0xB4, 0x74, 0xF4, - 0x0C, 0x8C, 0x4C, 0xCC, 0x2C, 0xAC, 0x6C, 0xEC, 0x1C, 0x9C, 0x5C, 0xDC, 0x3C, 0xBC, 0x7C, 0xFC, - 0x02, 0x82, 0x42, 0xC2, 0x22, 0xA2, 0x62, 0xE2, 0x12, 0x92, 0x52, 0xD2, 0x32, 0xB2, 0x72, 0xF2, - 0x0A, 0x8A, 0x4A, 0xCA, 0x2A, 0xAA, 0x6A, 0xEA, 0x1A, 0x9A, 0x5A, 0xDA, 0x3A, 0xBA, 0x7A, 0xFA, - 0x06, 0x86, 0x46, 0xC6, 0x26, 0xA6, 0x66, 0xE6, 0x16, 0x96, 0x56, 0xD6, 0x36, 0xB6, 0x76, 0xF6, - 0x0E, 0x8E, 0x4E, 0xCE, 0x2E, 0xAE, 0x6E, 0xEE, 0x1E, 0x9E, 0x5E, 0xDE, 0x3E, 0xBE, 0x7E, 0xFE, - 0x01, 0x81, 0x41, 0xC1, 0x21, 0xA1, 0x61, 0xE1, 0x11, 0x91, 0x51, 0xD1, 0x31, 0xB1, 0x71, 0xF1, - 0x09, 0x89, 0x49, 0xC9, 0x29, 0xA9, 0x69, 0xE9, 0x19, 0x99, 0x59, 0xD9, 0x39, 0xB9, 0x79, 0xF9, - 0x05, 0x85, 0x45, 0xC5, 0x25, 0xA5, 0x65, 0xE5, 0x15, 0x95, 0x55, 0xD5, 0x35, 0xB5, 0x75, 0xF5, - 0x0D, 0x8D, 0x4D, 0xCD, 0x2D, 0xAD, 0x6D, 0xED, 0x1D, 0x9D, 0x5D, 0xDD, 0x3D, 0xBD, 0x7D, 0xFD, - 0x03, 0x83, 0x43, 0xC3, 0x23, 0xA3, 0x63, 0xE3, 0x13, 0x93, 0x53, 0xD3, 0x33, 0xB3, 0x73, 0xF3, - 0x0B, 0x8B, 0x4B, 0xCB, 0x2B, 0xAB, 0x6B, 0xEB, 0x1B, 0x9B, 0x5B, 0xDB, 0x3B, 0xBB, 0x7B, 0xFB, - 0x07, 0x87, 0x47, 0xC7, 0x27, 0xA7, 0x67, 0xE7, 0x17, 0x97, 0x57, 0xD7, 0x37, 0xB7, 0x77, 0xF7, - 0x0F, 0x8F, 0x4F, 0xCF, 0x2F, 0xAF, 0x6F, 0xEF, 0x1F, 0x9F, 0x5F, 0xDF, 0x3F, 0xBF, 0x7F, 0xFF}; - -template -uint32_t bit_reverse(uint32_t num) { - uint32_t rev = (BitReverseTable256[num & 0xff] << 24) | - (BitReverseTable256[(num >> 8) & 0xff] << 16) | - (BitReverseTable256[(num >> 16) & 0xff] << 8) | - (BitReverseTable256[(num >> 24) & 0xff]); - return static_cast(((uint64_t)rev) >> (32 - TSignificantBits)); -} - -template -static inline T bit_reverse(T num, unsigned significant_bits) { - switch (significant_bits) { - case 0: return static_cast(bit_reverse<0>(static_cast(num))); - case 1: return static_cast(bit_reverse<1>(static_cast(num))); - case 2: return static_cast(bit_reverse<2>(static_cast(num))); - case 3: return static_cast(bit_reverse<3>(static_cast(num))); - case 4: return static_cast(bit_reverse<4>(static_cast(num))); - case 5: return static_cast(bit_reverse<5>(static_cast(num))); - case 6: return static_cast(bit_reverse<6>(static_cast(num))); - case 7: return static_cast(bit_reverse<7>(static_cast(num))); - case 8: return static_cast(bit_reverse<8>(static_cast(num))); - case 9: return static_cast(bit_reverse<9>(static_cast(num))); - case 10: return static_cast(bit_reverse<10>(static_cast(num))); - case 11: return static_cast(bit_reverse<11>(static_cast(num))); - case 12: return static_cast(bit_reverse<12>(static_cast(num))); - case 13: return static_cast(bit_reverse<13>(static_cast(num))); - case 14: return static_cast(bit_reverse<14>(static_cast(num))); - case 15: return static_cast(bit_reverse<15>(static_cast(num))); - case 16: return static_cast(bit_reverse<16>(static_cast(num))); - case 17: return static_cast(bit_reverse<17>(static_cast(num))); - case 18: return static_cast(bit_reverse<18>(static_cast(num))); - case 19: return static_cast(bit_reverse<19>(static_cast(num))); - case 20: return static_cast(bit_reverse<20>(static_cast(num))); - case 21: return static_cast(bit_reverse<21>(static_cast(num))); - case 22: return static_cast(bit_reverse<22>(static_cast(num))); - case 23: return static_cast(bit_reverse<23>(static_cast(num))); - case 24: return static_cast(bit_reverse<24>(static_cast(num))); - case 25: return static_cast(bit_reverse<25>(static_cast(num))); - case 26: return static_cast(bit_reverse<26>(static_cast(num))); - case 27: return static_cast(bit_reverse<27>(static_cast(num))); - case 28: return static_cast(bit_reverse<28>(static_cast(num))); - case 29: return static_cast(bit_reverse<29>(static_cast(num))); - case 30: return static_cast(bit_reverse<30>(static_cast(num))); - case 31: return static_cast(bit_reverse<31>(static_cast(num))); - case 32: return static_cast(bit_reverse<32>(static_cast(num))); - default: ORT_THROW("Unsupported bit size."); - } -} - -template -static T compute_angular_velocity(size_t number_of_samples, bool inverse) { - // Calculate fundamental angular velocity - static const T pi = static_cast(3.14159265); - static const T tau = 2 * pi; - T inverse_switch = inverse ? 1.f : -1.f; - T angular_velocity = inverse_switch * tau / number_of_samples; - return angular_velocity; -} - -template -static Status fft_radix2(OpKernelContext* /*ctx*/, - const Tensor* X, Tensor* Y, - size_t X_offset, size_t X_stride, size_t Y_offset, size_t Y_stride, int64_t axis, size_t dft_length, - const Tensor* window, bool is_onesided, bool inverse, - std::vector>& V, - std::vector>& temp_output) { - - // Get shape and significant bits - const auto& X_shape = X->Shape(); - size_t number_of_samples = static_cast(X_shape[axis]); - unsigned significant_bits = static_cast(log2(dft_length)); - - // Get data - auto* X_data = const_cast(reinterpret_cast(X->DataRaw())) + X_offset; - // Get window - U* window_data = nullptr; - if (window) { - window_data = const_cast(reinterpret_cast(window->DataRaw())); - } - - size_t Y_data_stride = 1; - std::complex* Y_data; - if (is_onesided) { - if (temp_output.size() != dft_length) { - temp_output = std::vector>(dft_length); - } - Y_data = temp_output.data(); - } else { - Y_data = reinterpret_cast*>(Y->MutableDataRaw()) + Y_offset; - Y_data_stride = Y_stride; - } - - auto angular_velocity = compute_angular_velocity(dft_length, inverse); - - // Create vandermonde matrix V ordered with the bit-reversed permutation - if (V.size() != dft_length) { - V = std::vector>(dft_length); // e^(i *2*pi / N * k) - for (size_t i = 0; i < dft_length; i++) { - size_t bit_reversed_index = bit_reverse(i, significant_bits); - V[bit_reversed_index] = std::complex(cos(i * angular_velocity), sin(i * angular_velocity)); - } - } - - for (size_t i = 0; i < dft_length; i++) { - size_t bit_reversed_index = bit_reverse(i, significant_bits); - auto x = (bit_reversed_index < number_of_samples) ? * (X_data + bit_reversed_index * X_stride) : 0; - auto window_element = window_data ? *(window_data + bit_reversed_index) : 1; - *(Y_data + i*Y_data_stride) = std::complex(1, 0) * x * window_element; - } - - // Run fft_radix2 - unsigned current_significant_bits = 0; - for (size_t i = 2; i <= dft_length; i <<= 1) { - size_t midpoint = i >> 1; - current_significant_bits++; - - for (size_t k = 0; k < midpoint; k++) { - auto first_idx = bit_reverse(k, current_significant_bits); - auto second_idx = bit_reverse(midpoint + k, current_significant_bits); - for (size_t j = 0; j < dft_length; j += i) { - auto even_index = k + j; - auto odd_index = k + j + midpoint; - std::complex* even = (Y_data + even_index * Y_data_stride); - std::complex* odd = (Y_data + odd_index * Y_data_stride); - std::complex first = *even + (V[first_idx] * *odd); - std::complex second = *even + (V[second_idx] * *odd); - *even = first; - *odd = second; - } - } - } - - // Scale the output if inverse - if (inverse) { - for (size_t i = 0; i < dft_length; i++) { - std::complex& val = *(Y_data + i * Y_data_stride); - val /= static_cast(dft_length); - } - } - - if (is_onesided) { - auto destination = reinterpret_cast*>(Y->MutableDataRaw()) + Y_offset; - for (size_t i = 0; i < dft_length; i++) { - *(destination + Y_stride * i) = *(Y_data + i * Y_data_stride); - } - } - - return Status::OK(); -} - -template -static Status dft_naive(const Tensor* X, Tensor* Y, - size_t X_offset, size_t X_stride, size_t Y_offset, size_t Y_stride, int64_t axis, - size_t dft_length, const Tensor* window, bool inverse) { - // Get shape and significant bits - const auto& X_shape = X->Shape(); - size_t number_of_samples = static_cast(X_shape[axis]); - const auto& Y_shape = Y->Shape(); - size_t dft_output_size = static_cast(Y_shape[axis]); - - // Get data - auto* X_data = const_cast(reinterpret_cast(X->DataRaw())) + X_offset; - auto* Y_data = reinterpret_cast*>(Y->MutableDataRaw()) + Y_offset; - - U* window_data = nullptr; - if (window) { - window_data = const_cast(reinterpret_cast(window->DataRaw())); - } - - auto angular_velocity = compute_angular_velocity(dft_length, inverse); - - for (size_t i = 0; i < dft_output_size; i++) { - std::complex& out = *(Y_data + i*Y_stride); - out.real(0); - out.imag(0); - - for (size_t j = 0; j < dft_length; j++) { // vectorize over this loop - auto exponential = std::complex(cos(i * j * angular_velocity), sin(i * j * angular_velocity)); - auto window_element = window_data ? * (window_data + j) : 1; - auto x = (j < number_of_samples) ? *(X_data + j * X_stride) : 0; - auto element = x * window_element; - out += exponential * element; - } - - if (inverse) { - out /= static_cast(dft_length); - } - } - - return Status::OK(); -} - -template -static Status discrete_fourier_transform(OpKernelContext* ctx, const Tensor* X, Tensor* Y, int64_t axis, int64_t dft_length, const Tensor* window, bool is_onesided, bool inverse, - std::vector>& V, std::vector>& temp_output) { - // Get shape - const auto& X_shape = X->Shape(); - const auto& Y_shape = Y->Shape(); - - auto batch_and_signal_rank = X->Shape().NumDimensions(); - auto total_dfts = static_cast(X->Shape().Size() / X->Shape()[axis]); - - auto is_input_real = X->Shape().NumDimensions() == 2 || X->Shape()[X->Shape().NumDimensions() - 1] == 1; - auto complex_input_factor = is_input_real ? 1 : 2; - if (X->Shape().NumDimensions() > 2) - { - total_dfts /= X->Shape()[X->Shape().NumDimensions() - 1]; - batch_and_signal_rank -= 1; - } - - // Calculate x/y offsets/strides - for (size_t i = 0; i < total_dfts; i++) - { - size_t X_offset = 0; - size_t X_stride = X_shape.SizeFromDimension(axis+1) / complex_input_factor; - size_t cumulative_packed_stride = total_dfts; - size_t temp = i; - for (size_t r = 0; r < batch_and_signal_rank; r++) { - if (r == static_cast(axis)) - { - continue; - } - cumulative_packed_stride /= X_shape[r]; - auto index = temp / cumulative_packed_stride; - temp -= (index * cumulative_packed_stride); - X_offset += index * X_shape.SizeFromDimension(r + 1) / complex_input_factor; - } - - size_t Y_offset = 0; - size_t Y_stride = Y_shape.SizeFromDimension(axis + 1) / 2; - cumulative_packed_stride = total_dfts; - temp = i; - for (size_t r = 0; r < batch_and_signal_rank; r++) { - if (r == static_cast(axis)) - { - continue; - } - cumulative_packed_stride /= X_shape[r]; - auto index = temp / cumulative_packed_stride; - temp -= (index * cumulative_packed_stride); - Y_offset += index * Y_shape.SizeFromDimension(r + 1) / 2; - } - - if (is_power_of_2(dft_length)) { - ORT_RETURN_IF_ERROR((fft_radix2(ctx, X, Y, X_offset, X_stride, Y_offset, Y_stride, axis, dft_length, window, is_onesided, inverse, V, temp_output))); - } else { - ORT_RETURN_IF_ERROR((dft_naive(X, Y, X_offset, X_stride, Y_offset, Y_stride, axis, dft_length, window, inverse))); - } - } - - return Status::OK(); -} - -static Status discrete_fourier_transform(OpKernelContext* ctx, int64_t axis, bool is_onesided, bool inverse) { - // Get input shape - const auto* X = ctx->Input(0); - const auto* dft_length = ctx->Input(1); - const auto& X_shape = X->Shape(); - const auto is_real_valued = is_real_valued_signal(X_shape); - const auto is_complex_valued = is_complex_valued_signal(X_shape); - - // Get the rank of the input tensor - // Ensure that the axis is in the valid range of [-rank, rank) - auto rank = static_cast(X_shape.GetDims().size()); - if (!(-rank <= axis && axis < rank)) { - ORT_RETURN_IF(!(-rank <= axis && axis < rank), - "axis attribute value ", - axis, - " is invalid for a tensor of rank ", - rank); - } - axis = (axis >= 0 ? axis : axis + rank); - - int64_t number_of_samples = static_cast(X_shape[axis]); - if (dft_length) { - const auto& dft_length_shape = dft_length->Shape(); - ORT_RETURN_IF(!dft_length_shape.IsScalar(), "dft_length must be a scalar value."); - number_of_samples = static_cast(get_scalar_value_from_tensor(dft_length)); - ORT_RETURN_IF(number_of_samples <= 0, "dft_length must be greater than zero."); - } - - // Get the DFT output size. Onesided will return only the unique values! - // note: x >> 1 === std::floor(x / 2.f) - auto dft_output_size = is_onesided ? - ((number_of_samples >> 1) + 1) : - number_of_samples; - - // Get output shape - auto Y_shape = onnxruntime::TensorShape(X_shape); - if (X_shape.NumDimensions() == 2) - { - Y_shape = onnxruntime::TensorShape({X_shape[0], dft_output_size, 2}); - } else - { - Y_shape[Y_shape.NumDimensions() - 1] = 2; - } - Y_shape[axis] = dft_output_size; - auto Y = ctx->Output(0, Y_shape); - - // Get data type - auto data_type = X->DataType(); - - auto element_size = data_type->Size(); - if (element_size == sizeof(float)) { - std::vector> V; - std::vector> temp_output; - if (is_real_valued) { - ORT_RETURN_IF_ERROR((discrete_fourier_transform(ctx, X, Y, axis, number_of_samples, nullptr, is_onesided, inverse, V, temp_output))); - } else if (is_complex_valued) { - ORT_RETURN_IF_ERROR((discrete_fourier_transform>(ctx, X, Y, axis, number_of_samples, nullptr, is_onesided, inverse, V, temp_output))); - } else { - ORT_THROW("Unsupported input signal shape. The signal's first dimenstion must be the batch dimension and its second dimension must be the signal length dimension. It may optionally include a 3rd dimension of size 2 for complex inputs.", data_type); - } - } else if (element_size == sizeof(double)) { - std::vector> V; - std::vector> temp_output; - if (is_real_valued) { - ORT_RETURN_IF_ERROR((discrete_fourier_transform(ctx, X, Y, axis, number_of_samples, nullptr, is_onesided, inverse, V, temp_output))); - } else if (is_complex_valued) { - ORT_RETURN_IF_ERROR((discrete_fourier_transform>(ctx, X, Y, axis, number_of_samples, nullptr, is_onesided, inverse, V, temp_output))); - } else { - ORT_THROW("Unsupported input signal shape. The signal's first dimenstion must be the batch dimension and its second dimension must be the signal length dimension. It may optionally include a 3rd dimension of size 2 for complex inputs.", data_type); - } - } else { - ORT_THROW("Unsupported input data type of ", data_type); - } - - return Status::OK(); -} - -Status DFT::Compute(OpKernelContext* ctx) const { - ORT_RETURN_IF_ERROR( - discrete_fourier_transform(ctx, - axis_, - is_onesided_, - is_inverse_)); - return Status::OK(); -} - -Status IDFT::Compute(OpKernelContext* ctx) const { - ORT_RETURN_IF_ERROR( - discrete_fourier_transform(ctx, - axis_, - false /*is_onesided_*/, - true /*is_inverse_*/)); - return Status::OK(); -} - -template -static Status short_time_fourier_transform(OpKernelContext* ctx, bool is_onesided, bool /*inverse*/) { - // Attr("onesided"): default = 1 - // Input(0, "signal") type = T1 - // Input(1, "frame_length") type = T2 - // Input(2, "window") type = T1, optional - // Input(3, "frame_step") type = T2 - // Output(0, "output") type = T1 - - // Get signal - const auto* signal = ctx->Input(0); - const auto frame_step = get_scalar_value_from_tensor(ctx->Input(1)); - const auto* window = ctx->Input(2); - const auto* frame_length_tensor = ctx->Input(3); - - // Get input signal shape - const auto& signal_shape = signal->Shape(); - const auto batch_size = signal_shape[0]; - const auto signal_size = signal_shape[1]; - const auto signal_components = - signal_shape.NumDimensions() == 2 ? 1 : signal_shape.NumDimensions() == 3 ? signal_shape[2] : 0; // error - ORT_ENFORCE(signal_components == 1 || signal_components == 2, "Ensure that the signal has either 1 or 2 components."); - - // Get the frame length - int64_t frame_length = std::numeric_limits::min(); - if (frame_length_tensor) - { - frame_length = get_scalar_value_from_tensor(frame_length_tensor); - } - - // Get window length - int64_t window_length = std::numeric_limits::min(); - if (window) { - window_length = window->Shape()[0]; - } - - // The frame_length and window inputs are generally used interchangably, and should match! - if (frame_length != std::numeric_limits::min() && - window_length != std::numeric_limits::min()) { - ORT_ENFORCE(frame_length == window_length, "If both frame_length and window are set, then the size of the window must be equal to the frame_length."); - } - - // Calculate the window size with preference to the window input. - const auto window_size = window ? window->Shape()[0] : frame_length; - ORT_ENFORCE(window_size < signal_size, "Ensure that the dft size is smaller than the signal."); - - // Calculate the number of dfts to run - const auto n_dfts = static_cast(std::floor((signal_size - window_size) / static_cast(frame_step)) + 1); - - // Calculate the output spectra length (onesided will return only the unique values) - // note: x >> 1 === std::floor(x / 2.f) - const auto dft_output_size = - is_onesided ? - (window_size >> 1) + 1 : - window_size; - - // Get/create the output mutable data - auto output_spectra_shape = onnxruntime::TensorShape({batch_size, n_dfts, dft_output_size, 2}); - auto Y = ctx->Output(0, output_spectra_shape); - auto Y_data = reinterpret_cast(Y->MutableDataRaw()); - - // Get/create the signal mutable data - auto* signal_data = const_cast(reinterpret_cast(signal->DataRaw())); - - // Define tensor shapes for each dft run - const int64_t output_components = 2; - auto dft_input_shape = onnxruntime::TensorShape({1, window_size, signal_components}); - auto dft_output_shape = onnxruntime::TensorShape({1, dft_output_size, output_components}); - - std::vector> V; - std::vector> temp_output; - - // Run each dft of each batch as if it was a real-valued batch size 1 dft operation - for (int64_t batch_idx = 0; batch_idx < batch_size; batch_idx++) { - for (int64_t i = 0; i < n_dfts; i++) { - auto input_frame_begin = - signal_data + - (batch_idx * signal_size * signal_components) + - (i * frame_step * signal_components); - - auto output_frame_begin = - Y_data + - (batch_idx * n_dfts * dft_output_size * output_components) + - (i * dft_output_size * output_components); - - // Tensors do not own the backing memory, so no worries on destruction - auto input = - onnxruntime::Tensor( - signal->DataType(), - dft_input_shape, - input_frame_begin, - signal->Location(), - 0); - - auto output = - onnxruntime::Tensor( - Y->DataType(), - dft_output_shape, - output_frame_begin, - Y->Location(), - 0); - - // Run individual dft - ORT_RETURN_IF_ERROR((discrete_fourier_transform(ctx, &input, &output, 1, window_size, window, is_onesided, false, V, temp_output))); - } - } - - return Status::OK(); -} - -Status STFT::Compute(OpKernelContext* ctx) const { - // Attr("onesided"): default = 1 - // Input(0, "signal") type = T1 - // Input(1, "frame_length") type = T2 - // Input(2, "window") type = T1, optional - // Input(3, "frame_step") type = T2 - // Output(0, "output") type = T1 - - // Get signal shape - const auto* signal = ctx->Input(0); - const auto& signal_shape = signal->Shape(); - const auto is_real_valued = is_real_valued_signal(signal_shape); - const auto is_complex_valued = is_complex_valued_signal(signal_shape); - - // Get data type - auto data_type = signal->DataType(); - - const auto element_size = data_type->Size(); - if (element_size == sizeof(float)) { - if (is_real_valued) { - ORT_RETURN_IF_ERROR((short_time_fourier_transform(ctx, is_onesided_, false))); - } else if (is_complex_valued) { - ORT_RETURN_IF_ERROR((short_time_fourier_transform>(ctx, is_onesided_, false))); - } else { - ORT_THROW("Unsupported input signal shape. The signal's first dimenstion must be the batch dimension and its second dimension must be the signal length dimension. It may optionally include a 3rd dimension of size 2 for complex inputs.", data_type); - } - } else if (element_size == sizeof(double)) { - if (is_real_valued) { - ORT_RETURN_IF_ERROR((short_time_fourier_transform(ctx, is_onesided_, false))); - } else if (is_complex_valued) { - ORT_RETURN_IF_ERROR((short_time_fourier_transform>(ctx, is_onesided_, false))); - } else { - ORT_THROW("Unsupported input signal shape. The signal's first dimenstion must be the batch dimension and its second dimension must be the signal length dimension. It may optionally include a 3rd dimension of size 2 for complex inputs.", data_type); - } - } else { - ORT_THROW("Unsupported input data type of ", data_type); - } - - return Status::OK(); -} - -} // namespace contrib -} // namespace onnxruntime - -#endif diff --git a/onnxruntime/contrib_ops/cpu/signal/window_functions.cc b/onnxruntime/contrib_ops/cpu/signal/window_functions.cc deleted file mode 100644 index 29256adb264d0..0000000000000 --- a/onnxruntime/contrib_ops/cpu/signal/window_functions.cc +++ /dev/null @@ -1,334 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -#ifdef BUILD_MS_EXPERIMENTAL_OPS - -#include "core/providers/common.h" -#include "core/framework/op_kernel.h" -#include "core/util/math_cpuonly.h" -#include "Eigen/src/Core/Map.h" -#include "window_functions.h" -#include - -#include "core/platform/threadpool.h" - -#include -#include - -namespace onnxruntime { -namespace contrib { - -ONNX_OPERATOR_KERNEL_EX( - HannWindow, - kMSExperimentalDomain, - 1, - kCpuExecutionProvider, - KernelDefBuilder().MayInplace(0, 0) - .TypeConstraint("T1", BuildKernelDefConstraints()) - .TypeConstraint("T2", BuildKernelDefConstraints()), - HannWindow); - -ONNX_OPERATOR_KERNEL_EX( - HammingWindow, - kMSExperimentalDomain, - 1, - kCpuExecutionProvider, - KernelDefBuilder().MayInplace(0, 0) - .TypeConstraint("T1", BuildKernelDefConstraints()) - .TypeConstraint("T2", BuildKernelDefConstraints()), - HammingWindow); - -ONNX_OPERATOR_KERNEL_EX( - BlackmanWindow, - kMSExperimentalDomain, - 1, - kCpuExecutionProvider, - KernelDefBuilder().MayInplace(0, 0) - .TypeConstraint("T1", BuildKernelDefConstraints()) - .TypeConstraint("T2", BuildKernelDefConstraints()), - BlackmanWindow); - - -ONNX_OPERATOR_KERNEL_EX( - MelWeightMatrix, - kMSExperimentalDomain, - 1, - kCpuExecutionProvider, - KernelDefBuilder().MayInplace(0, 0) - .TypeConstraint("T1", BuildKernelDefConstraints()) - .TypeConstraint("T2", BuildKernelDefConstraints()) - .TypeConstraint("T3", BuildKernelDefConstraints()), - MelWeightMatrix); - - -template -static Status cosine_sum_window(Tensor* Y, size_t size, float a0, float a1, float a2) { - auto* Y_data = reinterpret_cast(Y->MutableDataRaw()); - - // Calculate the radians to increment per sample - constexpr double pi = 3.14159265; - constexpr double tau = 2 * pi; - const double angular_increment = tau / size; - - for (size_t i = 0; i < size; i++) { - auto a2_component = a2 == 0 ? 0 : (a2 * cos(2 * angular_increment * i)); - - T& value = *(Y_data + i); - value = static_cast(a0 - (a1 * cos(angular_increment * i)) + a2_component); - } - - return Status::OK(); -} - -template -static T get_scalar_value_from_tensor(const Tensor* tensor) { - ORT_ENFORCE(tensor->Shape().Size() == 1, "Tensor input should have a single value."); - auto data_type = tensor->DataType()->AsPrimitiveDataType()->GetDataType(); - switch (data_type) { - case ONNX_NAMESPACE::TensorProto_DataType_FLOAT: - return static_cast(*reinterpret_cast(tensor->DataRaw())); - case ONNX_NAMESPACE::TensorProto_DataType_DOUBLE: - return static_cast(*reinterpret_cast(tensor->DataRaw())); - case ONNX_NAMESPACE::TensorProto_DataType_INT32: - return static_cast(*reinterpret_cast(tensor->DataRaw())); - case ONNX_NAMESPACE::TensorProto_DataType_INT64: - return static_cast(*reinterpret_cast(tensor->DataRaw())); - default: - ORT_THROW("Unsupported input data type of ", data_type); - } -} - -static Status create_cosine_sum_window( - OpKernelContext* ctx, - onnx::TensorProto_DataType output_datatype, - float a0, float a1, float a2) { - - // Get the size of the window - auto size = get_scalar_value_from_tensor(ctx->Input(0)); - - // Get the output tensor - auto Y_shape = onnxruntime::TensorShape({size}); - auto Y = ctx->Output(0, Y_shape); - - switch (output_datatype) { - case ONNX_NAMESPACE::TensorProto_DataType_FLOAT: { - ORT_RETURN_IF_ERROR((cosine_sum_window(Y, size, a0, a1, a2))); - break; - } - case ONNX_NAMESPACE::TensorProto_DataType_DOUBLE: { - ORT_RETURN_IF_ERROR((cosine_sum_window(Y, size, a0, a1, a2))); - break; - } - case ONNX_NAMESPACE::TensorProto_DataType_INT8: { - ORT_RETURN_IF_ERROR((cosine_sum_window(Y, size, a0, a1, a2))); - break; - } - case ONNX_NAMESPACE::TensorProto_DataType_INT16: { - ORT_RETURN_IF_ERROR((cosine_sum_window(Y, size, a0, a1, a2))); - break; - } - case ONNX_NAMESPACE::TensorProto_DataType_INT32: { - ORT_RETURN_IF_ERROR((cosine_sum_window(Y, size, a0, a1, a2))); - break; - } - case ONNX_NAMESPACE::TensorProto_DataType_INT64: { - ORT_RETURN_IF_ERROR((cosine_sum_window(Y, size, a0, a1, a2))); - break; - } - case ONNX_NAMESPACE::TensorProto_DataType_UINT8: { - ORT_RETURN_IF_ERROR((cosine_sum_window(Y, size, a0, a1, a2))); - break; - } - case ONNX_NAMESPACE::TensorProto_DataType_UINT16: { - ORT_RETURN_IF_ERROR((cosine_sum_window(Y, size, a0, a1, a2))); - break; - } - case ONNX_NAMESPACE::TensorProto_DataType_UINT32: { - ORT_RETURN_IF_ERROR((cosine_sum_window(Y, size, a0, a1, a2))); - break; - } - case ONNX_NAMESPACE::TensorProto_DataType_UINT64: { - ORT_RETURN_IF_ERROR((cosine_sum_window(Y, size, a0, a1, a2))); - break; - } - default: - ORT_THROW("Unsupported input data type of ", output_datatype); - } - - return Status::OK(); -} - -Status HannWindow::Compute(OpKernelContext* ctx) const { - // HannWindows are a special case of Cosine-Sum Windows which take the following form: - // w[n] = SUM_k=0_K( (-1)^k * a_k * cos(2*pi*k*n/N) ) with values the following values for a_k: - float a0 = .5f; - float a1 = a0; - float a2 = 0; - return create_cosine_sum_window(ctx, data_type_, a0, a1, a2); -} - -Status HammingWindow::Compute(OpKernelContext* ctx) const { - // HammingWindows are a special case of Cosine-Sum Windows which take the following form: - // w[n] = SUM_k=0_K( (-1)^k * a_k * cos(2*pi*k*n/N) ) with values the following values for a_k: - float a0 = 25.f / 46.f; - float a1 = 1 - a0; - float a2 = 0; - return create_cosine_sum_window(ctx, data_type_, a0, a1, a2); -} - -Status BlackmanWindow::Compute(OpKernelContext* ctx) const { - // BlackmanWindows are a special case of Cosine-Sum Windows which take the following form: - // w[n] = SUM_k=0_K( (-1)^k * a_k * cos(2*pi*k*n/N) ) with values the following values for a_k: - float alpha = .16f; - float a2 = alpha / 2.f; - float a0 = .5f - a2; - float a1 = .5f; - return create_cosine_sum_window(ctx, data_type_, a0, a1, a2); -} - -static inline double hz_to_mel_scale(double hz) { - return 2595 * std::log10(1 + hz / 700); -} - -static inline double mel_scale_to_hz(double mels) { - return 700 * (pow(10, (mels / 2595)) - 1); -} - -template -Status create_mel_weight_matrix(OpKernelContext* ctx, int64_t num_mel_bins, int64_t dft_length, int64_t sample_rate, float lower_edge_hertz, float upper_edge_hertz) { - // Determine the width of the spectrogram. - // This is determined as half the size of the fft size. The first element of the spectrum is always retained, - // and the remaining are halved. The second half can be discarded due to the conjugate symmetry of the output with real valued ffts. - // Taken together the formula for the size of the output will be std::floor(dft_length / 2) + 1. - int64_t num_spectrogram_bins = static_cast(std::floor(dft_length / 2 + 1)); - - // Checks - auto lowest_index = std::floor(((dft_length + 1) * lower_edge_hertz) / sample_rate); - auto highest_index = std::floor(((dft_length + 1) * upper_edge_hertz) / sample_rate); - ORT_ENFORCE(lowest_index >= 0 && lowest_index < num_spectrogram_bins, "lower_edge_hertz produces a mel triangle filter bank that is out of range given the dft_length and the sample_rate."); - ORT_ENFORCE(highest_index >= 0 && highest_index < num_spectrogram_bins, "upper_edge_hertz produces a mel triangle filter bank that is out of range given the dft_length and the sample_rate."); - - // Create the output shape - onnxruntime::TensorShape output_shape( - { - static_cast(num_spectrogram_bins), - num_mel_bins - }); - auto* Y = ctx->Output(0, output_shape); - - // Get the raw output data - auto* Y_data = reinterpret_cast(Y->MutableDataRaw()); - - // Set the weight matrix to 0 - memset(Y_data, 0, num_spectrogram_bins * num_mel_bins * sizeof(T)); - - // The mel filterbank is a triangular shaped peak with a height of 1 and a base equal to the size of the MEL range divided by - // the number of bins needed times 2. This triagle is then slid across the mel domain linearly, with a constant step size that - // is equal to half of the base of the triange. To accomodate N bins, N+2 data points will be needed to determine the - // start, center and end points of each mel triange filter. - // - // low_frequency where the mel triangle filter banks begin, and they end on the high_frequency_mel - // The range is divided evenly to create the needed points corresponding to the begin, center, end points of each triangle filterbank - std::vector frequency_bins(num_mel_bins + 2); - auto low_frequency_mel = hz_to_mel_scale(lower_edge_hertz); - auto high_frequency_mel = hz_to_mel_scale(upper_edge_hertz); - auto mel_step = (high_frequency_mel - low_frequency_mel) / static_cast(frequency_bins.size()); - - // Convert each point from mel scale back to hertz, and then compute the corresponding index in the fft - for (size_t i = 0; i < frequency_bins.size(); i++) { - auto hz = mel_scale_to_hz(low_frequency_mel + mel_step * i); - frequency_bins[i] = static_cast(std::floor(((dft_length + 1) * hz) / sample_rate)); - } - - for (size_t i = 0; i < static_cast(num_mel_bins); i++) { - auto lower_frequency_value = frequency_bins[i]; //left - auto center_frequency_point = frequency_bins[i+1]; //center - auto higher_frequency_point = frequency_bins[i+2]; //right - - auto low_to_center = center_frequency_point - lower_frequency_value; - if (low_to_center == 0) { - auto& current_element = *(Y_data + (center_frequency_point * num_mel_bins) + i); - current_element = static_cast(1); - } else { - for (size_t j = lower_frequency_value; j <= center_frequency_point; j++) { - auto& current_element = *(Y_data + (j * num_mel_bins) + i); - current_element = static_cast((j - lower_frequency_value) / static_cast(low_to_center)); - } - } - - auto center_to_high = higher_frequency_point - center_frequency_point; - if (center_to_high > 0) { - for (size_t j = center_frequency_point; j < higher_frequency_point; j++) { - auto& current_element = *(Y_data + (j * num_mel_bins) + i); - current_element = static_cast((higher_frequency_point - j) / static_cast(center_to_high)); - } - } - } - - return Status::OK(); -} - -static Status create_mel_weight_matrix(OpKernelContext* ctx, onnx::TensorProto_DataType output_datatype, - int64_t num_mel_bins, int64_t dft_length, int64_t sample_rate, float lower_edge_hertz, float upper_edge_hertz) { - switch (output_datatype) { - case ONNX_NAMESPACE::TensorProto_DataType_FLOAT: { - ORT_RETURN_IF_ERROR((create_mel_weight_matrix(ctx, num_mel_bins, dft_length, sample_rate, lower_edge_hertz, upper_edge_hertz))); - break; - } - case ONNX_NAMESPACE::TensorProto_DataType_DOUBLE: { - ORT_RETURN_IF_ERROR((create_mel_weight_matrix(ctx, num_mel_bins, dft_length, sample_rate, lower_edge_hertz, upper_edge_hertz))); - break; - } - case ONNX_NAMESPACE::TensorProto_DataType_INT8: { - ORT_RETURN_IF_ERROR((create_mel_weight_matrix(ctx, num_mel_bins, dft_length, sample_rate, lower_edge_hertz, upper_edge_hertz))); - break; - } - case ONNX_NAMESPACE::TensorProto_DataType_INT16: { - ORT_RETURN_IF_ERROR((create_mel_weight_matrix(ctx, num_mel_bins, dft_length, sample_rate, lower_edge_hertz, upper_edge_hertz))); - break; - } - case ONNX_NAMESPACE::TensorProto_DataType_INT32: { - ORT_RETURN_IF_ERROR((create_mel_weight_matrix(ctx, num_mel_bins, dft_length, sample_rate, lower_edge_hertz, upper_edge_hertz))); - break; - } - case ONNX_NAMESPACE::TensorProto_DataType_INT64: { - ORT_RETURN_IF_ERROR((create_mel_weight_matrix(ctx, num_mel_bins, dft_length, sample_rate, lower_edge_hertz, upper_edge_hertz))); - break; - } - case ONNX_NAMESPACE::TensorProto_DataType_UINT8: { - ORT_RETURN_IF_ERROR((create_mel_weight_matrix(ctx, num_mel_bins, dft_length, sample_rate, lower_edge_hertz, upper_edge_hertz))); - break; - } - case ONNX_NAMESPACE::TensorProto_DataType_UINT16: { - ORT_RETURN_IF_ERROR((create_mel_weight_matrix(ctx, num_mel_bins, dft_length, sample_rate, lower_edge_hertz, upper_edge_hertz))); - break; - } - case ONNX_NAMESPACE::TensorProto_DataType_UINT32: { - ORT_RETURN_IF_ERROR((create_mel_weight_matrix(ctx, num_mel_bins, dft_length, sample_rate, lower_edge_hertz, upper_edge_hertz))); - break; - } - case ONNX_NAMESPACE::TensorProto_DataType_UINT64: { - ORT_RETURN_IF_ERROR((create_mel_weight_matrix(ctx, num_mel_bins, dft_length, sample_rate, lower_edge_hertz, upper_edge_hertz))); - break; - } - default: - ORT_THROW("Unsupported input data type of ", output_datatype); - } - return Status::OK(); -} - -Status MelWeightMatrix::Compute(OpKernelContext* ctx) const { - const auto num_mel_bins = get_scalar_value_from_tensor(ctx->Input(0)); - const auto dft_length = get_scalar_value_from_tensor(ctx->Input(1)); - const auto sample_rate = get_scalar_value_from_tensor(ctx->Input(2)); - const auto lower_edge_hertz = get_scalar_value_from_tensor(ctx->Input(3)); - const auto upper_edge_hertz = get_scalar_value_from_tensor(ctx->Input(4)); - - ORT_RETURN_IF_ERROR(create_mel_weight_matrix(ctx, data_type_, num_mel_bins, dft_length, sample_rate, lower_edge_hertz, upper_edge_hertz)); - return Status::OK(); -} - -} // namespace contrib -} // namespace onnxruntime - -#endif diff --git a/onnxruntime/contrib_ops/cpu/transformers/beam_search.cc b/onnxruntime/contrib_ops/cpu/transformers/beam_search.cc index 4cc3533f45e79..c37ae8caa5eef 100644 --- a/onnxruntime/contrib_ops/cpu/transformers/beam_search.cc +++ b/onnxruntime/contrib_ops/cpu/transformers/beam_search.cc @@ -183,7 +183,10 @@ Status BeamSearch::Compute(OpKernelContext* ctx) const { device_copy_func_ ? device_copy_func_ : BeamSearchCpuDeviceHelper::DeviceCopy, device_copy_int32_func_ ? device_copy_int32_func_ : BeamSearchCpuDeviceHelper::DeviceCopy, create_encoder_inputs_func_ ? create_encoder_inputs_func_ : BeamSearchCpuDeviceHelper::CreateEncoderInputs, - update_decoder_feeds_func_ ? update_decoder_feeds_func_ : BeamSearchCpuDeviceHelper::UpdateDecoderFeeds}; + update_decoder_feeds_func_ ? update_decoder_feeds_func_ : BeamSearchCpuDeviceHelper::UpdateDecoderFeeds, + expand_buffer_int32_func_ ? expand_buffer_int32_func_ : BeamSearchCpuDeviceHelper::ExpandBuffer, + expand_buffer_float_func_ ? expand_buffer_float_func_ : BeamSearchCpuDeviceHelper::ExpandBuffer, + expand_buffer_float16_func_ ? expand_buffer_float16_func_ : BeamSearchCpuDeviceHelper::ExpandBuffer}; ORT_RETURN_IF_ERROR(impl.Initialize()); return impl.Execute(*encoder_feeds_fetches_manager_, *decoder_feeds_fetches_manager_); @@ -198,7 +201,10 @@ Status BeamSearch::Compute(OpKernelContext* ctx) const { device_copy_func_, device_copy_int32_func_, create_encoder_inputs_func_, - update_decoder_feeds_fp16_func_}; + update_decoder_feeds_fp16_func_, + expand_buffer_int32_func_, + expand_buffer_float_func_, + expand_buffer_float16_func_}; ORT_RETURN_IF_ERROR(impl.Initialize()); diff --git a/onnxruntime/contrib_ops/cpu/transformers/beam_search.h b/onnxruntime/contrib_ops/cpu/transformers/beam_search.h index 3a0de820106e8..f9cb7d66c585a 100644 --- a/onnxruntime/contrib_ops/cpu/transformers/beam_search.h +++ b/onnxruntime/contrib_ops/cpu/transformers/beam_search.h @@ -74,9 +74,15 @@ class BeamSearch : public IControlFlowKernel { // device helpers for encoder-decoder model like T5 void SetDeviceHelpers_EncoderDecoder( const BeamSearchDeviceHelper::UpdateDecoderFeedsFunc& update_decoder_feeds_func, - const BeamSearchDeviceHelper::UpdateDecoderFeedsFunc& update_decoder_feeds_fp16_func) { + const BeamSearchDeviceHelper::UpdateDecoderFeedsFunc& update_decoder_feeds_fp16_func, + const BeamSearchDeviceHelper::ExpandBufferFunc& expand_buffer_int32_func, + const BeamSearchDeviceHelper::ExpandBufferFunc& expand_buffer_float_func, + const BeamSearchDeviceHelper::ExpandBufferFunc& expand_buffer_float16_func) { update_decoder_feeds_func_ = update_decoder_feeds_func; update_decoder_feeds_fp16_func_ = update_decoder_feeds_fp16_func; + expand_buffer_int32_func_ = expand_buffer_int32_func; + expand_buffer_float_func_ = expand_buffer_float_func; + expand_buffer_float16_func_ = expand_buffer_float16_func; } private: @@ -106,6 +112,10 @@ class BeamSearch : public IControlFlowKernel { BeamSearchDeviceHelper::UpdateDecoderFeedsFunc update_decoder_feeds_func_; BeamSearchDeviceHelper::UpdateDecoderFeedsFunc update_decoder_feeds_fp16_func_; + BeamSearchDeviceHelper::ExpandBufferFunc expand_buffer_int32_func_; + BeamSearchDeviceHelper::ExpandBufferFunc expand_buffer_float_func_; + BeamSearchDeviceHelper::ExpandBufferFunc expand_buffer_float16_func_; + //------------------------------------------------------------ // Subgraph and FeedsFetchesManager re-used for each subgraph execution. //------------------------------------------------------------ diff --git a/onnxruntime/contrib_ops/cpu/transformers/beam_search_device_helper.cc b/onnxruntime/contrib_ops/cpu/transformers/beam_search_device_helper.cc index 2e6af56fc4736..7b163dd923a31 100644 --- a/onnxruntime/contrib_ops/cpu/transformers/beam_search_device_helper.cc +++ b/onnxruntime/contrib_ops/cpu/transformers/beam_search_device_helper.cc @@ -60,6 +60,48 @@ void ExpandInputs(const OrtValue& input, int num_beams, AllocatorPtr allocator, } } +// TODO(wy): Dispatch it to avoid passing multiple functions to interface. +template +Status ExpandBuffer(void* stream, + const OrtValue& input, + int num_beams, + AllocatorPtr allocator, + OrtValue& expanded, + bool only_copy_shape) { + // Input shape (batch_size, xxx). The input is required with data type T. + // Output shape (batch_size * num_beams, xxx) + ORT_UNUSED_PARAMETER(stream); + + const TensorShape& input_shape = input.Get().Shape(); + const int64_t& batch_size = input_shape[0]; + const int64_t& chunk_size = static_cast(input_shape.Size() / batch_size); + + int64_t dims[4] = {0}; + input_shape.CopyDims(dims, input_shape.NumDimensions()); + dims[0] = batch_size * num_beams; + TensorShape expanded_shape(&dims[0], input_shape.NumDimensions()); + + MLDataType element_type = input.Get().DataType(); + ORT_ENFORCE(element_type == DataTypeImpl::GetType()); + Tensor::InitOrtValue(element_type, expanded_shape, allocator, expanded); + + if (only_copy_shape) { + return Status::OK(); + } + + const T* input_data = input.Get().Data(); + T* expanded_data = expanded.GetMutable()->MutableData(); + T* target = expanded_data; + for (int i = 0; i < batch_size; i++) { + for (int j = 0; j < num_beams; j++) { + memcpy(target, input_data + i * chunk_size, sizeof(T) * chunk_size); + target += chunk_size; + } + } + + return Status::OK(); +} + Status CreateGptInputs( const Tensor* original_input_ids, int num_beams, @@ -200,37 +242,45 @@ Status ProcessLogits(const OrtValue& logits, // const TensorShape& logits_shape = logits.Get().Shape(); ORT_ENFORCE(logits_shape.NumDimensions() == 3); auto input_length = logits_shape[1]; + auto logits_batch_size = logits_shape[0]; // Get logits for the last token: // next_token_logits = logits[:, -1, :], and the result shape is (batch_size * num_beams, vocab_size) // When input_length == 1, use logits directly in SoftmaxCPU below so it only need for input_length > 1. gsl::span& next_token_logits = beam_state->next_token_logits; - if (input_length > 1) { + + if (input_length > 1 || logits_batch_size == batch_size) { const T* current_logits = logits_data + (input_length - 1) * vocab_size; for (int i = 0; i < batch_beam_size; i++) { gsl::span source(current_logits, vocab_size); gsl::span target = next_token_logits.subspan(SafeInt(i) * vocab_size, static_cast(vocab_size)); gsl::copy(source, target); - current_logits += input_length * vocab_size; + if (logits_batch_size == batch_beam_size) { + current_logits += input_length * vocab_size; + } else if (logits_batch_size == batch_size && i % num_beams == num_beams - 1) { + current_logits += input_length * vocab_size; + } } } #ifdef DEBUG_BEAM_SEARCH dumper->Print("logits", logits); - if (input_length > 1) { + if (input_length > 1 || logits_batch_size == batch_size) { dumper->Print("next_token_logits", next_token_logits.data(), batch_size, num_beams, vocab_size); } #endif // Get scores for candidates of next token: next_token_scores = log_softmax(next_token_logits, dim=-1) gsl::span& next_token_scores = beam_state->next_token_scores; - ORT_RETURN_IF_ERROR(SoftmaxCPU(batch_beam_size, // rows - vocab_size, // elements per row - input_length > 1 ? next_token_logits.data() : logits_data, - next_token_scores.data(), - true, - thread_pool)); + ORT_RETURN_IF_ERROR( + SoftmaxCPU( + batch_beam_size, // rows + vocab_size, // elements per row + (input_length == 1 && logits_batch_size == batch_beam_size) ? logits_data : next_token_logits.data(), + next_token_scores.data(), + true, + thread_pool)); #ifdef DEBUG_BEAM_SEARCH dumper->Print("next_token_scores after softmax", next_token_scores.data(), batch_size, num_beams, vocab_size); @@ -456,13 +506,12 @@ Status UpdateGptFeeds( Status CreateEncoderInputs( const Tensor* original_encoder_input_ids, const OrtValue* attn_mask_value, - int num_beams, int pad_token_id, int start_token_id, AllocatorPtr allocator, - OrtValue& expanded_encoder_input_ids, - OrtValue& expanded_encoder_attention_mask, - OrtValue& expanded_decoder_input_ids) { + OrtValue& encoder_input_ids, + OrtValue& encoder_attention_mask, + OrtValue& decoder_input_ids) { const TensorShape& input_ids_shape = original_encoder_input_ids->Shape(); ORT_ENFORCE(input_ids_shape.NumDimensions() == 2); const int64_t& batch_size = input_ids_shape[0]; @@ -475,14 +524,12 @@ Status CreateEncoderInputs( // Current shape is (batch_size, sequence_length) // Note that we will expand it to (batch_size * num_beams, sequence_length) later. // To avoid cloning input_ids, we use const_cast here since this function does not change its content. - OrtValue encoder_input_ids; Tensor::InitOrtValue(element_type, input_ids_shape, const_cast(original_encoder_input_ids)->MutableData(), allocator->Info(), encoder_input_ids); - OrtValue encoder_attention_mask; if (attn_mask_value != nullptr) { const Tensor& attention_mask = attn_mask_value->Get(); Tensor::InitOrtValue(element_type, input_ids_shape, const_cast(&attention_mask)->MutableData(), @@ -511,20 +558,14 @@ Status CreateEncoderInputs( } } - // Expand (batch_size, sequence_length) to (batch_size * num_beams, sequence_length) - // for encoder_input_ids and encoder_attention_mask - // TODO(tianleiwu): Try expand outputs after first subgraph call instead. That may get better performance. - ExpandInputs(encoder_input_ids, num_beams, allocator, expanded_encoder_input_ids); - ExpandInputs(encoder_attention_mask, num_beams, allocator, expanded_encoder_attention_mask); - // decoder_input_ids is optional. if (start_token_id >= 0) { - // Expanded decoder_input_ids has shape (batch_size * num_beams, 1), and filled with start token ID - int64_t dims[] = {batch_size * num_beams, 1}; + // Filled decoder_input_ids with start token ID + int64_t dims[] = {batch_size, 1}; TensorShape decoder_input_ids_shape(&dims[0], 2); - Tensor::InitOrtValue(element_type, decoder_input_ids_shape, allocator, expanded_decoder_input_ids); - int32_t* data = expanded_decoder_input_ids.GetMutable()->MutableData(); - for (int i = 0; i < batch_size * num_beams; i++, data++) { + Tensor::InitOrtValue(element_type, decoder_input_ids_shape, allocator, decoder_input_ids); + int32_t* data = decoder_input_ids.GetMutable()->MutableData(); + for (int i = 0; i < batch_size; i++, data++) { *data = start_token_id; } } @@ -602,7 +643,7 @@ Status UpdateDecoderFeeds( TensorShape input_ids_shape(&dims[0], 2); Tensor::InitOrtValue(DataTypeImpl::GetType(), input_ids_shape, allocator, input_ids); - // TODO: decouple has_hidden_state with full input_ids + // TODO(wy): decouple has_hidden_state with full input_ids if (has_hidden_state) { gsl::copy(beam_next_tokens, input_ids.GetMutable()->MutableDataAsSpan()); } else { @@ -709,6 +750,30 @@ template Status UpdateDecoderFeeds( template void ExpandInputs(const OrtValue& input, int num_beams, AllocatorPtr allocator, OrtValue& expanded); +template Status ExpandBuffer( + void* stream, + const OrtValue& input, + int num_beams, + AllocatorPtr allocator, + OrtValue& expanded, + bool only_copy_shape); + +template Status ExpandBuffer( + void* stream, + const OrtValue& input, + int num_beams, + AllocatorPtr allocator, + OrtValue& expanded, + bool only_copy_shape); + +template Status ExpandBuffer( + void* stream, + const OrtValue& input, + int num_beams, + AllocatorPtr allocator, + OrtValue& expanded, + bool only_copy_shape); + } // namespace BeamSearchCpuDeviceHelper } // namespace contrib } // namespace onnxruntime diff --git a/onnxruntime/contrib_ops/cpu/transformers/beam_search_device_helper.h b/onnxruntime/contrib_ops/cpu/transformers/beam_search_device_helper.h index 8cd7a0291af0c..ab18eec25cde0 100644 --- a/onnxruntime/contrib_ops/cpu/transformers/beam_search_device_helper.h +++ b/onnxruntime/contrib_ops/cpu/transformers/beam_search_device_helper.h @@ -107,13 +107,12 @@ using UpdateGptFeedsFunc = std::function; + OrtValue& encoder_input_ids, + OrtValue& encoder_attention_mask, + OrtValue& decoder_input_ids)>; // Update decoder inputs given decoder outputs of last iteration (for encoder-decoder model like T5). template @@ -132,8 +131,18 @@ using UpdateDecoderFeedsFunc = std::function; + +template +using ExpandBufferFunc = std::function; } // namespace BeamSearchDeviceHelper + // These are CPU specific device helper implementations namespace BeamSearchCpuDeviceHelper { Status TopK( @@ -212,13 +221,12 @@ Status UpdateGptFeeds( Status CreateEncoderInputs( const Tensor* original_encoder_input_ids, const OrtValue* attn_mask_value, - int num_beams, int pad_token_id, int start_token_id, AllocatorPtr allocator, - OrtValue& expanded_encoder_input_ids, - OrtValue& expanded_encoder_attention_mask, - OrtValue& expanded_decoder_input_ids); + OrtValue& encoder_input_ids, + OrtValue& encoder_attention_mask, + OrtValue& decoder_input_ids); // Update decoder inputs given decoder outputs of last iteration. template @@ -244,6 +252,15 @@ Status UpdateDecoderFeeds( template void ExpandInputs(const OrtValue& input, int num_beams, AllocatorPtr allocator, OrtValue& expanded); +template +Status ExpandBuffer( + void* stream, + const OrtValue& input, + int num_beams, + AllocatorPtr allocator, + OrtValue& expanded, + bool only_copy_shape); + } // namespace BeamSearchCpuDeviceHelper } // namespace contrib } // namespace onnxruntime diff --git a/onnxruntime/contrib_ops/cpu/transformers/beam_search_impl_base.h b/onnxruntime/contrib_ops/cpu/transformers/beam_search_impl_base.h index 03c88b5aa8047..790e96a4476b5 100644 --- a/onnxruntime/contrib_ops/cpu/transformers/beam_search_impl_base.h +++ b/onnxruntime/contrib_ops/cpu/transformers/beam_search_impl_base.h @@ -95,7 +95,7 @@ struct BeamSearchCpuState : public IBeamSearchCpuState { this->sequences.Init(this->sequences_space, static_cast(batch_beam_size), sequence_length, max_length); } - // Copy input_ids to sequences[0] + // Copy expanded input_ids to sequences[0] void SetSequence(gsl::span input_ids_in_cpu, size_t batch_beam_size, int max_length, @@ -109,6 +109,21 @@ struct BeamSearchCpuState : public IBeamSearchCpuState { } } + // Copy unexpanded input_ids to sequences[0] + void SetSequence(gsl::span input_ids_in_cpu, + size_t batch_beam_size, + int beam_size, + int max_length, + int sequence_length) { + gsl::span sequences_0 = sequences_space; + for (size_t i = 0; i < batch_beam_size; i++) { + for (int j = 0; j < sequence_length; j++) { + const size_t index = SafeInt(i) * max_length + j; + sequences_0[index] = input_ids_in_cpu[SafeInt(i / beam_size) * sequence_length + j]; + } + } + } + private: BufferUniquePtr final_beam_scores_buffer_; BufferUniquePtr sequence_lengths_buffer_; diff --git a/onnxruntime/contrib_ops/cpu/transformers/beam_search_impl_t5.h b/onnxruntime/contrib_ops/cpu/transformers/beam_search_impl_t5.h index 6acbe857e5a72..5360bfd8f4cfd 100644 --- a/onnxruntime/contrib_ops/cpu/transformers/beam_search_impl_t5.h +++ b/onnxruntime/contrib_ops/cpu/transformers/beam_search_impl_t5.h @@ -33,7 +33,10 @@ class BeamSearchT5 : public BeamSearchBase { const BeamSearchDeviceHelper::DeviceCopyFunc& device_copy_func, const BeamSearchDeviceHelper::DeviceCopyFunc& device_copy_int32_func, const BeamSearchDeviceHelper::CreateEncoderInputsFunc& create_encoder_inputs_func, - const BeamSearchDeviceHelper::UpdateDecoderFeedsFunc& update_decoder_feeds_func) + const BeamSearchDeviceHelper::UpdateDecoderFeedsFunc& update_decoder_feeds_func, + const BeamSearchDeviceHelper::ExpandBufferFunc& expand_buffer_int32_func, + const BeamSearchDeviceHelper::ExpandBufferFunc& expand_buffer_float_func, + const BeamSearchDeviceHelper::ExpandBufferFunc& expand_buffer_float16_func) : BeamSearchBase(context, decoder_session_state, thread_pool, cuda_stream, cuda_dumper, params, topk_func, process_logits_func, device_copy_func, device_copy_int32_func), @@ -43,7 +46,10 @@ class BeamSearchT5 : public BeamSearchBase { add_to_feeds_func_(add_to_feeds_func), init_beam_state_func_(init_beam_state_func), create_encoder_inputs_func_(create_encoder_inputs_func), - update_decoder_feeds_func_(update_decoder_feeds_func) { + update_decoder_feeds_func_(update_decoder_feeds_func), + expand_buffer_int32_func_(expand_buffer_int32_func), + expand_buffer_float_func_(expand_buffer_float_func), + expand_buffer_float16_func_(expand_buffer_float16_func) { } // Execute beam search in iterations util stopping criteria is reached. @@ -62,6 +68,9 @@ class BeamSearchT5 : public BeamSearchBase { BeamSearchDeviceHelper::CreateEncoderInputsFunc create_encoder_inputs_func_; BeamSearchDeviceHelper::UpdateDecoderFeedsFunc update_decoder_feeds_func_; + BeamSearchDeviceHelper::ExpandBufferFunc expand_buffer_int32_func_; + BeamSearchDeviceHelper::ExpandBufferFunc expand_buffer_float_func_; + BeamSearchDeviceHelper::ExpandBufferFunc expand_buffer_float16_func_; }; template @@ -110,19 +119,18 @@ Status BeamSearchT5::Execute(const FeedsFetchesManager& encoder_feeds_fetches this->IsCuda()); IAllocatorUniquePtr buffer; - OrtValue expanded_decoder_input_ids; // Tensor in CPU, and it will be used to initialize sequence in cpu_state + OrtValue decoder_input_ids; // Tensor in CPU, and it will be used to initialize sequence in cpu_state ORT_RETURN_IF_ERROR(this->encoder_subgraph_.CreateInitialFeeds( encoder_input_ids, encoder_attn_mask_value, this->implicit_inputs_, - parameters->num_beams, parameters->pad_token_id, parameters->decoder_start_token_id, encoder_feeds, this->create_encoder_inputs_func_, this->add_to_feeds_func_, buffer, - expanded_decoder_input_ids)); + decoder_input_ids)); ORT_RETURN_IF_ERROR(utils::ExecuteSubgraph(this->encoder_session_state_, encoder_feeds_fetches_manager, @@ -150,9 +158,10 @@ Status BeamSearchT5::Execute(const FeedsFetchesManager& encoder_feeds_fetches // Initialize resources // ------------------------------------ - // Copy expanded_decoder_input_ids (in CPU) to sequence. It contains decoder_start_token_id for each beam. - cpu_state.SetSequence(expanded_decoder_input_ids.Get().DataAsSpan(), + // Copy decoder_input_ids (in CPU) to sequence. It contains decoder_start_token_id for each beam. + cpu_state.SetSequence(decoder_input_ids.Get().DataAsSpan(), static_cast(parameters->BatchBeamSize()), + parameters->num_beams, parameters->max_length, parameters->sequence_length); @@ -211,6 +220,10 @@ Status BeamSearchT5::Execute(const FeedsFetchesManager& encoder_feeds_fetches encoder_fetches, decoder_feeds, this->device_copy_int32_func_, + this->expand_buffer_int32_func_, + this->expand_buffer_float_func_, + this->expand_buffer_float16_func_, + parameters->num_beams, this->cuda_stream_)); } diff --git a/onnxruntime/contrib_ops/cpu/transformers/subgraph_t5_decoder.cc b/onnxruntime/contrib_ops/cpu/transformers/subgraph_t5_decoder.cc index bb931255dd177..7918a333094c4 100644 --- a/onnxruntime/contrib_ops/cpu/transformers/subgraph_t5_decoder.cc +++ b/onnxruntime/contrib_ops/cpu/transformers/subgraph_t5_decoder.cc @@ -121,6 +121,10 @@ Status T5DecoderSubgraph::CreateInitialFeeds( const std::vector& encoder_fetches, std::vector& decoder_feeds, const BeamSearchDeviceHelper::DeviceCopyFunc& device_copy_int32_func, + const BeamSearchDeviceHelper::ExpandBufferFunc& expand_buffer_int32_func, + const BeamSearchDeviceHelper::ExpandBufferFunc& expand_buffer_float_func, + const BeamSearchDeviceHelper::ExpandBufferFunc& expand_buffer_float16_func, + int num_beam, void* stream) { ORT_ENFORCE(session_state_ != nullptr, "Setup must be called before CreateInitialFeeds"); @@ -144,13 +148,58 @@ Status T5DecoderSubgraph::CreateInitialFeeds( decoder_feeds.push_back(input_ids); // The encoder_attention_mask is copied from the second input of encoder. - decoder_feeds.push_back(encoder_feeds[1]); + OrtValue expanded_decoder_attention_masks; + ORT_RETURN_IF_ERROR(expand_buffer_int32_func(stream, + encoder_feeds[1], + num_beam, + allocator, + expanded_decoder_attention_masks, + false)); + + decoder_feeds.push_back(expanded_decoder_attention_masks); // When first_past_input_index_ == 3, the encoder_hidden_states and past states are copied from the second output // of encoder. // When first_past_input_index_ == 2, the past states are copied from the second output of encoder. for (size_t j = 4 - first_past_input_index_; j < encoder_fetches.size(); j++) { - decoder_feeds.push_back(encoder_fetches[j]); + if (j == 1) { + ORT_RETURN_IF(has_hidden_state_ == false, "Invalid hidden_states expension: has_hidden_state_ == false"); + OrtValue expanded_hidden_states; + if (is_output_float16_) { + ORT_RETURN_IF_ERROR(expand_buffer_float16_func(stream, + encoder_fetches[j], + num_beam, + allocator, + expanded_hidden_states, + true)); + } else { + ORT_RETURN_IF_ERROR(expand_buffer_float_func(stream, + encoder_fetches[j], + num_beam, + allocator, + expanded_hidden_states, + true)); + } + decoder_feeds.push_back(expanded_hidden_states); + } else { + OrtValue expanded_cache; + if (is_output_float16_) { + ORT_RETURN_IF_ERROR(expand_buffer_float16_func(stream, + encoder_fetches[j], + num_beam, + allocator, + expanded_cache, + false)); + } else { + ORT_RETURN_IF_ERROR(expand_buffer_float_func(stream, + encoder_fetches[j], + num_beam, + allocator, + expanded_cache, + false)); + } + decoder_feeds.push_back(expanded_cache); + } } // Pass through implicit inputs. diff --git a/onnxruntime/contrib_ops/cpu/transformers/subgraph_t5_decoder.h b/onnxruntime/contrib_ops/cpu/transformers/subgraph_t5_decoder.h index 108b1c298d759..edf7293a978c1 100644 --- a/onnxruntime/contrib_ops/cpu/transformers/subgraph_t5_decoder.h +++ b/onnxruntime/contrib_ops/cpu/transformers/subgraph_t5_decoder.h @@ -28,6 +28,10 @@ class T5DecoderSubgraph : public Subgraph { const std::vector& encoder_fetches, std::vector& decoder_feeds, const BeamSearchDeviceHelper::DeviceCopyFunc& device_copy_int32_func, + const BeamSearchDeviceHelper::ExpandBufferFunc& expand_buffer_int32_func, + const BeamSearchDeviceHelper::ExpandBufferFunc& expand_buffer_float_func, + const BeamSearchDeviceHelper::ExpandBufferFunc& expand_buffer_float16_func, + int num_beam, void* stream); Status Validate(const std::vector& subgraph_inputs, diff --git a/onnxruntime/contrib_ops/cpu/transformers/subgraph_t5_encoder.cc b/onnxruntime/contrib_ops/cpu/transformers/subgraph_t5_encoder.cc index 7574c31ec5b6e..153deaa8cb822 100644 --- a/onnxruntime/contrib_ops/cpu/transformers/subgraph_t5_encoder.cc +++ b/onnxruntime/contrib_ops/cpu/transformers/subgraph_t5_encoder.cc @@ -96,24 +96,23 @@ Status T5EncoderSubgraph::Validate(const std::vector& subgraph_i // Create inputs for first inference of subgraph. Status T5EncoderSubgraph::CreateInitialFeeds( - const Tensor& encoder_input_ids, + const Tensor& original_encoder_input_ids, const OrtValue* attn_mask_value, const std::vector& implicit_inputs, - int num_beams, int pad_token_id, int start_token_id, std::vector& feeds, const BeamSearchDeviceHelper::CreateEncoderInputsFunc& create_encoder_inputs_func, const BeamSearchDeviceHelper::AddToFeedsFunc& add_to_feeds_func, IAllocatorUniquePtr& buffer, - OrtValue& expanded_decoder_input_ids) { + OrtValue& decoder_input_ids) { ORT_ENFORCE(session_state_ != nullptr, "Setup must be called before CreateInitialFeeds"); // The ordering is the same as used in Setup. feeds.reserve(static_cast(num_subgraph_inputs) + static_cast(num_implicit_inputs)); // Allocate subgraph inputs to be same device as encoder_input_ids. - AllocatorPtr cpu_allocator = session_state_->GetAllocator(encoder_input_ids.Location()); + AllocatorPtr cpu_allocator = session_state_->GetAllocator(original_encoder_input_ids.Location()); if (cpu_allocator == nullptr) { const IExecutionProvider* provider = GetProvider(); cpu_allocator = provider->GetAllocator(0, OrtMemTypeDefault); @@ -121,22 +120,21 @@ Status T5EncoderSubgraph::CreateInitialFeeds( ORT_RETURN_IF(cpu_allocator == nullptr, "cpu_allocator shouldn't be nullptr"); // TODO(tianleiwu): expand the outputs instead of inputs to save computation. - OrtValue expanded_encoder_input_ids; - OrtValue expanded_encoder_attention_mask; - ORT_RETURN_IF_ERROR(create_encoder_inputs_func(&encoder_input_ids, + OrtValue encoder_input_ids; + OrtValue encoder_attention_mask; + ORT_RETURN_IF_ERROR(create_encoder_inputs_func(&original_encoder_input_ids, attn_mask_value, - num_beams, pad_token_id, start_token_id, cpu_allocator, - expanded_encoder_input_ids, - expanded_encoder_attention_mask, - expanded_decoder_input_ids)); + encoder_input_ids, + encoder_attention_mask, + decoder_input_ids)); const IExecutionProvider* provider = GetProvider(); ORT_RETURN_IF_ERROR(add_to_feeds_func( provider, - {expanded_encoder_input_ids, expanded_encoder_attention_mask, expanded_decoder_input_ids}, + {encoder_input_ids, encoder_attention_mask, decoder_input_ids}, feeds, buffer)); diff --git a/onnxruntime/contrib_ops/cpu/transformers/subgraph_t5_encoder.h b/onnxruntime/contrib_ops/cpu/transformers/subgraph_t5_encoder.h index 83c9cb22c66a8..9c67f49621357 100644 --- a/onnxruntime/contrib_ops/cpu/transformers/subgraph_t5_encoder.h +++ b/onnxruntime/contrib_ops/cpu/transformers/subgraph_t5_encoder.h @@ -24,7 +24,6 @@ class T5EncoderSubgraph : public Subgraph { const Tensor& encoder_input_ids, const OrtValue* attn_mask_value, const std::vector& implicit_inputs, - int num_beams, int pad_token_id, int start_token_id, std::vector& feeds, diff --git a/onnxruntime/contrib_ops/cuda/transformers/beam_search.cc b/onnxruntime/contrib_ops/cuda/transformers/beam_search.cc index 91b660c197e1f..5e500f560131f 100644 --- a/onnxruntime/contrib_ops/cuda/transformers/beam_search.cc +++ b/onnxruntime/contrib_ops/cuda/transformers/beam_search.cc @@ -49,7 +49,10 @@ BeamSearch::BeamSearch(const OpKernelInfo& info) BeamSearchCudaDeviceHelper::UpdateGptFeeds); SetDeviceHelpers_EncoderDecoder(BeamSearchCudaDeviceHelper::UpdateDecoderFeeds, - BeamSearchCudaDeviceHelper::UpdateDecoderFeeds); + BeamSearchCudaDeviceHelper::UpdateDecoderFeeds, + BeamSearchCudaDeviceHelper::ExpandBuffer, + BeamSearchCudaDeviceHelper::ExpandBuffer, + BeamSearchCudaDeviceHelper::ExpandBuffer); SetConsoleDumper(&g_cuda_dumper); } diff --git a/onnxruntime/contrib_ops/cuda/transformers/beam_search_device_helper.cc b/onnxruntime/contrib_ops/cuda/transformers/beam_search_device_helper.cc index 3c45c2cc60b11..b712908259da1 100644 --- a/onnxruntime/contrib_ops/cuda/transformers/beam_search_device_helper.cc +++ b/onnxruntime/contrib_ops/cuda/transformers/beam_search_device_helper.cc @@ -221,6 +221,7 @@ Status ProcessLogits(const OrtValue& logits, // const TensorShape& logits_shape = logits.Get().Shape(); ORT_ENFORCE(logits_shape.NumDimensions() == 3); auto input_length = logits_shape[1]; + auto logits_batch_size = logits_shape[0]; cudaStream_t cuda_stream = reinterpret_cast(stream); @@ -228,21 +229,28 @@ Status ProcessLogits(const OrtValue& logits, // // next_token_logits = logits[:, -1, :], and the result shape is (batch_size * num_beams, vocab_size) // When input_length == 1, use logits directly in SoftmaxCPU below so it only need for input_length > 1. gsl::span& next_token_logits = beam_state->next_token_logits; - if (input_length > 1) { - // TODO(tianleiwu): use one kernel to replace a loop of memory copy. + + // TODO(tianleiwu): use one kernel to replace a loop of memory copy. + if (input_length > 1 || logits_batch_size == batch_size) { const CudaT* current_logits = logits_data + (input_length - 1) * vocab_size; for (int i = 0; i < batch_beam_size; i++) { gsl::span source(reinterpret_cast(current_logits), vocab_size); gsl::span target = next_token_logits.subspan(i * vocab_size, vocab_size); CUDA_RETURN_IF_ERROR(cudaMemcpyAsync(target.data(), source.data(), sizeof(T) * vocab_size, cudaMemcpyDeviceToDevice, cuda_stream)); - current_logits += input_length * vocab_size; + if (logits_batch_size == batch_beam_size) { + current_logits += input_length * vocab_size; + } else if (logits_batch_size == batch_size && i % num_beams == num_beams - 1) { + current_logits += input_length * vocab_size; + } } } #ifdef DEBUG_BEAM_SEARCH dumper->Print("logits", logits); - dumper->Print("next_token_logits", next_token_logits.data(), batch_size, num_beams, vocab_size); + if (input_length > 1 || logits_batch_size == batch_size) { + dumper->Print("next_token_logits", next_token_logits.data(), batch_size, num_beams, vocab_size); + } #endif // Get scores for candidates of next token: next_token_scores = log_softmax(next_token_logits, dim=-1) @@ -250,7 +258,9 @@ Status ProcessLogits(const OrtValue& logits, // // The output will be float for consideration of precision and easy integration with remaining parts. float* Y_data = next_token_scores.data(); - const CudaT* X_data = input_length > 1 ? reinterpret_cast(next_token_logits.data()) : logits_data; + const CudaT* X_data = (input_length == 1 && logits_batch_size == batch_beam_size) ? + logits_data : + reinterpret_cast(next_token_logits.data()); dispatch_blockwise_softmax_forward( cuda_stream, Y_data, X_data, vocab_size, vocab_size, batch_size * num_beams); @@ -618,6 +628,53 @@ Status UpdateDecoderFeeds( t5_decoder_first_past_input_idx, t5_decoder_first_present_output_idx, stream); } +template +Status ExpandBuffer(void* stream, + const OrtValue& input, + int num_beams, + AllocatorPtr allocator, + OrtValue& expanded, + bool only_copy_shape) { + // Input shape (batch_size, xxx). The input is required with data type T. + // Output shape (batch_size * num_beams, xxx) + const TensorShape& input_shape = input.Get().Shape(); + const int64_t& batch_size = input_shape[0]; + const int64_t& chunk_size = static_cast(input_shape.Size() / batch_size); + + int64_t dims[4] = {0}; + input_shape.CopyDims(dims, input_shape.NumDimensions()); + dims[0] = batch_size * num_beams; + TensorShape expanded_shape(&dims[0], input_shape.NumDimensions()); + + MLDataType element_type = input.Get().DataType(); + ORT_ENFORCE(element_type == DataTypeImpl::GetType()); + Tensor::InitOrtValue(element_type, expanded_shape, allocator, expanded); + + if (only_copy_shape) { + return Status::OK(); + } + + cudaStream_t cuda_stream = reinterpret_cast(stream); + + const T* input_data = input.Get().Data(); + T* expanded_data = expanded.GetMutable()->MutableData(); + T* target = expanded_data; + for (int i = 0; i < batch_size; i++) { + for (int j = 0; j < num_beams; j++) { + CUDA_RETURN_IF_ERROR( + cudaMemcpyAsync( + target, + input_data + i * chunk_size, + sizeof(T) * chunk_size, + cudaMemcpyDeviceToDevice, + cuda_stream)); + target += chunk_size; + } + } + + return Status::OK(); +} + // Explicit template instantiations of functions template void InitBeamState(transformers::IBeamSearchState* beam_state, gsl::span& sequence_lengths, @@ -730,6 +787,29 @@ template Status UpdateDecoderFeeds( transformers::Sequences& sequences, const transformers::IConsoleDumper* dumper); +template Status ExpandBuffer( + void* stream, + const OrtValue& input, + int num_beams, + AllocatorPtr allocator, + OrtValue& expanded, + bool only_copy_shape); + +template Status ExpandBuffer( + void* stream, + const OrtValue& input, + int num_beams, + AllocatorPtr allocator, + OrtValue& expanded, + bool only_copy_shape); + +template Status ExpandBuffer( + void* stream, + const OrtValue& input, + int num_beams, + AllocatorPtr allocator, + OrtValue& expanded, + bool only_copy_shape); } // namespace BeamSearchCudaDeviceHelper } // namespace contrib } // namespace onnxruntime diff --git a/onnxruntime/contrib_ops/cuda/transformers/beam_search_device_helper.h b/onnxruntime/contrib_ops/cuda/transformers/beam_search_device_helper.h index a90d0c7ee84c8..14f64e923e781 100644 --- a/onnxruntime/contrib_ops/cuda/transformers/beam_search_device_helper.h +++ b/onnxruntime/contrib_ops/cuda/transformers/beam_search_device_helper.h @@ -97,6 +97,15 @@ Status UpdateDecoderFeeds( transformers::Sequences& sequences, const transformers::IConsoleDumper* dumper); +template +Status ExpandBuffer( + void* stream, + const OrtValue& input, + int num_beams, + AllocatorPtr allocator, + OrtValue& expanded, + bool only_copy_shape); + } // namespace BeamSearchCudaDeviceHelper } // namespace contrib } // namespace onnxruntime diff --git a/onnxruntime/core/common/threadpool.cc b/onnxruntime/core/common/threadpool.cc index ad12198091b55..c10a6ea70527f 100644 --- a/onnxruntime/core/common/threadpool.cc +++ b/onnxruntime/core/common/threadpool.cc @@ -657,6 +657,18 @@ std::string ThreadPool::StopProfiling(concurrency::ThreadPool* tp) { } } +void ThreadPool::EnableSpinning() { + if (extended_eigen_threadpool_) { + extended_eigen_threadpool_->EnableSpinning(); + } +} + +void ThreadPool::DisableSpinning() { + if (extended_eigen_threadpool_) { + extended_eigen_threadpool_->DisableSpinning(); + } +} + // Return the number of threads created by the pool. int ThreadPool::NumThreads() const { if (underlying_threadpool_) { diff --git a/onnxruntime/core/graph/contrib_ops/contrib_defs.cc b/onnxruntime/core/graph/contrib_ops/contrib_defs.cc index 8cf2d278e0ead..fb7bc16cc190a 100644 --- a/onnxruntime/core/graph/contrib_ops/contrib_defs.cc +++ b/onnxruntime/core/graph/contrib_ops/contrib_defs.cc @@ -16,7 +16,6 @@ #include "core/graph/contrib_ops/range_schema_defs.h" #include "core/graph/op.h" #include "core/mlas/inc/mlas.h" -#include "core/graph/signal_ops/signal_defs.h" #include "core/graph/contrib_ops/onnx_function_util.h" #include "onnx/defs/function.h" @@ -370,7 +369,6 @@ void sparseCompatibleMatmulShapeInference( updateOutputShape(ctx, 0, resultShape, default_tensor_type); } - bool ParseScalar(const TensorProto* initializer, int& value) { std::vector parsed_data; if (initializer->data_type() == TensorProto::INT32) { @@ -2417,7 +2415,6 @@ void RegisterContribSchemas() { // } // updateOutputShape(ctx, 0, disentangled_attention_shape); propagateShapeFromInputToOutput(ctx, 0, 0); - }); ONNX_CONTRIB_OPERATOR_SCHEMA(Snpe) @@ -2535,10 +2532,6 @@ This op functions in much the same was as Dropout-11 and Dropout-13 do, execpt t RegisterNchwcSchemas(); } #endif - -#ifdef BUILD_MS_EXPERIMENTAL_OPS - onnxruntime::signal::RegisterSignalSchemas(); -#endif } } // namespace contrib diff --git a/onnxruntime/core/graph/dml_ops/dml_defs.cc b/onnxruntime/core/graph/dml_ops/dml_defs.cc index 3e67c9e3a930d..58ebe84834f14 100644 --- a/onnxruntime/core/graph/dml_ops/dml_defs.cc +++ b/onnxruntime/core/graph/dml_ops/dml_defs.cc @@ -108,6 +108,7 @@ void RegisterDmlSchemas() { .Attr("spatial", "", AttributeProto::INT, static_cast(1)) .Attr("epsilon", "", AttributeProto::FLOAT, 1e-5f) .Attr("momentum", "", AttributeProto::FLOAT, 0.9f) + .Attr("training_mode", "", AttributeProto::INT, static_cast(0)) .Input(0, "X", "", "T") .Input(1, "scale", "", "T") .Input(2, "B", "", "T") diff --git a/onnxruntime/core/graph/function_utils.cc b/onnxruntime/core/graph/function_utils.cc index 41da29a7f1243..1ea90439fcf0c 100644 --- a/onnxruntime/core/graph/function_utils.cc +++ b/onnxruntime/core/graph/function_utils.cc @@ -12,6 +12,9 @@ namespace onnxruntime { namespace function_utils { +using string = std::string; +using namespace ONNX_NAMESPACE; + // Utilify function to get the imported version of domain from opset imports // Returns -1 if requested domain is not found in the opset_imports template