onnxruntime/csharp/tools/Microsoft.ML.OnnxRuntime.PerfTool/OnnxMl.cs
Thiago Crepaldi 8a890ddfd7
Sync ORTModule branch with master and fix tests (#6526)
* Deprecate Python global configuration functions [Part 1] (#5923)

Enable options to be set via execution provider (EP)-specific options and log deprecation warning from current global configuration functions.

* remove dnnl_dll_path from post build copy (#6142)

* Model Fusion For Bart (#6105)

Fusion fix for Bart models

* Unify IExecutionProvider and IExecutionProviderFactory interfaces (#6108)

* Remove Provider_IExecutionProvider and make the internal IExecutionProvider usable by shared providers
* Change Provider_IExecutionProviderFactory to be the core version.

* Enable running the mnist_training sample without cuda (#6085)

Signed-off-by: George Nash <george.nash@intel.com>

* nnapi add min max support (#6117)

* Fix CUDA test hang: (#6138)

- Make condition check in `CUDAAllocatorTest` to ensure CUDA device is present.

* Fix TensorRT kernel conflict issue for subgraphs of control flow operators (#6115)

* add static subgraph kernel index

* change kernel naming to avoid conflicts

* Add gradient registration for Abs. (#6139)

* Partition initial optimizer state for Zero-1 (#6093)

* Initial changes

* Working changes

* Working changes

* Cleanup

* fix windows CI

* Review comments

* review comments

* Fix edge case in BFCArena where allocation failures could lead to an infinite loop. (#6145)

#4656

* Revert "work around of the build break in mac (#6069)" (#6150)

This reverts commit 3cae28699b.

* Fix clean_docker_image_cache.py detection of image pushes. (#6151)

Fix clean_docker_image_cache.py detection of image pushes. They were being ignored because the expected HTTP status code was wrong. For pushes, it's 201 instead of 200.

* MLAS: add NEON version of int8 depthwise convolution (#6152)

* Using a map of of ops to stages as input of partition function. (#5940)

* New partition algorithm running before AD

* Convert cut_group_info into device map. Work in progress -- works for  bert-tiny with pp=2

* Removing code for partition of bwd graphs

* Remove old code

* Adding some verification code

* Handle Shared Initializer

* Renaming rank with stage

* Added first unit test

* new test

* redundant check

* undo change in bert

* Moved cut-based partition to testing utils file

Co-authored-by: xzhu1900
Co-authored-by: wschin

* New conversion function and tests

* minor

* remove test that is not needed2

* improve GetDeviceAssignment and PR comments

* minor changes

* PR comments

* improving documentation and variable naming

* add documentation

* Variable naming and docs

* more doc improvements

* more doc improvements

* missing static cast

* Fix test file for windows

* Fix test file for windows

* Fix test file for windows

* stage id is not the same as rank id

* PR comments

* PR comments

* More comments

* More comments

* Minor fix to satisfy c++14 (#6162)

* Deprecating Horovod and refactored Adasum computations (#5468)

deprecated horovod submodule
refactored adasum logic to be ort-native
added tests for native kernel and e2e tests

* Update TensorRT-ExecutionProvider.md (#6161)

* Bugfix for topk cuda kernel (#6164)

* fix the issue that std::numeric_limits cannot handle half type

* adding a test

Co-authored-by: Du Li <duli@OrtTrainingDev4.af05slrtruoetgaxwwjv5nsq5e.px.internal.cloudapp.net>

* Revert "Fuse MatMulIntegerToFloat only when scales are scalar (#6008)" (#6169)

This reverts commit f2dcba7afe.

* Remove ignored build warnings for pybind on Mac (#6165)

* save_checkpoint, load_checkpoint and aggregate_checkpoints (#6136)

* save_checkpoint and load_checkpoint implementations

* checkpoint aggregation logic

* unit tests for save_checkpoint, load_checkpoint and aggregate_checkpoints

* Don't try to bind unused inputs in the Training frontend (#6166)

* Update documentation for contributing a PR and add deprecation notices for PyOp and ORT server. (#6172)

* aggregate model states only for the case when mixed precision was true (#6176)

* [NNAPI EP] Enable per-channel quantization for QlinearConv  (#6155)

* Enable qlinearconv per-channel quantization

* Fix the android CI test failure

* Add Android Version Check for Per-Channel Quant

* Address PR comments

* Fix some minor issues

* Add verification of per-channel zero points

* Make the error tolerance configurable

* Fix typo in BERT pretraining script (#6175)

A misplaced `}` meant that the `'enable_adasum'` option was interpreted incorrectly, causing the test to fail.

* Update get_docker_image.py to enable use without image cache container registry. (#6177)

Update get_docker_image.py to enable use without image cache container registry.

* Helper for compiling EP to generate deterministic unique ids for use in MetaDef names (#6156)

* Create a helper for generating unique ids that can be used by an EP that creates compiled nodes and needs ids to be deterministic for a model when used in multiple sessions.

Added to IExecutionProvider as this can potentially be used by all compiling EPs and is more robust than a simplistic counter (although EP implementer is free to choose either approach).

* Restructure the helper so it can be called across the EP bridge.
Add ability to call id generation helper from EP bridge
  - convert DNNL EP to use helper to validate
Address issue where a new Model may be loaded into the same address as a previous one.
  - hash the bytes in the Graph instance (1728 bytes currently) to use as the key to the full hash for the model
Add lock around id generation to ensure no issues if multiple sessions partitions graphs at exactly the same time.
  - Extremely unlikely but would be hard to debug and the locking cost is not an issue as it's only incurred during graph partitioning and not execution.

* Backend APIs for checkpointing (#5803)

* Add backend API GetOptimizerState and GetModelState

* add GetPartitionInfoMap

* Android coverage dashboard (#6163)

* Write the report to a file.

* Post code coverage to the Dashboard database.

* Add usage details of unified MCR container image (#6182)

Going forward, a single unifed docker image will be published in
MCR. The hardware accelerator target choice will have to be made
in the application using OpenVINO EP's runtime config options.

* improve perf for softmax (#6128)

* improve perf for both gathergrad and softmax

* revert the change in gathergrad and will be done in another PR.

* address comments from code review.

* Tune fast Gelu to use exp(x) instead of tanh(x) on Rocm platform (#6174)

* tune fast gelu to use exp(x) instead of tanh(x) on rocm

* update to use expression 2/(1+exp(-2x))-1 for stability

* Add Status.csv to EP Perf Tool (#6167)

* merge master, keep postprocess status commit

* download float16.py everytime

* removing hardcoded values

* Lochi/quantization tool for trt (#6103)

* Initial implementation of generating calibration dynamic range table

* Initialize validation support for Quantization

* Initialize validation support for Quantization (cont.)

* Improve validation support for Quantization

* Improve validation support for Quantization

* Rewrite/Refine for calibration and validation

* Rewrite/Refine for calibration and validation (cont.)

* Refine code

* Refine code

* Add data reader for BERT

* Add flatbuffers to serialize calibration table

* Refine code and add BERT evaluation

* Refine the code

* minor modification

* Add preprocess/postprocess of vision team yolov3 and refine the code

* Update annotation

* Make bbox cooridates more accurate

* Fix bug

* Add support of batch processing

* Batch processing for model zoo yolov3

* Add batch inference for evaluation

* Refine the code

* Add README

* Add comments

* Refine the code for PR

* Remove batch support checking in data_reader and refine the code

* Refine the code for PR

* Refine the code for PR review

Co-authored-by: Olivia Jain <oljain@microsoft.com>

* Implement ScatterND for CUDA EP (#6184)

* Condition fix in Resize operator (#6193)

* Clean up checkpoint tests to use the new checkpoint functions (#6188)

* add deprecation warning for old checkpoint functions

* update all the distributed checkpoint tests to use new checkpoint functions

* Implement comparing outputs that are sequence of maps of strings to floats (#6180)

* Implement conversion from ortvalue to Itensor for string tensors and comparing sequence of maps of strings to floats

* PR comments

* Dockerfile to build onnxruntime with ROCm 4.0

* Add ability to skip GPU tests based on GPU adapter name (#6198)

* Implement conversion from ortvalue to Itensor for string tensors and comparing sequence of maps of strings to floats

* PR comments

* Add ability to skip gpu tests according to adapter description

* spacing

* spacing

* spacing

* Openvino ep 2021.2 (#6196)

* Enabling fasterrcnn variant and vehicle detector

* changes for 2021_2 branch

* yolov3_pytorch commit

* fixed braces in basic_backend.cc

* ci information added

* faster rcnn variant and vehicle detector changes were made in 2021.1 and not in 2021.2

* some changes to support unit tests

* disable some tests which are failing

* fix myriad tests for vehicle detector

* Did some cleanup
*cleaned up comments
*Disabled Add_Broadcast_0x1 and Add_Broadcast_1x0
tests on MYRIAD_FP16 backend due to a bug
*cleaned up capability_2021_2.cc file
*Removed extra conditions which were added
for some validation in backend_utils

Signed-off-by: MaajidKhan <n.maajidkhan@gmail.com>

* yolov3 pytorch workaround to ensure that the output names are matched

* gemmoptest fixed on myriad

* Fixed MYRIADX CPP Test Failures

*Expand,GatherND,Range,Round op's
are only supported in model

*where op with float input data
types are not supported and fixed

*Scatter and ScatterElements op's with
negative axis are fixed

*Reshape op with 0 dim value are not
supported and fixed

*Disabled InstanceNorm_2 test on MYRIADX

Signed-off-by: MaajidKhan <n.maajidkhan@gmail.com>

* make changes to yolov3 pytorch

* Fixed python unit tests
*Fixed failing python tests on vpu,
GPU and CPU

Signed-off-by: MaajidKhan <n.maajidkhan@gmail.com>

* Fixes POW op failures on GPU_FP16

Signed-off-by: MaajidKhan <n.maajidkhan@gmail.com>

* Clean up capability_2021_2.cc

Signed-off-by: MaajidKhan <n.maajidkhan@gmail.com>

* Updated docx for MultiThreading option
*Added extra info on setting the num_of_threads
option using the API and it's actual usage

Signed-off-by: MaajidKhan <n.maajidkhan@gmail.com>

* fixed slice and removed extra prints

* Disabled failing python tests

Signed-off-by: MaajidKhan <n.maajidkhan@gmail.com>

* Minor changes added in capabilty_2021_2

Signed-off-by: MaajidKhan <n.maajidkhan@gmail.com>

* made changes to slice to avoid failures

* Disabling FP16 support for GPU_FP32
->Inferencing an FP16 model on GPU_FP32
leads to accuracy mismatches. so, we would
rather use GPU_FP16 to infer an FP16 model
on GPU Device

Signed-off-by: MaajidKhan <n.maajidkhan@gmail.com>

* Updated docx for Inferencing a FP16 Model

Signed-off-by: MaajidKhan <n.maajidkhan@gmail.com>

* fix for mask rcnn

* Script for installing openvino from source

* Updated with openvino 2021.2 online installation

* code comment fixes
fixed accuracy mismatch for div

* Update OpenvinoEP-ExecutionProvider.md

updated for 2021.2 branch

* Update README.md

updated dockerfile documentation

* Update BUILD.md

build.md update documentation

* permissiong change of install_openvino.sh

* made changes to align with microsoft onnxruntime changes

* Updated with ov 2021.2.200

Co-authored-by: suryasidd <surya.siddharth.pemmaraju@intel.com>
Co-authored-by: sfatimar <sahar.fatima@intel/com>
Co-authored-by: MaajidKhan <n.maajidkhan@gmail.com>
Co-authored-by: mohdansx <mohdx.ansari@intel.com>

* Fix a memory leak in test_inference.cc (#6201)

* Fix a memory leak in test_inference.cc

* Use TArray in AMD element-wise kernels, rather than manually copying memory to device.

* Remove most ROCm-specific element-wise code and reuse CUDA element-wise code.

* Minor change to improve performance for operator Pad. (#5537)

* small improvment for pad

* Support double for operators Log, Reciprocal, Sum (CPU) (#6032)

* Support double for operators Log, Reciprocal, Sum
* remove tesdt erf_double

* Support double for operators Where, LpNormalisation (#6034)

* Support double for operators Relu, Tanh, Sigmoid (#6221)

* Fix ImportError in build.py (#6231)

There is a possible ImportError where build.py can import the wrong 'util' package if there are others present in `sys.path` already

* Removed executor todo that looks dead. (#6234)

* Remove MKLML/openblas/jemalloc build config (#6212)

* Remove python 3.5

* Update the readme file

* Upgrade build.py to assert for python 3.6+

Upgrade build.py to assert for python 3.6+
as python 3.5 cannot build anymore todays master.

* Support MLFloat16 type in Pow opset-12 CUDA kernel (#6233)

* MLAS: handle MlasGemm(M/N/K==0) cases (#6238)

* Support double for operator TopK + fix one bug in TopK implementation for GPU for double (#6220)

* Support double for operator TopK
* add static classes for topk/double
* fix cast issue in topk

* Support double for operator Gemm + fix bug in gemm implementation for cuda, rocm when sizeof(type) != sizeof(float) (#6223)

* Support double for operator Gemm
* fix type size while copying data in gemm operator for GPU
* fix type in gemm implementation for rocm

* Support double for operator ReduceMean, ReduceLogSumExp (#6217)

* Support double for operators ReduceMean, ReduceLogSumExp

* Support double for operator ArgMin (#6222)

* Support double for operator ArgMin
* add test specifically for double
* add new test on pai-excluded-tests.txt

* Update BUILD.md

* Update manylinux docker image to the latest (#6242)

* Fix allocator issue for TensorRT IOBinding (#6240)

* Fix issue: https://github.com/microsoft/onnxruntime/issues/6094

Root cause: we didn't expose the OrtMemoryInfo for TRT, so it will cause issue if user want use IObinding for Tensorrt.

Short term fix, add the OrtMemoryInfo for TRT. Long term should unify the allocator for CUDA and TRT

* Tune BiasGeluGradDx kernel in approximation mode to avoid tanh(...) on Rocm (#6239)

* bias gelu grad use exp(...) instead

* update cuda to rocm

* missing semicolon

* comment

* remove dockerfile

* missing factor of two

* Refactor EP Perf Tool  (#6202)

* merge master, keep postprocess status commit

* download float16.py everytime

* using variables to reference eps

* adding ACL EP to ep perf tool

* accuracy with absolute tolerance configurable

* add acl to dict + remove commented line

* Documentation for distributed CI tests pipeline (#6140)

* Remove a debug log in provider_test_utils.cc (#6200)

* Add the Concat Slice Elimination transform, fix constant_folding transform (#5457)

* Add concat slice transform + test

* Cosmetic improvements in concat slice transform

* Remove unrelated file, fix comment, fix constant folding bug

* Add test onnx graph

* fix windows build

* Review comments

* review comment

Co-authored-by: Aishwarya <aibhanda@OrtTrainingDev4.af05slrtruoetgaxwwjv5nsq5e.px.internal.cloudapp.net>

* Add MakeStringLite which uses current locale, update some MakeString call sites to use it instead. (#6252)

* Add MakeStringLite which uses current locale, update macros to use that to generate messages.

* Convert calls to MakeStringLite().

* Liqun/speech model loop to scan (#6070)

Provide a tool to convert Loop to Scan for Nuphar performance
Fix Nuphar CI pipeline failures.

Co-authored-by: liqun <liqun@OrtTrainingDev4.af05slrtruoetgaxwwjv5nsq5e.px.internal.cloudapp.net>

* model parallel refinement (#6244)

* Megatron Transformation as a seperate step

* remove useless header

* clang formating

* Re-Structure megatron transformer for subsquent changes

* fix  comments

* Allow querying a GraphProto's doc_string as part of ModelMetadata (#6248)

* Fix Linux/Mac error message on input type mismatch (#6256)

* add bfloat16 to gathergrad type constrains (#6267)

Co-authored-by: Cheng Tang <chenta@microsoft.com>

* Fix VS 2017 build break (#6276)

* Deprecate Python global configuration functions [Part 2] (#6171)

Update Python API to allow more flexibility for setting providers and provider options.

The providers argument (InferenceSession/TrainingSession constructors, InferenceSession.set_providers()) now also accepts a tuple of (name, options dict).
Fix get_available_providers() API (and the corresponding function in the C API) to return the providers in default priority order. Now it can be used as a starting point for the providers argument and maintain the default priority order.
Convert some usages of the deprecated global configuration functions to use EP-specific options instead.

Update some EP-specific option parsing to fail on unknown options.

Other clean up.

* Add script to preprocess python documentation before publishing (#6129)

* add script to preprocessing python documentation before publishing

* rename past to past_key_values for GPT-2 (#6269)

rename past to past_key_values for transformers 4.*

* Rename MakeString and ParseString functions. (#6272)

Rename MakeString to MakeStringWithClassicLocale, MakeStringLite to MakeString, *ParseString to *ParseStringWithClassicLocale.
Add missing pass-through versions of MakeStringWithClassicLocale for string types.

* Increase timeout for Linux GPU CUDA11 build. (#6280)

* Add helper to compare model with different precision (#6270)

* add parity_check_helper.py

* add real example

* remove lines

* Fix Min/Max CPU kernels for float16 type (#6205)

* fix data_ptr assertion error for past_sequence_length=0 in GPT-2 (#6284)

 fix io binding crash for past_sequence_length=0

* A list of changes in transformers tool (#6224)

* longformer fp16 e2e

* add fp16/fp32 parity check helper file

* excludes nodes with subgraph in profiling

* use onnxconverter_common to do fp32->fp16

* add version check for onnxconverter_common

* remove helper file

* add pkg installation on notebooks and script

* Workaround for static_cast<double>(half)

* Add workaround to remove ROCm-specific binary-elementwise files.

* Update nuget build (#6297)

1. Update the ProtoSrc path. The old one is not used anymore.
2. Regenerate OnnxMl.cs
3. Delete some unused code in tools/ci_build/build.py
4. Avoid set intra_op_param.thread_pool_size in ModelTests in OpenMP build.
5. Fix a typo in the C API pipeline.

* Enable ONNX backend test of SequenceProto input/output  (#6043)

* assert sequence tensor and remove skips

* update testdata json

* use ONNX 1.8 in cgmanifest.json

* use previous commit to workaround

* update ONNX commit ID in docker

* skip test_maxpool_2d_dilations test for now

* update function name

* add --sequence_lengths option (#6285)

* more dtype for Equal CUDA kernel (#6288)

Co-authored-by: Vincent Wang <weicwang@microsoft.com>

* Force reinstall onnx python package on Windows (#6309)

* update transformers required package versions (#6315)

* Remove abs in LpPool (#6303)

* Support 1D input for Conv + Mul/Add fusion optimizer with test (#6295)

* Support 1D input (N C H) for Conv + Mul/Add fusion optimizer with test cases and test models.

* Add longformer to  python package (#6314)

* add longformer to python package
* move test related script and data to a new folder

* Avoid false sharing on thread pool data structures (#6298)

Description: This change adds alignment and padding to avoid false sharing on fields in the thread pool. It also adds a new microbenchmark to profile thread-pool performance over short loops.

Motivation and Context
MobileNet on a 2*12-core system showed a performance gap between the ORT thread pool and OpenMP. One cause appeared to be false sharing on fields in the thread pool: ThreadPoolParallelSection::tasks_finished (which the main thread spins on waiting for workers to complete a loop), and the RunQueue::front_ and back_ fields (used respectively by the worker thread and the main thread).

The additional micro-benchmark BM_ThreadPoolSimpleParallelFor tests performance of loops of different sizes at different thread counts. The results below are on a machine with 2*14-core processors (E5-2690 v4) running with 1, 14, 15, and 28 threads. For each test, the microbenchmark has N threads run a loop with N iterations; hence a perfect result is for the time taken to be constant as additional threads are added (although we will also see power management effects helping at very low thread counts). The loop durations (100000, 10000, 1000) correspond roughly to 200us, 20us, and 2us on this machine.

Before change:
BM_ThreadPoolSimpleParallelFor/1/1/100000/real_time 17153 us 17154 us 32
BM_ThreadPoolSimpleParallelFor/14/14/100000/real_time 22553 us 22553 us 30
BM_ThreadPoolSimpleParallelFor/15/15/100000/real_time 21521 us 21521 us 29
BM_ThreadPoolSimpleParallelFor/28/28/100000/real_time 24111 us 24111 us 24
BM_ThreadPoolSimpleParallelFor/1/1/10000/real_time 1719 us 1719 us 407
BM_ThreadPoolSimpleParallelFor/14/14/10000/real_time 3409 us 3409 us 200
BM_ThreadPoolSimpleParallelFor/15/15/10000/real_time 3541 us 3541 us 201
BM_ThreadPoolSimpleParallelFor/28/28/10000/real_time 4576 us 4576 us 151
BM_ThreadPoolSimpleParallelFor/1/1/1000/real_time 174 us 174 us 4017
BM_ThreadPoolSimpleParallelFor/14/14/1000/real_time 1586 us 1586 us 402
BM_ThreadPoolSimpleParallelFor/15/15/1000/real_time 1586 us 1586 us 397
BM_ThreadPoolSimpleParallelFor/28/28/1000/real_time 2864 us 2864 us 232

After change:
BM_ThreadPoolSimpleParallelFor/1/1/100000/real_time 17160 us 17160 us 33
BM_ThreadPoolSimpleParallelFor/14/14/100000/real_time 20989 us 20989 us 31
BM_ThreadPoolSimpleParallelFor/15/15/100000/real_time 22286 us 22286 us 31
BM_ThreadPoolSimpleParallelFor/28/28/100000/real_time 24631 us 24631 us 25
BM_ThreadPoolSimpleParallelFor/1/1/10000/real_time 1718 us 1718 us 407
BM_ThreadPoolSimpleParallelFor/14/14/10000/real_time 2868 us 2868 us 242
BM_ThreadPoolSimpleParallelFor/15/15/10000/real_time 2907 us 2907 us 240
BM_ThreadPoolSimpleParallelFor/28/28/10000/real_time 3872 us 3872 us 186
BM_ThreadPoolSimpleParallelFor/1/1/1000/real_time 175 us 175 us 3938
BM_ThreadPoolSimpleParallelFor/14/14/1000/real_time 933 us 933 us 659
BM_ThreadPoolSimpleParallelFor/15/15/1000/real_time 912 us 912 us 591
BM_ThreadPoolSimpleParallelFor/28/28/1000/real_time 1976 us 1976 us 317

* fix opset imports for function body  (#6287)

* fix function opsets

* add tests and update onnx

* changes per review comments

* add comments

* plus updates

* build fix

* Remove false positive prefast warning from threadpool (#6324)

* Java: add Semmle to Java publishing pipelines (#6326)

Add Semmle to Java API pipeline
  Add security results publishing and add Java GPU.

* Quantization support for split operator with its NHWC support (#6107)

* Make split working for quantization.

* NHWC transformer support for split operator

* Refactor some according to Feedback. Will add test cases soon.

* Fix build error on windows.

* Add test case for split op on uint8_t support

* Add nhwc_transformer_test for split uint8_t support

* Some change according to PR feedbacks.

* Liqun/enable pipeline parallel test (#6331)

enable pipeline parallel test
Co-authored-by: liqun <liqun@OrtTrainingDev4.af05slrtruoetgaxwwjv5nsq5e.px.internal.cloudapp.net>

* Use onnxruntime_USE_FULL_PROTOBUF=OFF for the cuda execution provider (#6340)

This removes a special case of the cuda EP.

* MLAS: add fallback implementation for quantized GEMM (#6335)

Add a non-vectorized version of the kernel used for the quantized version of MlasGemm.

* Delete float16.py (#6336)

No longer needed. Also doesn't pass policheck.

* Enable add + softmax fusion for Rocm platform (#6259)

* add bias softmax; tests appear to pass

* check fusion occurs for rocm as well

* check for rocm provider compatible as well

* build for cpu scenario as well

* try again; broader cope

* proper scope on kGpuExecutionProvider

* been editing wrong file

* remove commented #include lines

* try again due to mac os ci error

* try again

* test fusion both cuda and rocm to avoid mac ci error

* add external data support to tensor proto utils (#6257)

* update unpack tensor utilities to support loading external data

* more updates

* fix test

* fix nuphar build

* minor build fix

* add tests

* fix Android CI

* fix warning

* fix DML build failure and some warnings

* more updates

* more updates

* plus few updates

* plus some refactoring

* changes per review

* plus some change

* remove temp code

* plus updates to safeint usage

* build fix

* fix for safeint

* changed wording. (#6337)

* Remove OpSchema dummy definition. Only needed for Function now, and we can just exclude the method in Function (#6321)

* remove gemmlowp submodule (#6341)

* [NNAPI] Add pow support (#6310)

* Add support for running Android emulator from build.py on Windows. (#6317)

* fix the pipeline failure (#6346)

* Train BERT Using BFloat16 on A100 (#6090)

* traing bert using bf16

* Adam support bf16

* bugfix

* add fusedmatmul support

* fix after merge from master.

* bugfix

* bugfix after merge from master

* fast reduction for bf16.

* resolve comments

* fix win build

* bugfix

* change header file.

Co-authored-by: Vincent Wang <weicwang@microsoft.com>

* Fix DerefNullPtr issues raised by SDLNativeRules. (#6348)

* update quantize to support basic optimization and e2e example for image classification (#6313)

update the resnet50-v1 to standard one from onnx zoo.
add an example for mobilenet
run basic optimization before quantization
fix a bug in Clip

* Enable graph save for orttrainer (#6333)

* Enable graph save for orttrainer

* Fix CI

* Update orttraining/orttraining/python/training/orttrainer_options.py

* Update orttraining/orttraining/python/training/orttrainer_options.py

* Update orttraining/orttraining/python/training/orttrainer_options.py

* Update orttraining/orttraining/python/training/orttrainer_options.py

* Update orttraining/orttraining/python/training/orttrainer_options.py

Co-authored-by: Thiago Crepaldi <thiago.crepaldi@microsoft.com>

* Add PREfast to python packaging pipeline (#6343)

* Add PREfast to python packaging pipeline

* fix longformer benchmark io_binding output_buffers (#6345)

* fix longformer benchmark io_binding output_buffers

* format

* import benchmark_helper from parent directory.

* Use readelf for minimal build binary size checks. (#6338)

* Use readelf for minimal build binary size checks.
The on-disk size grows in 4KB chunks which makes it hard to see how much growth an individual checkin causes.
Only downside is that the sum of the sections is larger than the on-disk size (assumably things get packed smaller on disk and some of the section alignment constraints can be ignored)

* Remove unused function

* Java: Set C language warnings to W4 and adjust JNI code (#6347)

Set /W3 for C language and fix up JNI warnings.

* Pipeline Parallel Experimental Python API (#5815)

* Add create session to WinML telemetry to track WinML Usage (#6356)

* Fix one more SDL warning (#6359)

* fix -Wdangling-gsl (#6357)

* Add python example of TensorRT INT8 inference on ResNet model (#6255)

* add trt int8 example on resnet model

* Update e2e_tensorrt_resnet_example.py

* remove keras dependency and update class names

* move ImageNetDataReader and ImageClassificationEvaluator to tensorrt resnet example

* simplify e2e_tensorrt_resnet_example.py

* Update preprocessing.py

* merge tensorrt_calibrate

* Update calibrate.py

* Update calibrate.py

* generalize calibrate

* Update calibrate.py

* fix issues

* fix formating

* remove augment_all

* This added telemetry isn't needed (#6363)

* Wezuo/memory analysis (#5658)

* merged alloc_plan

* pass compilation

* Start running, incorrect allocation memory info

* add in comments

* fix a bug of recording pattern too early.

* debugging lifetime

* fix lifetime

* passed mnist

* in process of visualization

* Add code to generate chrome trace for allocations.

* in process of collecting fragmentation

* before rebuild

* passed mnist

* passed bert tiny

* fix the inplace reuse

* fix the exception of weight in pinned memory

* add guards to ensure the tensor is in AllocPlan

* add customized profiling

* debugging

* debugging

* fix the reuse of differnt location type

* add rank

* add the rank

* add fragmentation

* add time_step_trace

* Add summary for each execution step (total bytes, used/free bytes).

* add top k

* change type of top k parameter

* remove prints

* change heap to set{

* add the name pattern

* add the useage for pattern

* add partition

* change to static class

* add custom group

* remove const

* update memory_info

* in process of adding it as runtime config

* change the memory profiling to be an argument

* add some comments

* add checks to recored meomry_info in traaining session

* set the "local rank setting" to correct argument.

* addressing comments

* format adjustment

* formatting

* remove alloc_interval

* update memory_info.cc to skip session when there is no tensor for a particular memory type

* fix memory_info multiple iteration seg-fault

* consolidate mainz changes

* fixed some minor errors

* guard by ORT_MINIMAL_BUILD

* add ORT_MEMORY_PROFILE flag

* added compiler flag to turn on/off memory profiling related code

* clean up the code regarding comments

* add comments

* revoke the onnx version

* clean up the code to match master

* clean up the code to match master

* clean up the code to match master

Co-authored-by: Jesse Benson <benson.jesse@gmail.com>
Co-authored-by: Wei Zuo <wezuo@OrtTrainingDev3.af05slrtruoetgaxwwjv5nsq5e.px.internal.cloudapp.net>
Co-authored-by: wezuo <wezuo@az-eus-v100-32gb-5-worker-mgtbby.eastus.cloudapp.azure.com>
Co-authored-by: wezuo <wezuo@az-eus-v100-32gb-5-worker-yclzsf.eastus.cloudapp.azure.com>

* Support MLFloat16 in CumSum Cuda op for Opset 14 (#6355)

* Add CumSum-14 for Cuda

* fix convert_common version retrival (#6382)

* Refine auto_pad based pad computation in ConvTranspose (#6305)

* Fix SDL warning (#6390)

* Add max_norm for gradient clipping. (#6289)

* add max_norm as user option for gradient clipping

* add adam and lamb test cases for clip norm

* add frontend tests

* Add the custom op project information (#6334)

* Dont use default string marshalling in C# (#6219)

* Fix Windows x86 compiler warnings in the optimizers project  (#6377)

* [Perf] Optimize Tile CPU and CUDA kernels for a corner case (#6376)

* Unblock Android CI code coverage failure (#6393)

* fix build on cuda11 (#6394)

Co-authored-by: Vincent Wang <weicwang@microsoft.com>

* Load the model path correctly (#6369)

* Fix some compile warnings (#6316)

* OpenVino docker file changes to bypass privileged mode

Description: Builds and installs libusb without UDEV support, which is used for communicating with the VPU device.

Motivation and Context

This enables the resulting docker container to be run without '--privileged' and '--network host' options which may not be suitable in deployment environments.

* Megatron checkpointing (#6293)

* Add bart fairseq run script

* Add frontend change to enable megatron

* Initial changes for checkpointing

* Megatron optim state loading, checkpoint aggregation, frontend distributed tests for H, D+H

* Add load_checkpoint changes

* Fix CI

* Cleanup

* Fix CI

* review comments

* review comments

* review comments:

* Fix generate_submodule_cgmanifest.py Windows issues. (#6404)

* Continue memory planning when unknown shape tensor is encountered. (#6413)

* Reintroduce experimental api changes and fix remote build break (#6385)

Co-authored-by: Ori Levari <orlevari@microsoft.com>

* Add support for custom ops to minimal build. (#6228)

* Add support for custom ops to minimal build.
Cost is only ~8KB so including in base minimal build.

* enable pipeline to run quantization tests (#6416)

* enable pipeline to run quantization tests
setup test pipeline for quantization

* Minor cmake change (#6431)

* Liqun/liqun/enable pipeline parallel test2 (#6399)

* enable data and pipeline parallism test

Co-authored-by: liqun <liqun@OrtTrainingDev4.af05slrtruoetgaxwwjv5nsq5e.px.internal.cloudapp.net>

* Farewell TrainableDropout (#5793)

* Deprecate TrainableDropout kernel.

* Update bert_toy_postprocessed.onnx to opset 12.

* Add more dropout tests.

* Fix BiasDropout kernel.

Co-authored-by: Ubuntu <OrtTrainingDev3@OrtTrainingDev3.af05slrtruoetgaxwwjv5nsq5e.px.internal.cloudapp.net>
Co-authored-by: Sherlock Huang <bahuang@OrtTrainingDev3.af05slrtruoetgaxwwjv5nsq5e.px.internal.cloudapp.net>
Co-authored-by: Sergii Dymchenko <sedymche@microsoft.com>

* fix null dereference warning (#6437)

* Expose graph ModelPath to TensorRT shared library (#6353)

* Update graph_viewer.cc

* Update tensorrt_execution_provider.cc

* Update graph_viewer.h

* Update tensorrt_execution_provider.cc

* Update tensorrt_execution_provider.cc

* Update provider_api.h

* Update provider_bridge_ort.cc

* Update provider_interfaces.h

* Update provider_interfaces.h

* expose GraphViewer ModelPath API to TRT shared lib

* add modelpath to compile

* update

* add model_path to onnx tensorrt parser

* use GenerateMetaDefId to generate unique TRT kernel name

* use GenerateMetaDefId to generate unique TRT engine name

* fix issue

* Update tensorrt_execution_provider.cc

* remove GetVecHash

* Update tensorrt_execution_provider.h

* convert wchar_t to char for tensorrt parser

* update tensorrt parser to include latest changes

* fix issues

* Update tensorrt_execution_provider.cc

* merge trt parser latest change

* add PROVIDER_DISALLOW_ALL(Path)

* add tool for generating test data for longformer (#6415)

* only build experimental api in redist (#6465)

Co-authored-by: Sheil Kumar <sheilk@microsoft.com>

* Add an option to save the training graph after optimization (#6410)

* expose optimized_model_filepath in SessionOptions as `debug.graph_save_paths.model_with_training_graph_after_optimization_path` in `ORTTrainerOptions`

* Share allocator between CUDA EP & TRT EP. (#6332)

* Share allocator between CUDA EP & TRT EP.
limitation:
1. Does not cover the per-thread allocator created by CUDA EP, still need to figure out the way to remove it
2. Need to have more identifiers to make it able to share CPU allocator across all EPs

* fix max norm clipping test in python packaging pipeline test (#6468)

* fix python packaging pipeline

* make clip norm test compatabile with both V100 and M60 GPUs

* Initial version of CoreML EP (#6392)

* Bug 31463811: Servicing: Redist (Nuget) conflicts with Microsoft.AI.MachineLearning starting 21H1+ (#6460)

* update load library code to have the fullly qualified path

* make it work for syswow32

* git Revert "make it work for syswow32"

This reverts commit b9f594341b7cf07241b18d0c376af905edcabae3.

Co-authored-by: Sheil Kumar <sheilk@microsoft.com>

* dequantize 1st input of lstm back if it is quantized (#6444)

* [java] Adds support for OrtEnvironment thread pools (#6406)

* Updates for Gradle 7.

* Adding support for OrtThreadingOptions into the Java API.

* Fixing a typo in the JNI code.

* Adding a test for the environment's thread pool.

* Fix cuda test, add comment to failure.

* Updating build.gradle

* fix SDL native rule warning #6246 (#6461)

* fix SDL rule (#6464)

* use tickcount64 (#6447)

Co-authored-by: Ori Levari <orlevari@microsoft.com>

* Update pypi package metadata (#6354)

* Update setup file data

* add missing comma

* remove python 3.5

* fix typo bracket

* Delete nuget extra configs (#6477)

* Op kernel type reduction infrastructure. (#6466)

Add infrastructure to support type reduction in Op kernel implementations.
Update Cast and IsInf CPU kernels to use it.

* Fixing a leak in OnnxSequences with String keys or values. (#6473)

* Increase the distributes tests pipeline timeout to 120 minutes (#6479)

* [CoreML EP] Add CI for CoreML EP (macOS) and add coreml_flags for EP options (#6481)

* Add macos coreml CI and coreml_flags

* Move save debuggubg model to use environment var

* Move pipeline off from macos CI template

* Fix an issue building using unix make, add parallel to build script

* Fixed build break for shared_lib and cmpile warning

* Fix a compile warning

* test

* Revert the accidental push from another branch

This reverts commit 472029ba25d50f9508474c9eeceb3454cead7877.

* Add ability to track per operator types in reduced build config. (#6428)

* Add ability to generate configuration that includes required types for individual operators, to allow build size reduction based on that.
  - Add python bindings for ORT format models
    - Add script to update bindings and help info
  - Add parsing of ORT format models
  - Add ability to enable type reduction to config generation
  - Update build.py to only allow operator/type reduction via config
    - simpler to require config to be generated first
    - can't mix a type aware (ORT format model only) and non-type aware config as that may result in insufficient types being enabled
  - Add script to create reduced build config
  - Update CIs

* merge e2e with distributed pipeline (#6443)

merge e2e with distributed pipeline

* Fix test breaks in Windows ingestion pipeline (#6476)

* fix various build breaks with Windows build

* fix runtime errors loading libraries from system32

* add build_inbox check to winml_test_common

* use raw string

* cleanup

* fix dll load

Co-authored-by: Sheil Kumar <sheilk@microsoft.com>

* Speed up the Mac CI runs (#6483)

* expose learningmodelpixelrange property (#5877)

* Fix of support api version bug for [de]quantize (#6492)

* SDL fixes: add proper casts/format specifiers (#6446)

* SDL annotation fixes (#6448)

Co-authored-by: Ori Levari <orlevari@microsoft.com>

* [OpenVINO-EP] Remove support for OpenVINO 2020.2 (#6493)

* Removed OpenVINO 2020.2 support

* Updated documentation and build.py

* Removed unnecessary libraries from setup.py

* Support pad operator in quantization and quantized nhwc transformer. Fix Pad operator bug. (#6325)

Support pad operator in quantization tool.
Support pad operator in quantized nhwc transformer.
Fix pad() operator bug when pad input's inner(right) most axis value is zero for Edge and Reflect mode, it copied wrong value to the cells to be padded. Note the Constant mode will not trigger this bug, as Edge/Reflect need copy value from the already copied array while Constant mode only fill specified value.
Add more test cases to cover pad() operator bug fixed here.
Fix quantization tools uint8/int8 value overflow issue when quantize weights in python.

* Improve work distribution for Expand operator, and sharded LoopCounter configuration (#6454)

Description: This PR makes two changes identified while looking at a PGAN model.

First, it uses ThreadPool::TryParallelFor for the main parallel loops in the Expand operator. This lets the thread pool decide on the granularity at which to distribute work (unlike TrySimpleParallelFor). Profiling showed high costs when running "simple" loops with 4M iterations each of which copied only 4 bytes.

Second, it updates the sharded loop counter in the thread pool so that the number of shards is capped by the number of threads. This helps make the performance of any other high-contention "simple" loops more robust at low thread counts by letting each thread work on its own "home" shard for longer.

Motivation and Context

Profiling showed a PGAN model taking 2x+ longer with the non-OpenMP build. The root cause was that the OpenMP build uses simple static scheduling of loop iterations, while the non-OpenMP build uses dynamic scheduling. The combination of large numbers of tiny iterations is less significant with static scheduling --- although still desirable to avoid, given that each iteration incurs a std::function invocation.

* Update document of transformer optimization (#6487)

* nuphar test to avoid test data download to improve passing rate (#6467)

nuphar test to avoid test data download to improve passing rate

* Fuse cuda conv with activation (#6351)

* optimize cuda conv by fused activation

* remove needless print out

* exclude test from cpu

* handle status error from cudnn 8.x

* add reference to base class

* add hipify

* [CoreML EP] Add support for some activations/Transpose, move some shared helpers from NNAPI to shared space (#6498)

* Init change

* Move some helper from nnapi ep to shared

* Add transpose support

* Fix trt ci build break

* Refine transformers profiler output (#6502)

* output nodes in the original order; grouped by node name
* add document for profiler

* Update to match new test setup. (#6496)

* Update to match new test setup.

* Add Gemm(7) manually for now.
Will fix properly on Monday. It's used by mnist.ort as that is created by optimizing mnist.onnx to level 1 causing 2 nodes to be replaced by a Gemm and the op to be missing from the required list as that is created using the original onnx model.

* Enable dense sequence optimized version of Pytorch exported BERT-L on AMD GPU (#6504)

* Permit dense seq optimization on BERT-L pytorch export by enabling ReduceSumTraining, Equal, and NonZero on AMD

* enable Equal tests

* enable fast_matrix_reduction test case

* Optimize GatherGrad for AMD GPU (#6381)

* optimize gathergrad

* address comments

Co-authored-by: Weixing Zhang <wezhan@microsoft.com>

* add explicit barriers for buffer overread and overrwrite (#6484)

Co-authored-by: Ori Levari <orlevari@microsoft.com>

* fix sdl bugs for uninitialized variables and returns (#6450)

Co-authored-by: Ori Levari <orlevari@microsoft.com>

* handle hr error conditions (#6449)

Co-authored-by: Ori Levari <orlevari@microsoft.com>

* Dnnl training (#6045)

* Add ReluGrad and ConvGrad ops for the dnnl provider

* the mnist sample is updated to add the --use_dnnl option that
will cause the sample to use the dnnl execution provider for
nodes that exist in dnnl provider.

* Added the ability to find forward ops. Dnnl backward gradient
ops require the forward primitive description and workspace
from the forward operation.

* Enable specifying the execution provider for Gradient Checker Tests

* Prevent memory leak when running dnnl_provider in training mode

Prevent creating a SubgraphPrimitivePool when the code is built with the
ENABLE_TRAINING build flag. Instead create a SubgraphPrimitive directly.

The SubgraphPrimitivePool was causing a pool of SubgraphPrimitives to be
stashed in a map for reuse. Due to the way the Training Loop uses threads
the pool of SubgraphPrimitives were not being reuse instead a new pool of
SubgraphPrimitives being created each run. The old pool was not instantly
freed. This behavior could be a language error when using thread_local
memory.

Signed-off-by: George Nash <george.nash@intel.com>

* Added fixes to maxpoolgrad and memory leak.

Maxpoolgrad will now pass all unit tests.
With the conv and convgrad disabled for dnnl, mnist is able to train till 95%

Signed-off-by: Chethan Palangotu Keshava <chethan.palangotu.keshava@intel.com>

* Fixed misc issues when testing training code with dnnl provider

* fix conv_grad dnnl tests with dilation to run dnnl execution provider

* update mnist training sample to accept convolution type models

  convolution models require the input shape to be {1, 28, 28}
  instead of the flat {728} image that is used for the gemm models

  this will enable models that require the different shape by adding
 `--model_type conv` to the command line when running the mnist sample.
 (while testing a workaround was used see #4762)

* Disable weight caching in dnnl conv operator when using training

  When training we can not use cached weights because the weight
  will be updated each run. This re-enables dnnl Conv and ConvGrad Ops.
  The weight caching was the source of the error from Conv when training.

* Fix issues found when building grad ops on Linux
  * The dnnl_convgrad code was over using the scope operator
    causing a compilation problem.
  * The dnnl_maxpoolgrad code had a logic error that is was
    comparing with the source description when it should have
    been comparing with the destination despription.

* Update BUILD.md so it shows DNNL for training
  * Updated the table of contents. Since the same providers
    are listed twice. Once for Infrance and again for Training
    an HTML anchor was added to distinguish the second header
    from the first for the TOC.

* Fix build failure when not using --enable-training build option

* reorganize the gradient operators so they are grouped together

* Fix issues found when running onnx_backend_test_series.py

* Pooling code only supports 2 outputs when built with --enable-training

* Address code review feedback
  * class member variables end in underscore_
  * use dst instead of dist to match pattern use elsewhere in DNNL code.

* Remove workaround that was introduced to handle problems running
  convolution based training models. See issue #4762

Signed-off-by: George Nash <george.nash@intel.com>

* Isolate training code and code cleanup

* Do not build if dnnl_gpu_runtime if enable_training is set training code
  does not support dnnl_gpu_runtime yet.
* Isolated Training code inside ifdefs so that they wont affect
  project if built without training enabled
* Inadvertant changes in whitespace were removed to make code review simpler
* Undid some code reordering that was not needed
* comments added to closing #endif statments to simplify reading complex ifdefs
* Modified the GetPrimitiveDesc functions to return shared_ptr instead of raw
  pointer. This matches what was done in Pool code and is safer memory code.

Signed-off-by: George Nash <george.nash@intel.com>

* Address code review issues

- whitespace changes caused by running clang-format on the code
- Several spelling errors fixed
- Removed/changed some ifdefs to improve readability
- other misc. changes in responce to code review.

Signed-off-by: George Nash <george.nash@intel.com>

* Code changes to address code review

- Simplify iteration code using `auto` keyword
- remove C style cast that was not needed
- remove instance variable that was not needed [relugrad.h]
- added the execution providers to `ComputeGradientErrorInternal()`
  and `ComputeTheoreticalJacobianTranspose()` instead of using
  a pointer to an instance varaible [gradient_checker.h/.cc]

Signed-off-by: George Nash <george.nash@intel.com>

* Combined the default gradient ops test and dnnl gradient ops test for ConvGrad and MaxPoolGrad into one function with the help of a helper function.
This will reduce repeated code.
Signed-off-by: Palangotu Keshava, Chethan's avatarChethan Palangotu Keshava <chethan.palangotu.keshava@intel.com>

* Replaced the stack used by convgrad to vector so that the vector(used as stack) can be easily cleared everytime the graph is created.
This will prevent memory leak from convolution kernels being pushed constantly onto the stack.
Signed-off-by: chethan.palangotu.keshava@intel.com

* Code clean up and formating updates

 - Removed empty else statment
 - updated indentation of code that was causing double curly brackets to look unususal
 - Changed check for NumDimensions to Size in Relu and ReluGrad error checking code.
 - isolated training code

Signed-off-by: George Nash <george.nash@intel.com>

* Restore inadvertantly removed ConvGrad tests

When combining the DNNL and CPU version of the ConvGrad
tests two test were inadvertantly excluded.  This adds
back the Conv3d and Conv3d with strides test cases.

Signed-off-by: George Nash <george.nash@intel.com>

* Add validation to ConvGrad

This validates the dimensions of the ConvGrad match the
passed in Convolution forward primitive description.

The current code for DNNL ConvGrad makes the assumption that the ConvGrad
nodes will be visited in the reverse order from the corresponding Conv nodes

The added validation will return an error if this assumption is not true.

Signed-off-by: George Nash <george.nash@intel.com>

* Do not create new execution providers in provider_test_utils

This removes the code that generated new execution providers in the
OpTester::Run function. This was added because the std::move was
leaving the `entry` value empty so subsequent calls would cause a
segfault.

Problem is this potentially changed the execution_provider because it
would create the default provider dropping any custom arguments.

When the now removed code was originally added the std::move was causing
crashes when the GradientChecker unit tests were run.  However, it is no
longer causing problems even with the code removed.

Signed-off-by: George Nash <george.nash@intel.com>

* Change the forward conv stack to a forward conv map

This changes how the forward conv kernel is mapped to the bwd ConvGrad
kernel the problematic stack is no longer used.

The convolution stack made the assumption that the corresponding
ConvGrad operator would be visited in reverse order of the forward
Conv operators.  This was always problematic and was unlikely to
work for inception models.

Important changes:
- The weight_name is added to the ConvGrad dnnl_node making it
  possible to use the weight_name as a lookup key to find the
  Conv forward Kernel
- the `std::vector fwd_conv_stack_` has been replaced with a
  `std::map fwd_conv_kernel_map_`
- Although it is not needed lock_guards were added when writing
  to and reading from the fwd_conv_kernel_map_ as well as the
  fwd_kernel_map_. These should always be accessed by a single
  thread when preparing the dnnl subgraphs so the guard should not
  be needed but its added just in case.
- Updated the comments ConvGrad.h code to no longer mention the
  stack. The error check is not removed. It will be good to verify
  there are no errors as we continue to test against more models.

Signed-off-by: George Nash <george.nash@intel.com>

Co-authored-by: Chethan Palangotu Keshava <chethan.palangotu.keshava@intel.com>
Co-authored-by: unknown <63478620+jeyblu@users.noreply.github.com>

* Lochi/refactor yolov3 quantization (#6290)

* Refactor the code and move data reader, preprocessing, evaluation to
E2E_example_mode

* Refactor the code.

Move data reader, preprocessing, evaluation to model specific example
under E2E_example_mode

* refactor code

* Move yolov3 example to specific folder and add additional pre/post
processing

* Print a warning message for using newer c_api header on old binary (#6507)

* Fix issues with ArmNN build setup (#6495)

* ArmNN build fixes
* Update BUILD.md to document that the ACL paths must be specified to build ArmNN
* Fix CUDA build error. We don't setup the link libraries correctly/consistently so improve that.

* Fix Windows CI builds by updating test scripts to work with numpy 1.20. (#6518)

* Update onnxruntime_test_python.py to work with numpy 1.20.

Some aliases are deprecated in favor of the built-in python types. See https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

np.array with bytes for entries and dtype of np.void no longer automatically pads. Change a test to adjust for that.

* Fix another test script

* Fix ORTModule branch for orttraining-* pipelines

* Update pytorch nightly version dependency

Co-authored-by: Edward Chen <18449977+edgchen1@users.noreply.github.com>
Co-authored-by: George Wu <jywu@microsoft.com>
Co-authored-by: Cecilia Liu <ziyue.liu7@gmail.com>
Co-authored-by: Ryan Hill <38674843+RyanUnderhill@users.noreply.github.com>
Co-authored-by: George Nash <george.nash@intel.com>
Co-authored-by: Guoyu Wang <62914304+gwang-msft@users.noreply.github.com>
Co-authored-by: Yateng Hong <toothache9010@gmail.com>
Co-authored-by: stevenlix <38092805+stevenlix@users.noreply.github.com>
Co-authored-by: Derek Murray <Derek.Murray@microsoft.com>
Co-authored-by: ashbhandare <ash.bhandare@gmail.com>
Co-authored-by: Scott McKay <skottmckay@gmail.com>
Co-authored-by: Changming Sun <chasun@microsoft.com>
Co-authored-by: Tracy Sharpe <42477615+tracysh@users.noreply.github.com>
Co-authored-by: Juliana Franco <jufranc@microsoft.com>
Co-authored-by: Pranav Sharma <prs@microsoft.com>
Co-authored-by: Tixxx <tix@microsoft.com>
Co-authored-by: Jay Rodge <jayrodge@live.com>
Co-authored-by: Du Li <duli1@microsoft.com>
Co-authored-by: Du Li <duli@OrtTrainingDev4.af05slrtruoetgaxwwjv5nsq5e.px.internal.cloudapp.net>
Co-authored-by: Yufeng Li <liyufeng1987@gmail.com>
Co-authored-by: baijumeswani <bmeswani@microsoft.com>
Co-authored-by: Sergii Dymchenko <sedymche@microsoft.com>
Co-authored-by: jingyanwangms <47403504+jingyanwangms@users.noreply.github.com>
Co-authored-by: satyajandhyala <satya.k.jandhyala@gmail.com>
Co-authored-by: S. Manohar Karlapalem <manohar.karlapalem@intel.com>
Co-authored-by: Weixing Zhang <weixingzhang@users.noreply.github.com>
Co-authored-by: Suffian Khan <sukha@microsoft.com>
Co-authored-by: Olivia Jain <oljain@microsoft.com>
Co-authored-by: Chi Lo <54722500+chilo-ms@users.noreply.github.com>
Co-authored-by: Hariharan Seshadri <shariharan91@gmail.com>
Co-authored-by: Ryan Lai <rylai@microsoft.com>
Co-authored-by: Jesse Benson <jesseb@microsoft.com>
Co-authored-by: sfatimar <64512376+sfatimar@users.noreply.github.com>
Co-authored-by: suryasidd <surya.siddharth.pemmaraju@intel.com>
Co-authored-by: sfatimar <sahar.fatima@intel/com>
Co-authored-by: MaajidKhan <n.maajidkhan@gmail.com>
Co-authored-by: mohdansx <mohdx.ansari@intel.com>
Co-authored-by: Xavier Dupré <xadupre@users.noreply.github.com>
Co-authored-by: Michael Goin <mgoin@vols.utk.edu>
Co-authored-by: Michael Giba <michaelgiba@gmail.com>
Co-authored-by: William Tambellini <wtambellini@sdl.com>
Co-authored-by: Hector Li <hecli@microsoft.com>
Co-authored-by: Aishwarya <aibhanda@OrtTrainingDev4.af05slrtruoetgaxwwjv5nsq5e.px.internal.cloudapp.net>
Co-authored-by: liqunfu <liqfu@microsoft.com>
Co-authored-by: liqun <liqun@OrtTrainingDev4.af05slrtruoetgaxwwjv5nsq5e.px.internal.cloudapp.net>
Co-authored-by: pengwa <pengwa@microsoft.com>
Co-authored-by: Tang, Cheng <souptc@gmail.com>
Co-authored-by: Cheng Tang <chenta@microsoft.com>
Co-authored-by: Tianlei Wu <tlwu@microsoft.com>
Co-authored-by: Ye Wang <52801275+wangyems@users.noreply.github.com>
Co-authored-by: Chun-Wei Chen <jacky82226@gmail.com>
Co-authored-by: Vincent Wang <wangwchpku@outlook.com>
Co-authored-by: Vincent Wang <weicwang@microsoft.com>
Co-authored-by: Luyao Ren <375833274@qq.com>
Co-authored-by: Zhang Lei <zhang.huanning@hotmail.com>
Co-authored-by: Tim Harris <tiharr@microsoft.com>
Co-authored-by: Ashwini Khade <askhade@microsoft.com>
Co-authored-by: Dmitri Smirnov <yuslepukhin@users.noreply.github.com>
Co-authored-by: Alberto Magni <49027342+alberto-magni@users.noreply.github.com>
Co-authored-by: Wei-Sheng Chin <wschin@outlook.com>
Co-authored-by: wezuo <49965641+wezuo@users.noreply.github.com>
Co-authored-by: Jesse Benson <benson.jesse@gmail.com>
Co-authored-by: Wei Zuo <wezuo@OrtTrainingDev3.af05slrtruoetgaxwwjv5nsq5e.px.internal.cloudapp.net>
Co-authored-by: wezuo <wezuo@az-eus-v100-32gb-5-worker-mgtbby.eastus.cloudapp.azure.com>
Co-authored-by: wezuo <wezuo@az-eus-v100-32gb-5-worker-yclzsf.eastus.cloudapp.azure.com>
Co-authored-by: Wenbing Li <10278425+wenbingl@users.noreply.github.com>
Co-authored-by: Martin Man <supermt@gmail.com>
Co-authored-by: M. Zeeshan Siddiqui <mzs@microsoft.com>
Co-authored-by: Ori Levari <ori.levari@microsoft.com>
Co-authored-by: Ori Levari <orlevari@microsoft.com>
Co-authored-by: Ubuntu <OrtTrainingDev3@OrtTrainingDev3.af05slrtruoetgaxwwjv5nsq5e.px.internal.cloudapp.net>
Co-authored-by: Sherlock Huang <bahuang@OrtTrainingDev3.af05slrtruoetgaxwwjv5nsq5e.px.internal.cloudapp.net>
Co-authored-by: Sheil Kumar <smk2007@gmail.com>
Co-authored-by: Sheil Kumar <sheilk@microsoft.com>
Co-authored-by: Ryota Tomioka <ryoto@microsoft.com>
Co-authored-by: Adam Pocock <adam.pocock@oracle.com>
Co-authored-by: Yulong Wang <f.s@qq.com>
Co-authored-by: Faith Xu <faxu@microsoft.com>
Co-authored-by: Xiang Zhang <xianz@microsoft.com>
Co-authored-by: suryasidd <48925384+suryasidd@users.noreply.github.com>
Co-authored-by: RandySheriffH <48490400+RandySheriffH@users.noreply.github.com>
Co-authored-by: Weixing Zhang <wezhan@microsoft.com>
Co-authored-by: Chethan Palangotu Keshava <chethan.palangotu.keshava@intel.com>
Co-authored-by: unknown <63478620+jeyblu@users.noreply.github.com>
2021-02-02 08:59:56 -08:00

5446 lines
204 KiB
C#

// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: onnx-ml.proto3
// </auto-generated>
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace Onnx {
/// <summary>Holder for reflection information generated from onnx-ml.proto3</summary>
public static partial class OnnxMlReflection {
#region Descriptor
/// <summary>File descriptor for onnx-ml.proto3</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static OnnxMlReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"Cg5vbm54LW1sLnByb3RvMxIEb25ueCLoBAoOQXR0cmlidXRlUHJvdG8SDAoE",
"bmFtZRgBIAEoCRIVCg1yZWZfYXR0cl9uYW1lGBUgASgJEhIKCmRvY19zdHJp",
"bmcYDSABKAkSMAoEdHlwZRgUIAEoDjIiLm9ubnguQXR0cmlidXRlUHJvdG8u",
"QXR0cmlidXRlVHlwZRIJCgFmGAIgASgCEgkKAWkYAyABKAMSCQoBcxgEIAEo",
"DBIcCgF0GAUgASgLMhEub25ueC5UZW5zb3JQcm90bxIbCgFnGAYgASgLMhAu",
"b25ueC5HcmFwaFByb3RvEi4KDXNwYXJzZV90ZW5zb3IYFiABKAsyFy5vbm54",
"LlNwYXJzZVRlbnNvclByb3RvEg4KBmZsb2F0cxgHIAMoAhIMCgRpbnRzGAgg",
"AygDEg8KB3N0cmluZ3MYCSADKAwSIgoHdGVuc29ycxgKIAMoCzIRLm9ubngu",
"VGVuc29yUHJvdG8SIAoGZ3JhcGhzGAsgAygLMhAub25ueC5HcmFwaFByb3Rv",
"Ei8KDnNwYXJzZV90ZW5zb3JzGBcgAygLMhcub25ueC5TcGFyc2VUZW5zb3JQ",
"cm90byK4AQoNQXR0cmlidXRlVHlwZRINCglVTkRFRklORUQQABIJCgVGTE9B",
"VBABEgcKA0lOVBACEgoKBlNUUklORxADEgoKBlRFTlNPUhAEEgkKBUdSQVBI",
"EAUSEQoNU1BBUlNFX1RFTlNPUhALEgoKBkZMT0FUUxAGEggKBElOVFMQBxIL",
"CgdTVFJJTkdTEAgSCwoHVEVOU09SUxAJEgoKBkdSQVBIUxAKEhIKDlNQQVJT",
"RV9URU5TT1JTEAwiUQoOVmFsdWVJbmZvUHJvdG8SDAoEbmFtZRgBIAEoCRId",
"CgR0eXBlGAIgASgLMg8ub25ueC5UeXBlUHJvdG8SEgoKZG9jX3N0cmluZxgD",
"IAEoCSKWAQoJTm9kZVByb3RvEg0KBWlucHV0GAEgAygJEg4KBm91dHB1dBgC",
"IAMoCRIMCgRuYW1lGAMgASgJEg8KB29wX3R5cGUYBCABKAkSDgoGZG9tYWlu",
"GAcgASgJEicKCWF0dHJpYnV0ZRgFIAMoCzIULm9ubnguQXR0cmlidXRlUHJv",
"dG8SEgoKZG9jX3N0cmluZxgGIAEoCSLWAQoRVHJhaW5pbmdJbmZvUHJvdG8S",
"KAoOaW5pdGlhbGl6YXRpb24YASABKAsyEC5vbm54LkdyYXBoUHJvdG8SIwoJ",
"YWxnb3JpdGhtGAIgASgLMhAub25ueC5HcmFwaFByb3RvEjwKFmluaXRpYWxp",
"emF0aW9uX2JpbmRpbmcYAyADKAsyHC5vbm54LlN0cmluZ1N0cmluZ0VudHJ5",
"UHJvdG8SNAoOdXBkYXRlX2JpbmRpbmcYBCADKAsyHC5vbm54LlN0cmluZ1N0",
"cmluZ0VudHJ5UHJvdG8iwwIKCk1vZGVsUHJvdG8SEgoKaXJfdmVyc2lvbhgB",
"IAEoAxIuCgxvcHNldF9pbXBvcnQYCCADKAsyGC5vbm54Lk9wZXJhdG9yU2V0",
"SWRQcm90bxIVCg1wcm9kdWNlcl9uYW1lGAIgASgJEhgKEHByb2R1Y2VyX3Zl",
"cnNpb24YAyABKAkSDgoGZG9tYWluGAQgASgJEhUKDW1vZGVsX3ZlcnNpb24Y",
"BSABKAMSEgoKZG9jX3N0cmluZxgGIAEoCRIfCgVncmFwaBgHIAEoCzIQLm9u",
"bnguR3JhcGhQcm90bxI0Cg5tZXRhZGF0YV9wcm9wcxgOIAMoCzIcLm9ubngu",
"U3RyaW5nU3RyaW5nRW50cnlQcm90bxIuCg10cmFpbmluZ19pbmZvGBQgAygL",
"Mhcub25ueC5UcmFpbmluZ0luZm9Qcm90byI0ChZTdHJpbmdTdHJpbmdFbnRy",
"eVByb3RvEgsKA2tleRgBIAEoCRINCgV2YWx1ZRgCIAEoCSJrChBUZW5zb3JB",
"bm5vdGF0aW9uEhMKC3RlbnNvcl9uYW1lGAEgASgJEkIKHHF1YW50X3BhcmFt",
"ZXRlcl90ZW5zb3JfbmFtZXMYAiADKAsyHC5vbm54LlN0cmluZ1N0cmluZ0Vu",
"dHJ5UHJvdG8i2AIKCkdyYXBoUHJvdG8SHQoEbm9kZRgBIAMoCzIPLm9ubngu",
"Tm9kZVByb3RvEgwKBG5hbWUYAiABKAkSJgoLaW5pdGlhbGl6ZXIYBSADKAsy",
"ES5vbm54LlRlbnNvclByb3RvEjMKEnNwYXJzZV9pbml0aWFsaXplchgPIAMo",
"CzIXLm9ubnguU3BhcnNlVGVuc29yUHJvdG8SEgoKZG9jX3N0cmluZxgKIAEo",
"CRIjCgVpbnB1dBgLIAMoCzIULm9ubnguVmFsdWVJbmZvUHJvdG8SJAoGb3V0",
"cHV0GAwgAygLMhQub25ueC5WYWx1ZUluZm9Qcm90bxIoCgp2YWx1ZV9pbmZv",
"GA0gAygLMhQub25ueC5WYWx1ZUluZm9Qcm90bxI3ChdxdWFudGl6YXRpb25f",
"YW5ub3RhdGlvbhgOIAMoCzIWLm9ubnguVGVuc29yQW5ub3RhdGlvbiK4BQoL",
"VGVuc29yUHJvdG8SDAoEZGltcxgBIAMoAxIRCglkYXRhX3R5cGUYAiABKAUS",
"KgoHc2VnbWVudBgDIAEoCzIZLm9ubnguVGVuc29yUHJvdG8uU2VnbWVudBIW",
"CgpmbG9hdF9kYXRhGAQgAygCQgIQARIWCgppbnQzMl9kYXRhGAUgAygFQgIQ",
"ARITCgtzdHJpbmdfZGF0YRgGIAMoDBIWCgppbnQ2NF9kYXRhGAcgAygDQgIQ",
"ARIMCgRuYW1lGAggASgJEhIKCmRvY19zdHJpbmcYDCABKAkSEAoIcmF3X2Rh",
"dGEYCSABKAwSMwoNZXh0ZXJuYWxfZGF0YRgNIAMoCzIcLm9ubnguU3RyaW5n",
"U3RyaW5nRW50cnlQcm90bxI1Cg1kYXRhX2xvY2F0aW9uGA4gASgOMh4ub25u",
"eC5UZW5zb3JQcm90by5EYXRhTG9jYXRpb24SFwoLZG91YmxlX2RhdGEYCiAD",
"KAFCAhABEhcKC3VpbnQ2NF9kYXRhGAsgAygEQgIQARolCgdTZWdtZW50Eg0K",
"BWJlZ2luGAEgASgDEgsKA2VuZBgCIAEoAyLaAQoIRGF0YVR5cGUSDQoJVU5E",
"RUZJTkVEEAASCQoFRkxPQVQQARIJCgVVSU5UOBACEggKBElOVDgQAxIKCgZV",
"SU5UMTYQBBIJCgVJTlQxNhAFEgkKBUlOVDMyEAYSCQoFSU5UNjQQBxIKCgZT",
"VFJJTkcQCBIICgRCT09MEAkSCwoHRkxPQVQxNhAKEgoKBkRPVUJMRRALEgoK",
"BlVJTlQzMhAMEgoKBlVJTlQ2NBANEg0KCUNPTVBMRVg2NBAOEg4KCkNPTVBM",
"RVgxMjgQDxIMCghCRkxPQVQxNhAQIikKDERhdGFMb2NhdGlvbhILCgdERUZB",
"VUxUEAASDAoIRVhURVJOQUwQASJoChFTcGFyc2VUZW5zb3JQcm90bxIhCgZ2",
"YWx1ZXMYASABKAsyES5vbm54LlRlbnNvclByb3RvEiIKB2luZGljZXMYAiAB",
"KAsyES5vbm54LlRlbnNvclByb3RvEgwKBGRpbXMYAyADKAMilQEKEFRlbnNv",
"clNoYXBlUHJvdG8SLQoDZGltGAEgAygLMiAub25ueC5UZW5zb3JTaGFwZVBy",
"b3RvLkRpbWVuc2lvbhpSCglEaW1lbnNpb24SEwoJZGltX3ZhbHVlGAEgASgD",
"SAASEwoJZGltX3BhcmFtGAIgASgJSAASEgoKZGVub3RhdGlvbhgDIAEoCUIH",
"CgV2YWx1ZSLCBAoJVHlwZVByb3RvEi0KC3RlbnNvcl90eXBlGAEgASgLMhYu",
"b25ueC5UeXBlUHJvdG8uVGVuc29ySAASMQoNc2VxdWVuY2VfdHlwZRgEIAEo",
"CzIYLm9ubnguVHlwZVByb3RvLlNlcXVlbmNlSAASJwoIbWFwX3R5cGUYBSAB",
"KAsyEy5vbm54LlR5cGVQcm90by5NYXBIABI6ChJzcGFyc2VfdGVuc29yX3R5",
"cGUYCCABKAsyHC5vbm54LlR5cGVQcm90by5TcGFyc2VUZW5zb3JIABItCgtv",
"cGFxdWVfdHlwZRgHIAEoCzIWLm9ubnguVHlwZVByb3RvLk9wYXF1ZUgAEhIK",
"CmRlbm90YXRpb24YBiABKAkaQgoGVGVuc29yEhEKCWVsZW1fdHlwZRgBIAEo",
"BRIlCgVzaGFwZRgCIAEoCzIWLm9ubnguVGVuc29yU2hhcGVQcm90bxouCghT",
"ZXF1ZW5jZRIiCgllbGVtX3R5cGUYASABKAsyDy5vbm54LlR5cGVQcm90bxo8",
"CgNNYXASEAoIa2V5X3R5cGUYASABKAUSIwoKdmFsdWVfdHlwZRgCIAEoCzIP",
"Lm9ubnguVHlwZVByb3RvGkgKDFNwYXJzZVRlbnNvchIRCgllbGVtX3R5cGUY",
"ASABKAUSJQoFc2hhcGUYAiABKAsyFi5vbm54LlRlbnNvclNoYXBlUHJvdG8a",
"JgoGT3BhcXVlEg4KBmRvbWFpbhgBIAEoCRIMCgRuYW1lGAIgASgJQgcKBXZh",
"bHVlIjUKEk9wZXJhdG9yU2V0SWRQcm90bxIOCgZkb21haW4YASABKAkSDwoH",
"dmVyc2lvbhgCIAEoAyrLAQoHVmVyc2lvbhISCg5fU1RBUlRfVkVSU0lPThAA",
"EhkKFUlSX1ZFUlNJT05fMjAxN18xMF8xMBABEhkKFUlSX1ZFUlNJT05fMjAx",
"N18xMF8zMBACEhgKFElSX1ZFUlNJT05fMjAxN18xMV8zEAMSGAoUSVJfVkVS",
"U0lPTl8yMDE5XzFfMjIQBBIYChRJUl9WRVJTSU9OXzIwMTlfM18xOBAFEhgK",
"FElSX1ZFUlNJT05fMjAxOV85XzE5EAYSDgoKSVJfVkVSU0lPThAHQgJIA2IG",
"cHJvdG8z"));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { },
new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Onnx.Version), }, null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::Onnx.AttributeProto), global::Onnx.AttributeProto.Parser, new[]{ "Name", "RefAttrName", "DocString", "Type", "F", "I", "S", "T", "G", "SparseTensor", "Floats", "Ints", "Strings", "Tensors", "Graphs", "SparseTensors" }, null, new[]{ typeof(global::Onnx.AttributeProto.Types.AttributeType) }, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Onnx.ValueInfoProto), global::Onnx.ValueInfoProto.Parser, new[]{ "Name", "Type", "DocString" }, null, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Onnx.NodeProto), global::Onnx.NodeProto.Parser, new[]{ "Input", "Output", "Name", "OpType", "Domain", "Attribute", "DocString" }, null, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Onnx.TrainingInfoProto), global::Onnx.TrainingInfoProto.Parser, new[]{ "Initialization", "Algorithm", "InitializationBinding", "UpdateBinding" }, null, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Onnx.ModelProto), global::Onnx.ModelProto.Parser, new[]{ "IrVersion", "OpsetImport", "ProducerName", "ProducerVersion", "Domain", "ModelVersion", "DocString", "Graph", "MetadataProps", "TrainingInfo" }, null, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Onnx.StringStringEntryProto), global::Onnx.StringStringEntryProto.Parser, new[]{ "Key", "Value" }, null, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Onnx.TensorAnnotation), global::Onnx.TensorAnnotation.Parser, new[]{ "TensorName", "QuantParameterTensorNames" }, null, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Onnx.GraphProto), global::Onnx.GraphProto.Parser, new[]{ "Node", "Name", "Initializer", "SparseInitializer", "DocString", "Input", "Output", "ValueInfo", "QuantizationAnnotation" }, null, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Onnx.TensorProto), global::Onnx.TensorProto.Parser, new[]{ "Dims", "DataType", "Segment", "FloatData", "Int32Data", "StringData", "Int64Data", "Name", "DocString", "RawData", "ExternalData", "DataLocation", "DoubleData", "Uint64Data" }, null, new[]{ typeof(global::Onnx.TensorProto.Types.DataType), typeof(global::Onnx.TensorProto.Types.DataLocation) }, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Onnx.TensorProto.Types.Segment), global::Onnx.TensorProto.Types.Segment.Parser, new[]{ "Begin", "End" }, null, null, null, null)}),
new pbr::GeneratedClrTypeInfo(typeof(global::Onnx.SparseTensorProto), global::Onnx.SparseTensorProto.Parser, new[]{ "Values", "Indices", "Dims" }, null, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Onnx.TensorShapeProto), global::Onnx.TensorShapeProto.Parser, new[]{ "Dim" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Onnx.TensorShapeProto.Types.Dimension), global::Onnx.TensorShapeProto.Types.Dimension.Parser, new[]{ "DimValue", "DimParam", "Denotation" }, new[]{ "Value" }, null, null, null)}),
new pbr::GeneratedClrTypeInfo(typeof(global::Onnx.TypeProto), global::Onnx.TypeProto.Parser, new[]{ "TensorType", "SequenceType", "MapType", "SparseTensorType", "OpaqueType", "Denotation" }, new[]{ "Value" }, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Onnx.TypeProto.Types.Tensor), global::Onnx.TypeProto.Types.Tensor.Parser, new[]{ "ElemType", "Shape" }, null, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Onnx.TypeProto.Types.Sequence), global::Onnx.TypeProto.Types.Sequence.Parser, new[]{ "ElemType" }, null, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Onnx.TypeProto.Types.Map), global::Onnx.TypeProto.Types.Map.Parser, new[]{ "KeyType", "ValueType" }, null, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Onnx.TypeProto.Types.SparseTensor), global::Onnx.TypeProto.Types.SparseTensor.Parser, new[]{ "ElemType", "Shape" }, null, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Onnx.TypeProto.Types.Opaque), global::Onnx.TypeProto.Types.Opaque.Parser, new[]{ "Domain", "Name" }, null, null, null, null)}),
new pbr::GeneratedClrTypeInfo(typeof(global::Onnx.OperatorSetIdProto), global::Onnx.OperatorSetIdProto.Parser, new[]{ "Domain", "Version" }, null, null, null, null)
}));
}
#endregion
}
#region Enums
/// <summary>
/// Versioning
///
/// ONNX versioning is specified in docs/IR.md and elaborated on in docs/Versioning.md
///
/// To be compatible with both proto2 and proto3, we will use a version number
/// that is not defined by the default value but an explicit enum number.
/// </summary>
public enum Version {
/// <summary>
/// proto3 requires the first enum value to be zero.
/// We add this just to appease the compiler.
/// </summary>
[pbr::OriginalName("_START_VERSION")] StartVersion = 0,
/// <summary>
/// The version field is always serialized and we will use it to store the
/// version that the graph is generated from. This helps us set up version
/// control.
/// For the IR, we are using simple numbers starting with 0x00000001,
/// which was the version we published on Oct 10, 2017.
/// </summary>
[pbr::OriginalName("IR_VERSION_2017_10_10")] IrVersion20171010 = 1,
/// <summary>
/// IR_VERSION 2 published on Oct 30, 2017
/// - Added type discriminator to AttributeProto to support proto3 users
/// </summary>
[pbr::OriginalName("IR_VERSION_2017_10_30")] IrVersion20171030 = 2,
/// <summary>
/// IR VERSION 3 published on Nov 3, 2017
/// - For operator versioning:
/// - Added new message OperatorSetIdProto
/// - Added opset_import in ModelProto
/// - For vendor extensions, added domain in NodeProto
/// </summary>
[pbr::OriginalName("IR_VERSION_2017_11_3")] IrVersion2017113 = 3,
/// <summary>
/// IR VERSION 4 published on Jan 22, 2019
/// - Relax constraint that initializers should be a subset of graph inputs
/// - Add type BFLOAT16
/// </summary>
[pbr::OriginalName("IR_VERSION_2019_1_22")] IrVersion2019122 = 4,
/// <summary>
/// IR VERSION 5 published on March 18, 2019
/// - Add message TensorAnnotation.
/// - Add quantization annotation in GraphProto to map tensor with its scale and zero point quantization parameters.
/// </summary>
[pbr::OriginalName("IR_VERSION_2019_3_18")] IrVersion2019318 = 5,
/// <summary>
/// IR VERSION 6 published on Sep 19, 2019
/// - Add support for sparse tensor constants stored in model.
/// - Add message SparseTensorProto
/// - Add sparse initializers
/// </summary>
[pbr::OriginalName("IR_VERSION_2019_9_19")] IrVersion2019919 = 6,
/// <summary>
/// IR VERSION 7 published on &lt;TBD>
/// - Add support to allow function body graph to rely on multiple external opreator sets.
/// - Add a list to promote inference graph's initializers to global and
/// mutable variables. Global variables are visible in all graphs of the
/// stored models.
/// - Add message TrainingInfoProto to store initialization
/// method and training algorithm. The execution of TrainingInfoProto
/// can modify the values of mutable variables.
/// - Implicitly add inference graph into each TrainingInfoProto's algorithm.
/// </summary>
[pbr::OriginalName("IR_VERSION")] IrVersion = 7,
}
#endregion
#region Messages
/// <summary>
/// Attributes
///
/// A named attribute containing either singular float, integer, string, graph,
/// and tensor values, or repeated float, integer, string, graph, and tensor values.
/// An AttributeProto MUST contain the name field, and *only one* of the
/// following content fields, effectively enforcing a C/C++ union equivalent.
/// </summary>
public sealed partial class AttributeProto : pb::IMessage<AttributeProto> {
private static readonly pb::MessageParser<AttributeProto> _parser = new pb::MessageParser<AttributeProto>(() => new AttributeProto());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<AttributeProto> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Onnx.OnnxMlReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public AttributeProto() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public AttributeProto(AttributeProto other) : this() {
name_ = other.name_;
refAttrName_ = other.refAttrName_;
docString_ = other.docString_;
type_ = other.type_;
f_ = other.f_;
i_ = other.i_;
s_ = other.s_;
t_ = other.t_ != null ? other.t_.Clone() : null;
g_ = other.g_ != null ? other.g_.Clone() : null;
sparseTensor_ = other.sparseTensor_ != null ? other.sparseTensor_.Clone() : null;
floats_ = other.floats_.Clone();
ints_ = other.ints_.Clone();
strings_ = other.strings_.Clone();
tensors_ = other.tensors_.Clone();
graphs_ = other.graphs_.Clone();
sparseTensors_ = other.sparseTensors_.Clone();
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public AttributeProto Clone() {
return new AttributeProto(this);
}
/// <summary>Field number for the "name" field.</summary>
public const int NameFieldNumber = 1;
private string name_ = "";
/// <summary>
/// The name field MUST be present for this version of the IR.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Name {
get { return name_; }
set {
name_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "ref_attr_name" field.</summary>
public const int RefAttrNameFieldNumber = 21;
private string refAttrName_ = "";
/// <summary>
/// if ref_attr_name is not empty, ref_attr_name is the attribute name in parent function.
/// In this case, this AttributeProto does not contain data, and it's a reference of attribute
/// in parent scope.
/// NOTE: This should ONLY be used in function (sub-graph). It's invalid to be used in main graph.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string RefAttrName {
get { return refAttrName_; }
set {
refAttrName_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "doc_string" field.</summary>
public const int DocStringFieldNumber = 13;
private string docString_ = "";
/// <summary>
/// A human-readable documentation for this attribute. Markdown is allowed.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string DocString {
get { return docString_; }
set {
docString_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "type" field.</summary>
public const int TypeFieldNumber = 20;
private global::Onnx.AttributeProto.Types.AttributeType type_ = global::Onnx.AttributeProto.Types.AttributeType.Undefined;
/// <summary>
/// The type field MUST be present for this version of the IR.
/// For 0.0.1 versions of the IR, this field was not defined, and
/// implementations needed to use has_field heuristics to determine
/// which value field was in use. For IR_VERSION 0.0.2 or later, this
/// field MUST be set and match the f|i|s|t|... field in use. This
/// change was made to accommodate proto3 implementations.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Onnx.AttributeProto.Types.AttributeType Type {
get { return type_; }
set {
type_ = value;
}
}
/// <summary>Field number for the "f" field.</summary>
public const int FFieldNumber = 2;
private float f_;
/// <summary>
/// Exactly ONE of the following fields must be present for this version of the IR
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public float F {
get { return f_; }
set {
f_ = value;
}
}
/// <summary>Field number for the "i" field.</summary>
public const int IFieldNumber = 3;
private long i_;
/// <summary>
/// int
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long I {
get { return i_; }
set {
i_ = value;
}
}
/// <summary>Field number for the "s" field.</summary>
public const int SFieldNumber = 4;
private pb::ByteString s_ = pb::ByteString.Empty;
/// <summary>
/// UTF-8 string
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pb::ByteString S {
get { return s_; }
set {
s_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "t" field.</summary>
public const int TFieldNumber = 5;
private global::Onnx.TensorProto t_;
/// <summary>
/// tensor value
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Onnx.TensorProto T {
get { return t_; }
set {
t_ = value;
}
}
/// <summary>Field number for the "g" field.</summary>
public const int GFieldNumber = 6;
private global::Onnx.GraphProto g_;
/// <summary>
/// graph
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Onnx.GraphProto G {
get { return g_; }
set {
g_ = value;
}
}
/// <summary>Field number for the "sparse_tensor" field.</summary>
public const int SparseTensorFieldNumber = 22;
private global::Onnx.SparseTensorProto sparseTensor_;
/// <summary>
/// sparse tensor value
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Onnx.SparseTensorProto SparseTensor {
get { return sparseTensor_; }
set {
sparseTensor_ = value;
}
}
/// <summary>Field number for the "floats" field.</summary>
public const int FloatsFieldNumber = 7;
private static readonly pb::FieldCodec<float> _repeated_floats_codec
= pb::FieldCodec.ForFloat(58);
private readonly pbc::RepeatedField<float> floats_ = new pbc::RepeatedField<float>();
/// <summary>
/// list of floats
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<float> Floats {
get { return floats_; }
}
/// <summary>Field number for the "ints" field.</summary>
public const int IntsFieldNumber = 8;
private static readonly pb::FieldCodec<long> _repeated_ints_codec
= pb::FieldCodec.ForInt64(66);
private readonly pbc::RepeatedField<long> ints_ = new pbc::RepeatedField<long>();
/// <summary>
/// list of ints
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<long> Ints {
get { return ints_; }
}
/// <summary>Field number for the "strings" field.</summary>
public const int StringsFieldNumber = 9;
private static readonly pb::FieldCodec<pb::ByteString> _repeated_strings_codec
= pb::FieldCodec.ForBytes(74);
private readonly pbc::RepeatedField<pb::ByteString> strings_ = new pbc::RepeatedField<pb::ByteString>();
/// <summary>
/// list of UTF-8 strings
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<pb::ByteString> Strings {
get { return strings_; }
}
/// <summary>Field number for the "tensors" field.</summary>
public const int TensorsFieldNumber = 10;
private static readonly pb::FieldCodec<global::Onnx.TensorProto> _repeated_tensors_codec
= pb::FieldCodec.ForMessage(82, global::Onnx.TensorProto.Parser);
private readonly pbc::RepeatedField<global::Onnx.TensorProto> tensors_ = new pbc::RepeatedField<global::Onnx.TensorProto>();
/// <summary>
/// list of tensors
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Onnx.TensorProto> Tensors {
get { return tensors_; }
}
/// <summary>Field number for the "graphs" field.</summary>
public const int GraphsFieldNumber = 11;
private static readonly pb::FieldCodec<global::Onnx.GraphProto> _repeated_graphs_codec
= pb::FieldCodec.ForMessage(90, global::Onnx.GraphProto.Parser);
private readonly pbc::RepeatedField<global::Onnx.GraphProto> graphs_ = new pbc::RepeatedField<global::Onnx.GraphProto>();
/// <summary>
/// list of graph
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Onnx.GraphProto> Graphs {
get { return graphs_; }
}
/// <summary>Field number for the "sparse_tensors" field.</summary>
public const int SparseTensorsFieldNumber = 23;
private static readonly pb::FieldCodec<global::Onnx.SparseTensorProto> _repeated_sparseTensors_codec
= pb::FieldCodec.ForMessage(186, global::Onnx.SparseTensorProto.Parser);
private readonly pbc::RepeatedField<global::Onnx.SparseTensorProto> sparseTensors_ = new pbc::RepeatedField<global::Onnx.SparseTensorProto>();
/// <summary>
/// list of sparse tensors
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Onnx.SparseTensorProto> SparseTensors {
get { return sparseTensors_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as AttributeProto);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(AttributeProto other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (Name != other.Name) return false;
if (RefAttrName != other.RefAttrName) return false;
if (DocString != other.DocString) return false;
if (Type != other.Type) return false;
if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(F, other.F)) return false;
if (I != other.I) return false;
if (S != other.S) return false;
if (!object.Equals(T, other.T)) return false;
if (!object.Equals(G, other.G)) return false;
if (!object.Equals(SparseTensor, other.SparseTensor)) return false;
if(!floats_.Equals(other.floats_)) return false;
if(!ints_.Equals(other.ints_)) return false;
if(!strings_.Equals(other.strings_)) return false;
if(!tensors_.Equals(other.tensors_)) return false;
if(!graphs_.Equals(other.graphs_)) return false;
if(!sparseTensors_.Equals(other.sparseTensors_)) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Name.Length != 0) hash ^= Name.GetHashCode();
if (RefAttrName.Length != 0) hash ^= RefAttrName.GetHashCode();
if (DocString.Length != 0) hash ^= DocString.GetHashCode();
if (Type != global::Onnx.AttributeProto.Types.AttributeType.Undefined) hash ^= Type.GetHashCode();
if (F != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(F);
if (I != 0L) hash ^= I.GetHashCode();
if (S.Length != 0) hash ^= S.GetHashCode();
if (t_ != null) hash ^= T.GetHashCode();
if (g_ != null) hash ^= G.GetHashCode();
if (sparseTensor_ != null) hash ^= SparseTensor.GetHashCode();
hash ^= floats_.GetHashCode();
hash ^= ints_.GetHashCode();
hash ^= strings_.GetHashCode();
hash ^= tensors_.GetHashCode();
hash ^= graphs_.GetHashCode();
hash ^= sparseTensors_.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Name.Length != 0) {
output.WriteRawTag(10);
output.WriteString(Name);
}
if (F != 0F) {
output.WriteRawTag(21);
output.WriteFloat(F);
}
if (I != 0L) {
output.WriteRawTag(24);
output.WriteInt64(I);
}
if (S.Length != 0) {
output.WriteRawTag(34);
output.WriteBytes(S);
}
if (t_ != null) {
output.WriteRawTag(42);
output.WriteMessage(T);
}
if (g_ != null) {
output.WriteRawTag(50);
output.WriteMessage(G);
}
floats_.WriteTo(output, _repeated_floats_codec);
ints_.WriteTo(output, _repeated_ints_codec);
strings_.WriteTo(output, _repeated_strings_codec);
tensors_.WriteTo(output, _repeated_tensors_codec);
graphs_.WriteTo(output, _repeated_graphs_codec);
if (DocString.Length != 0) {
output.WriteRawTag(106);
output.WriteString(DocString);
}
if (Type != global::Onnx.AttributeProto.Types.AttributeType.Undefined) {
output.WriteRawTag(160, 1);
output.WriteEnum((int) Type);
}
if (RefAttrName.Length != 0) {
output.WriteRawTag(170, 1);
output.WriteString(RefAttrName);
}
if (sparseTensor_ != null) {
output.WriteRawTag(178, 1);
output.WriteMessage(SparseTensor);
}
sparseTensors_.WriteTo(output, _repeated_sparseTensors_codec);
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Name.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);
}
if (RefAttrName.Length != 0) {
size += 2 + pb::CodedOutputStream.ComputeStringSize(RefAttrName);
}
if (DocString.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(DocString);
}
if (Type != global::Onnx.AttributeProto.Types.AttributeType.Undefined) {
size += 2 + pb::CodedOutputStream.ComputeEnumSize((int) Type);
}
if (F != 0F) {
size += 1 + 4;
}
if (I != 0L) {
size += 1 + pb::CodedOutputStream.ComputeInt64Size(I);
}
if (S.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeBytesSize(S);
}
if (t_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(T);
}
if (g_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(G);
}
if (sparseTensor_ != null) {
size += 2 + pb::CodedOutputStream.ComputeMessageSize(SparseTensor);
}
size += floats_.CalculateSize(_repeated_floats_codec);
size += ints_.CalculateSize(_repeated_ints_codec);
size += strings_.CalculateSize(_repeated_strings_codec);
size += tensors_.CalculateSize(_repeated_tensors_codec);
size += graphs_.CalculateSize(_repeated_graphs_codec);
size += sparseTensors_.CalculateSize(_repeated_sparseTensors_codec);
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(AttributeProto other) {
if (other == null) {
return;
}
if (other.Name.Length != 0) {
Name = other.Name;
}
if (other.RefAttrName.Length != 0) {
RefAttrName = other.RefAttrName;
}
if (other.DocString.Length != 0) {
DocString = other.DocString;
}
if (other.Type != global::Onnx.AttributeProto.Types.AttributeType.Undefined) {
Type = other.Type;
}
if (other.F != 0F) {
F = other.F;
}
if (other.I != 0L) {
I = other.I;
}
if (other.S.Length != 0) {
S = other.S;
}
if (other.t_ != null) {
if (t_ == null) {
T = new global::Onnx.TensorProto();
}
T.MergeFrom(other.T);
}
if (other.g_ != null) {
if (g_ == null) {
G = new global::Onnx.GraphProto();
}
G.MergeFrom(other.G);
}
if (other.sparseTensor_ != null) {
if (sparseTensor_ == null) {
SparseTensor = new global::Onnx.SparseTensorProto();
}
SparseTensor.MergeFrom(other.SparseTensor);
}
floats_.Add(other.floats_);
ints_.Add(other.ints_);
strings_.Add(other.strings_);
tensors_.Add(other.tensors_);
graphs_.Add(other.graphs_);
sparseTensors_.Add(other.sparseTensors_);
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
Name = input.ReadString();
break;
}
case 21: {
F = input.ReadFloat();
break;
}
case 24: {
I = input.ReadInt64();
break;
}
case 34: {
S = input.ReadBytes();
break;
}
case 42: {
if (t_ == null) {
T = new global::Onnx.TensorProto();
}
input.ReadMessage(T);
break;
}
case 50: {
if (g_ == null) {
G = new global::Onnx.GraphProto();
}
input.ReadMessage(G);
break;
}
case 58:
case 61: {
floats_.AddEntriesFrom(input, _repeated_floats_codec);
break;
}
case 66:
case 64: {
ints_.AddEntriesFrom(input, _repeated_ints_codec);
break;
}
case 74: {
strings_.AddEntriesFrom(input, _repeated_strings_codec);
break;
}
case 82: {
tensors_.AddEntriesFrom(input, _repeated_tensors_codec);
break;
}
case 90: {
graphs_.AddEntriesFrom(input, _repeated_graphs_codec);
break;
}
case 106: {
DocString = input.ReadString();
break;
}
case 160: {
Type = (global::Onnx.AttributeProto.Types.AttributeType) input.ReadEnum();
break;
}
case 170: {
RefAttrName = input.ReadString();
break;
}
case 178: {
if (sparseTensor_ == null) {
SparseTensor = new global::Onnx.SparseTensorProto();
}
input.ReadMessage(SparseTensor);
break;
}
case 186: {
sparseTensors_.AddEntriesFrom(input, _repeated_sparseTensors_codec);
break;
}
}
}
}
#region Nested types
/// <summary>Container for nested types declared in the AttributeProto message type.</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static partial class Types {
/// <summary>
/// Note: this enum is structurally identical to the OpSchema::AttrType
/// enum defined in schema.h. If you rev one, you likely need to rev the other.
/// </summary>
public enum AttributeType {
[pbr::OriginalName("UNDEFINED")] Undefined = 0,
[pbr::OriginalName("FLOAT")] Float = 1,
[pbr::OriginalName("INT")] Int = 2,
[pbr::OriginalName("STRING")] String = 3,
[pbr::OriginalName("TENSOR")] Tensor = 4,
[pbr::OriginalName("GRAPH")] Graph = 5,
[pbr::OriginalName("SPARSE_TENSOR")] SparseTensor = 11,
[pbr::OriginalName("FLOATS")] Floats = 6,
[pbr::OriginalName("INTS")] Ints = 7,
[pbr::OriginalName("STRINGS")] Strings = 8,
[pbr::OriginalName("TENSORS")] Tensors = 9,
[pbr::OriginalName("GRAPHS")] Graphs = 10,
[pbr::OriginalName("SPARSE_TENSORS")] SparseTensors = 12,
}
}
#endregion
}
/// <summary>
/// Defines information on value, including the name, the type, and
/// the shape of the value.
/// </summary>
public sealed partial class ValueInfoProto : pb::IMessage<ValueInfoProto> {
private static readonly pb::MessageParser<ValueInfoProto> _parser = new pb::MessageParser<ValueInfoProto>(() => new ValueInfoProto());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<ValueInfoProto> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Onnx.OnnxMlReflection.Descriptor.MessageTypes[1]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ValueInfoProto() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ValueInfoProto(ValueInfoProto other) : this() {
name_ = other.name_;
type_ = other.type_ != null ? other.type_.Clone() : null;
docString_ = other.docString_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ValueInfoProto Clone() {
return new ValueInfoProto(this);
}
/// <summary>Field number for the "name" field.</summary>
public const int NameFieldNumber = 1;
private string name_ = "";
/// <summary>
/// This field MUST be present in this version of the IR.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Name {
get { return name_; }
set {
name_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "type" field.</summary>
public const int TypeFieldNumber = 2;
private global::Onnx.TypeProto type_;
/// <summary>
/// This field MUST be present in this version of the IR for
/// inputs and outputs of the top-level graph.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Onnx.TypeProto Type {
get { return type_; }
set {
type_ = value;
}
}
/// <summary>Field number for the "doc_string" field.</summary>
public const int DocStringFieldNumber = 3;
private string docString_ = "";
/// <summary>
/// A human-readable documentation for this value. Markdown is allowed.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string DocString {
get { return docString_; }
set {
docString_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as ValueInfoProto);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(ValueInfoProto other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (Name != other.Name) return false;
if (!object.Equals(Type, other.Type)) return false;
if (DocString != other.DocString) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Name.Length != 0) hash ^= Name.GetHashCode();
if (type_ != null) hash ^= Type.GetHashCode();
if (DocString.Length != 0) hash ^= DocString.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Name.Length != 0) {
output.WriteRawTag(10);
output.WriteString(Name);
}
if (type_ != null) {
output.WriteRawTag(18);
output.WriteMessage(Type);
}
if (DocString.Length != 0) {
output.WriteRawTag(26);
output.WriteString(DocString);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Name.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);
}
if (type_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(Type);
}
if (DocString.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(DocString);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(ValueInfoProto other) {
if (other == null) {
return;
}
if (other.Name.Length != 0) {
Name = other.Name;
}
if (other.type_ != null) {
if (type_ == null) {
Type = new global::Onnx.TypeProto();
}
Type.MergeFrom(other.Type);
}
if (other.DocString.Length != 0) {
DocString = other.DocString;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
Name = input.ReadString();
break;
}
case 18: {
if (type_ == null) {
Type = new global::Onnx.TypeProto();
}
input.ReadMessage(Type);
break;
}
case 26: {
DocString = input.ReadString();
break;
}
}
}
}
}
/// <summary>
/// Nodes
///
/// Computation graphs are made up of a DAG of nodes, which represent what is
/// commonly called a "layer" or "pipeline stage" in machine learning frameworks.
///
/// For example, it can be a node of type "Conv" that takes in an image, a filter
/// tensor and a bias tensor, and produces the convolved output.
/// </summary>
public sealed partial class NodeProto : pb::IMessage<NodeProto> {
private static readonly pb::MessageParser<NodeProto> _parser = new pb::MessageParser<NodeProto>(() => new NodeProto());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<NodeProto> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Onnx.OnnxMlReflection.Descriptor.MessageTypes[2]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public NodeProto() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public NodeProto(NodeProto other) : this() {
input_ = other.input_.Clone();
output_ = other.output_.Clone();
name_ = other.name_;
opType_ = other.opType_;
domain_ = other.domain_;
attribute_ = other.attribute_.Clone();
docString_ = other.docString_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public NodeProto Clone() {
return new NodeProto(this);
}
/// <summary>Field number for the "input" field.</summary>
public const int InputFieldNumber = 1;
private static readonly pb::FieldCodec<string> _repeated_input_codec
= pb::FieldCodec.ForString(10);
private readonly pbc::RepeatedField<string> input_ = new pbc::RepeatedField<string>();
/// <summary>
/// namespace Value
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<string> Input {
get { return input_; }
}
/// <summary>Field number for the "output" field.</summary>
public const int OutputFieldNumber = 2;
private static readonly pb::FieldCodec<string> _repeated_output_codec
= pb::FieldCodec.ForString(18);
private readonly pbc::RepeatedField<string> output_ = new pbc::RepeatedField<string>();
/// <summary>
/// namespace Value
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<string> Output {
get { return output_; }
}
/// <summary>Field number for the "name" field.</summary>
public const int NameFieldNumber = 3;
private string name_ = "";
/// <summary>
/// An optional identifier for this node in a graph.
/// This field MAY be absent in ths version of the IR.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Name {
get { return name_; }
set {
name_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "op_type" field.</summary>
public const int OpTypeFieldNumber = 4;
private string opType_ = "";
/// <summary>
/// The symbolic identifier of the Operator to execute.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string OpType {
get { return opType_; }
set {
opType_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "domain" field.</summary>
public const int DomainFieldNumber = 7;
private string domain_ = "";
/// <summary>
/// The domain of the OperatorSet that specifies the operator named by op_type.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Domain {
get { return domain_; }
set {
domain_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "attribute" field.</summary>
public const int AttributeFieldNumber = 5;
private static readonly pb::FieldCodec<global::Onnx.AttributeProto> _repeated_attribute_codec
= pb::FieldCodec.ForMessage(42, global::Onnx.AttributeProto.Parser);
private readonly pbc::RepeatedField<global::Onnx.AttributeProto> attribute_ = new pbc::RepeatedField<global::Onnx.AttributeProto>();
/// <summary>
/// Additional named attributes.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Onnx.AttributeProto> Attribute {
get { return attribute_; }
}
/// <summary>Field number for the "doc_string" field.</summary>
public const int DocStringFieldNumber = 6;
private string docString_ = "";
/// <summary>
/// A human-readable documentation for this node. Markdown is allowed.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string DocString {
get { return docString_; }
set {
docString_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as NodeProto);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(NodeProto other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if(!input_.Equals(other.input_)) return false;
if(!output_.Equals(other.output_)) return false;
if (Name != other.Name) return false;
if (OpType != other.OpType) return false;
if (Domain != other.Domain) return false;
if(!attribute_.Equals(other.attribute_)) return false;
if (DocString != other.DocString) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
hash ^= input_.GetHashCode();
hash ^= output_.GetHashCode();
if (Name.Length != 0) hash ^= Name.GetHashCode();
if (OpType.Length != 0) hash ^= OpType.GetHashCode();
if (Domain.Length != 0) hash ^= Domain.GetHashCode();
hash ^= attribute_.GetHashCode();
if (DocString.Length != 0) hash ^= DocString.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
input_.WriteTo(output, _repeated_input_codec);
output_.WriteTo(output, _repeated_output_codec);
if (Name.Length != 0) {
output.WriteRawTag(26);
output.WriteString(Name);
}
if (OpType.Length != 0) {
output.WriteRawTag(34);
output.WriteString(OpType);
}
attribute_.WriteTo(output, _repeated_attribute_codec);
if (DocString.Length != 0) {
output.WriteRawTag(50);
output.WriteString(DocString);
}
if (Domain.Length != 0) {
output.WriteRawTag(58);
output.WriteString(Domain);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
size += input_.CalculateSize(_repeated_input_codec);
size += output_.CalculateSize(_repeated_output_codec);
if (Name.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);
}
if (OpType.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(OpType);
}
if (Domain.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Domain);
}
size += attribute_.CalculateSize(_repeated_attribute_codec);
if (DocString.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(DocString);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(NodeProto other) {
if (other == null) {
return;
}
input_.Add(other.input_);
output_.Add(other.output_);
if (other.Name.Length != 0) {
Name = other.Name;
}
if (other.OpType.Length != 0) {
OpType = other.OpType;
}
if (other.Domain.Length != 0) {
Domain = other.Domain;
}
attribute_.Add(other.attribute_);
if (other.DocString.Length != 0) {
DocString = other.DocString;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
input_.AddEntriesFrom(input, _repeated_input_codec);
break;
}
case 18: {
output_.AddEntriesFrom(input, _repeated_output_codec);
break;
}
case 26: {
Name = input.ReadString();
break;
}
case 34: {
OpType = input.ReadString();
break;
}
case 42: {
attribute_.AddEntriesFrom(input, _repeated_attribute_codec);
break;
}
case 50: {
DocString = input.ReadString();
break;
}
case 58: {
Domain = input.ReadString();
break;
}
}
}
}
}
/// <summary>
/// Training information
/// TrainingInfoProto stores information for training a model.
/// In particular, this defines two functionalities: an initialization-step
/// and a training-algorithm-step. Initialization resets the model
/// back to its original state as if no training has been performed.
/// Training algorithm improves the model based on input data.
///
/// The semantics of the initialization-step is that the initializers
/// in ModelProto.graph and in TrainingInfoProto.algorithm are first
/// initialized as specified by the initializers in the graph, and then
/// updated by the "initialization_binding" in every instance in
/// ModelProto.training_info.
///
/// The field "algorithm" defines a computation graph which represents a
/// training algorithm's step. After the execution of a
/// TrainingInfoProto.algorithm, the initializers specified by "update_binding"
/// may be immediately updated. If the targeted training algorithm contains
/// consecutive update steps (such as block coordinate descent methods),
/// the user needs to create a TrainingInfoProto for each step.
/// </summary>
public sealed partial class TrainingInfoProto : pb::IMessage<TrainingInfoProto> {
private static readonly pb::MessageParser<TrainingInfoProto> _parser = new pb::MessageParser<TrainingInfoProto>(() => new TrainingInfoProto());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<TrainingInfoProto> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Onnx.OnnxMlReflection.Descriptor.MessageTypes[3]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public TrainingInfoProto() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public TrainingInfoProto(TrainingInfoProto other) : this() {
initialization_ = other.initialization_ != null ? other.initialization_.Clone() : null;
algorithm_ = other.algorithm_ != null ? other.algorithm_.Clone() : null;
initializationBinding_ = other.initializationBinding_.Clone();
updateBinding_ = other.updateBinding_.Clone();
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public TrainingInfoProto Clone() {
return new TrainingInfoProto(this);
}
/// <summary>Field number for the "initialization" field.</summary>
public const int InitializationFieldNumber = 1;
private global::Onnx.GraphProto initialization_;
/// <summary>
/// This field describes a graph to compute the initial tensors
/// upon starting the training process. Initialization graph has no input
/// and can have multiple outputs. Usually, trainable tensors in neural
/// networks are randomly initialized. To achieve that, for each tensor,
/// the user can put a random number operator such as RandomNormal or
/// RandomUniform in TrainingInfoProto.initialization.node and assign its
/// random output to the specific tensor using "initialization_binding".
/// This graph can also set the initializers in "algorithm" in the same
/// TrainingInfoProto; a use case is resetting the number of training
/// iteration to zero.
///
/// By default, this field is an empty graph and its evaluation does not
/// produce any output. Thus, no initializer would be changed by default.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Onnx.GraphProto Initialization {
get { return initialization_; }
set {
initialization_ = value;
}
}
/// <summary>Field number for the "algorithm" field.</summary>
public const int AlgorithmFieldNumber = 2;
private global::Onnx.GraphProto algorithm_;
/// <summary>
/// This field represents a training algorithm step. Given required inputs,
/// it computes outputs to update initializers in its own or inference graph's
/// initializer lists. In general, this field contains loss node, gradient node,
/// optimizer node, increment of iteration count.
///
/// An execution of the training algorithm step is performed by executing the
/// graph obtained by combining the inference graph (namely "ModelProto.graph")
/// and the "algorithm" graph. That is, the actual the actual
/// input/initializer/output/node/value_info/sparse_initializer list of
/// the training graph is the concatenation of
/// "ModelProto.graph.input/initializer/output/node/value_info/sparse_initializer"
/// and "algorithm.input/initializer/output/node/value_info/sparse_initializer"
/// in that order. This combined graph must satisfy the normal ONNX conditions.
/// Now, let's provide a visualization of graph combination for clarity.
/// Let the inference graph (i.e., "ModelProto.graph") be
/// tensor_a, tensor_b -> MatMul -> tensor_c -> Sigmoid -> tensor_d
/// and the "algorithm" graph be
/// tensor_d -> Add -> tensor_e
/// The combination process results
/// tensor_a, tensor_b -> MatMul -> tensor_c -> Sigmoid -> tensor_d -> Add -> tensor_e
///
/// Notice that an input of a node in the "algorithm" graph may reference the
/// output of a node in the inference graph (but not the other way round). Also, inference
/// node cannot reference inputs of "algorithm". With these restrictions, inference graph
/// can always be run independently without training information.
///
/// By default, this field is an empty graph and its evaluation does not
/// produce any output. Evaluating the default training step never
/// update any initializers.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Onnx.GraphProto Algorithm {
get { return algorithm_; }
set {
algorithm_ = value;
}
}
/// <summary>Field number for the "initialization_binding" field.</summary>
public const int InitializationBindingFieldNumber = 3;
private static readonly pb::FieldCodec<global::Onnx.StringStringEntryProto> _repeated_initializationBinding_codec
= pb::FieldCodec.ForMessage(26, global::Onnx.StringStringEntryProto.Parser);
private readonly pbc::RepeatedField<global::Onnx.StringStringEntryProto> initializationBinding_ = new pbc::RepeatedField<global::Onnx.StringStringEntryProto>();
/// <summary>
/// This field specifies the bindings from the outputs of "initialization" to
/// some initializers in "ModelProto.graph.initializer" and
/// the "algorithm.initializer" in the same TrainingInfoProto.
/// See "update_binding" below for details.
///
/// By default, this field is empty and no initializer would be changed
/// by the execution of "initialization".
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Onnx.StringStringEntryProto> InitializationBinding {
get { return initializationBinding_; }
}
/// <summary>Field number for the "update_binding" field.</summary>
public const int UpdateBindingFieldNumber = 4;
private static readonly pb::FieldCodec<global::Onnx.StringStringEntryProto> _repeated_updateBinding_codec
= pb::FieldCodec.ForMessage(34, global::Onnx.StringStringEntryProto.Parser);
private readonly pbc::RepeatedField<global::Onnx.StringStringEntryProto> updateBinding_ = new pbc::RepeatedField<global::Onnx.StringStringEntryProto>();
/// <summary>
/// Gradient-based training is usually an iterative procedure. In one gradient
/// descent iteration, we apply
///
/// x = x - r * g
///
/// where "x" is the optimized tensor, "r" stands for learning rate, and "g" is
/// gradient of "x" with respect to a chosen loss. To avoid adding assignments
/// into the training graph, we split the update equation into
///
/// y = x - r * g
/// x = y
///
/// The user needs to save "y = x - r * g" into TrainingInfoProto.algorithm. To
/// tell that "y" should be assigned to "x", the field "update_binding" may
/// contain a key-value pair of strings, "x" (key of StringStringEntryProto)
/// and "y" (value of StringStringEntryProto).
/// For a neural network with multiple trainable (mutable) tensors, there can
/// be multiple key-value pairs in "update_binding".
///
/// The initializers appears as keys in "update_binding" are considered
/// mutable variables. This implies some behaviors
/// as described below.
///
/// 1. We have only unique keys in all "update_binding"s so that two
/// variables may not have the same name. This ensures that one
/// variable is assigned up to once.
/// 2. The keys must appear in names of "ModelProto.graph.initializer" or
/// "TrainingInfoProto.algorithm.initializer".
/// 3. The values must be output names of "algorithm" or "ModelProto.graph.output".
/// 4. Mutable variables are initialized to the value specified by the
/// corresponding initializer, and then potentially updated by
/// "initializer_binding"s and "update_binding"s in "TrainingInfoProto"s.
///
/// This field usually contains names of trainable tensors
/// (in ModelProto.graph), optimizer states such as momentums in advanced
/// stochastic gradient methods (in TrainingInfoProto.graph),
/// and number of training iterations (in TrainingInfoProto.graph).
///
/// By default, this field is empty and no initializer would be changed
/// by the execution of "algorithm".
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Onnx.StringStringEntryProto> UpdateBinding {
get { return updateBinding_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as TrainingInfoProto);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(TrainingInfoProto other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (!object.Equals(Initialization, other.Initialization)) return false;
if (!object.Equals(Algorithm, other.Algorithm)) return false;
if(!initializationBinding_.Equals(other.initializationBinding_)) return false;
if(!updateBinding_.Equals(other.updateBinding_)) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (initialization_ != null) hash ^= Initialization.GetHashCode();
if (algorithm_ != null) hash ^= Algorithm.GetHashCode();
hash ^= initializationBinding_.GetHashCode();
hash ^= updateBinding_.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (initialization_ != null) {
output.WriteRawTag(10);
output.WriteMessage(Initialization);
}
if (algorithm_ != null) {
output.WriteRawTag(18);
output.WriteMessage(Algorithm);
}
initializationBinding_.WriteTo(output, _repeated_initializationBinding_codec);
updateBinding_.WriteTo(output, _repeated_updateBinding_codec);
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (initialization_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(Initialization);
}
if (algorithm_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(Algorithm);
}
size += initializationBinding_.CalculateSize(_repeated_initializationBinding_codec);
size += updateBinding_.CalculateSize(_repeated_updateBinding_codec);
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(TrainingInfoProto other) {
if (other == null) {
return;
}
if (other.initialization_ != null) {
if (initialization_ == null) {
Initialization = new global::Onnx.GraphProto();
}
Initialization.MergeFrom(other.Initialization);
}
if (other.algorithm_ != null) {
if (algorithm_ == null) {
Algorithm = new global::Onnx.GraphProto();
}
Algorithm.MergeFrom(other.Algorithm);
}
initializationBinding_.Add(other.initializationBinding_);
updateBinding_.Add(other.updateBinding_);
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
if (initialization_ == null) {
Initialization = new global::Onnx.GraphProto();
}
input.ReadMessage(Initialization);
break;
}
case 18: {
if (algorithm_ == null) {
Algorithm = new global::Onnx.GraphProto();
}
input.ReadMessage(Algorithm);
break;
}
case 26: {
initializationBinding_.AddEntriesFrom(input, _repeated_initializationBinding_codec);
break;
}
case 34: {
updateBinding_.AddEntriesFrom(input, _repeated_updateBinding_codec);
break;
}
}
}
}
}
/// <summary>
/// Models
///
/// ModelProto is a top-level file/container format for bundling a ML model and
/// associating its computation graph with metadata.
///
/// The semantics of the model are described by the associated GraphProto's.
/// </summary>
public sealed partial class ModelProto : pb::IMessage<ModelProto> {
private static readonly pb::MessageParser<ModelProto> _parser = new pb::MessageParser<ModelProto>(() => new ModelProto());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<ModelProto> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Onnx.OnnxMlReflection.Descriptor.MessageTypes[4]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ModelProto() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ModelProto(ModelProto other) : this() {
irVersion_ = other.irVersion_;
opsetImport_ = other.opsetImport_.Clone();
producerName_ = other.producerName_;
producerVersion_ = other.producerVersion_;
domain_ = other.domain_;
modelVersion_ = other.modelVersion_;
docString_ = other.docString_;
graph_ = other.graph_ != null ? other.graph_.Clone() : null;
metadataProps_ = other.metadataProps_.Clone();
trainingInfo_ = other.trainingInfo_.Clone();
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ModelProto Clone() {
return new ModelProto(this);
}
/// <summary>Field number for the "ir_version" field.</summary>
public const int IrVersionFieldNumber = 1;
private long irVersion_;
/// <summary>
/// The version of the IR this model targets. See Version enum above.
/// This field MUST be present.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long IrVersion {
get { return irVersion_; }
set {
irVersion_ = value;
}
}
/// <summary>Field number for the "opset_import" field.</summary>
public const int OpsetImportFieldNumber = 8;
private static readonly pb::FieldCodec<global::Onnx.OperatorSetIdProto> _repeated_opsetImport_codec
= pb::FieldCodec.ForMessage(66, global::Onnx.OperatorSetIdProto.Parser);
private readonly pbc::RepeatedField<global::Onnx.OperatorSetIdProto> opsetImport_ = new pbc::RepeatedField<global::Onnx.OperatorSetIdProto>();
/// <summary>
/// The OperatorSets this model relies on.
/// All ModelProtos MUST have at least one entry that
/// specifies which version of the ONNX OperatorSet is
/// being imported.
///
/// All nodes in the ModelProto's graph will bind against the operator
/// with the same-domain/same-op_type operator with the HIGHEST version
/// in the referenced operator sets.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Onnx.OperatorSetIdProto> OpsetImport {
get { return opsetImport_; }
}
/// <summary>Field number for the "producer_name" field.</summary>
public const int ProducerNameFieldNumber = 2;
private string producerName_ = "";
/// <summary>
/// The name of the framework or tool used to generate this model.
/// This field SHOULD be present to indicate which implementation/tool/framework
/// emitted the model.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string ProducerName {
get { return producerName_; }
set {
producerName_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "producer_version" field.</summary>
public const int ProducerVersionFieldNumber = 3;
private string producerVersion_ = "";
/// <summary>
/// The version of the framework or tool used to generate this model.
/// This field SHOULD be present to indicate which implementation/tool/framework
/// emitted the model.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string ProducerVersion {
get { return producerVersion_; }
set {
producerVersion_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "domain" field.</summary>
public const int DomainFieldNumber = 4;
private string domain_ = "";
/// <summary>
/// Domain name of the model.
/// We use reverse domain names as name space indicators. For example:
/// `com.facebook.fair` or `com.microsoft.cognitiveservices`
///
/// Together with `model_version` and GraphProto.name, this forms the unique identity of
/// the graph.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Domain {
get { return domain_; }
set {
domain_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "model_version" field.</summary>
public const int ModelVersionFieldNumber = 5;
private long modelVersion_;
/// <summary>
/// The version of the graph encoded. See Version enum below.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long ModelVersion {
get { return modelVersion_; }
set {
modelVersion_ = value;
}
}
/// <summary>Field number for the "doc_string" field.</summary>
public const int DocStringFieldNumber = 6;
private string docString_ = "";
/// <summary>
/// A human-readable documentation for this model. Markdown is allowed.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string DocString {
get { return docString_; }
set {
docString_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "graph" field.</summary>
public const int GraphFieldNumber = 7;
private global::Onnx.GraphProto graph_;
/// <summary>
/// The parameterized graph that is evaluated to execute the model.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Onnx.GraphProto Graph {
get { return graph_; }
set {
graph_ = value;
}
}
/// <summary>Field number for the "metadata_props" field.</summary>
public const int MetadataPropsFieldNumber = 14;
private static readonly pb::FieldCodec<global::Onnx.StringStringEntryProto> _repeated_metadataProps_codec
= pb::FieldCodec.ForMessage(114, global::Onnx.StringStringEntryProto.Parser);
private readonly pbc::RepeatedField<global::Onnx.StringStringEntryProto> metadataProps_ = new pbc::RepeatedField<global::Onnx.StringStringEntryProto>();
/// <summary>
/// Named metadata values; keys should be distinct.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Onnx.StringStringEntryProto> MetadataProps {
get { return metadataProps_; }
}
/// <summary>Field number for the "training_info" field.</summary>
public const int TrainingInfoFieldNumber = 20;
private static readonly pb::FieldCodec<global::Onnx.TrainingInfoProto> _repeated_trainingInfo_codec
= pb::FieldCodec.ForMessage(162, global::Onnx.TrainingInfoProto.Parser);
private readonly pbc::RepeatedField<global::Onnx.TrainingInfoProto> trainingInfo_ = new pbc::RepeatedField<global::Onnx.TrainingInfoProto>();
/// <summary>
/// Training-specific information. Sequentially executing all stored
/// `TrainingInfoProto.algorithm`s and assigning their outputs following
/// the corresponding `TrainingInfoProto.update_binding`s is one training
/// iteration. Similarly, to initialize the model
/// (as if training hasn't happened), the user should sequentially execute
/// all stored `TrainingInfoProto.initialization`s and assigns their outputs
/// using `TrainingInfoProto.initialization_binding`s.
///
/// If this field is empty, the training behavior of the model is undefined.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Onnx.TrainingInfoProto> TrainingInfo {
get { return trainingInfo_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as ModelProto);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(ModelProto other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (IrVersion != other.IrVersion) return false;
if(!opsetImport_.Equals(other.opsetImport_)) return false;
if (ProducerName != other.ProducerName) return false;
if (ProducerVersion != other.ProducerVersion) return false;
if (Domain != other.Domain) return false;
if (ModelVersion != other.ModelVersion) return false;
if (DocString != other.DocString) return false;
if (!object.Equals(Graph, other.Graph)) return false;
if(!metadataProps_.Equals(other.metadataProps_)) return false;
if(!trainingInfo_.Equals(other.trainingInfo_)) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (IrVersion != 0L) hash ^= IrVersion.GetHashCode();
hash ^= opsetImport_.GetHashCode();
if (ProducerName.Length != 0) hash ^= ProducerName.GetHashCode();
if (ProducerVersion.Length != 0) hash ^= ProducerVersion.GetHashCode();
if (Domain.Length != 0) hash ^= Domain.GetHashCode();
if (ModelVersion != 0L) hash ^= ModelVersion.GetHashCode();
if (DocString.Length != 0) hash ^= DocString.GetHashCode();
if (graph_ != null) hash ^= Graph.GetHashCode();
hash ^= metadataProps_.GetHashCode();
hash ^= trainingInfo_.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (IrVersion != 0L) {
output.WriteRawTag(8);
output.WriteInt64(IrVersion);
}
if (ProducerName.Length != 0) {
output.WriteRawTag(18);
output.WriteString(ProducerName);
}
if (ProducerVersion.Length != 0) {
output.WriteRawTag(26);
output.WriteString(ProducerVersion);
}
if (Domain.Length != 0) {
output.WriteRawTag(34);
output.WriteString(Domain);
}
if (ModelVersion != 0L) {
output.WriteRawTag(40);
output.WriteInt64(ModelVersion);
}
if (DocString.Length != 0) {
output.WriteRawTag(50);
output.WriteString(DocString);
}
if (graph_ != null) {
output.WriteRawTag(58);
output.WriteMessage(Graph);
}
opsetImport_.WriteTo(output, _repeated_opsetImport_codec);
metadataProps_.WriteTo(output, _repeated_metadataProps_codec);
trainingInfo_.WriteTo(output, _repeated_trainingInfo_codec);
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (IrVersion != 0L) {
size += 1 + pb::CodedOutputStream.ComputeInt64Size(IrVersion);
}
size += opsetImport_.CalculateSize(_repeated_opsetImport_codec);
if (ProducerName.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(ProducerName);
}
if (ProducerVersion.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(ProducerVersion);
}
if (Domain.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Domain);
}
if (ModelVersion != 0L) {
size += 1 + pb::CodedOutputStream.ComputeInt64Size(ModelVersion);
}
if (DocString.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(DocString);
}
if (graph_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(Graph);
}
size += metadataProps_.CalculateSize(_repeated_metadataProps_codec);
size += trainingInfo_.CalculateSize(_repeated_trainingInfo_codec);
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(ModelProto other) {
if (other == null) {
return;
}
if (other.IrVersion != 0L) {
IrVersion = other.IrVersion;
}
opsetImport_.Add(other.opsetImport_);
if (other.ProducerName.Length != 0) {
ProducerName = other.ProducerName;
}
if (other.ProducerVersion.Length != 0) {
ProducerVersion = other.ProducerVersion;
}
if (other.Domain.Length != 0) {
Domain = other.Domain;
}
if (other.ModelVersion != 0L) {
ModelVersion = other.ModelVersion;
}
if (other.DocString.Length != 0) {
DocString = other.DocString;
}
if (other.graph_ != null) {
if (graph_ == null) {
Graph = new global::Onnx.GraphProto();
}
Graph.MergeFrom(other.Graph);
}
metadataProps_.Add(other.metadataProps_);
trainingInfo_.Add(other.trainingInfo_);
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
IrVersion = input.ReadInt64();
break;
}
case 18: {
ProducerName = input.ReadString();
break;
}
case 26: {
ProducerVersion = input.ReadString();
break;
}
case 34: {
Domain = input.ReadString();
break;
}
case 40: {
ModelVersion = input.ReadInt64();
break;
}
case 50: {
DocString = input.ReadString();
break;
}
case 58: {
if (graph_ == null) {
Graph = new global::Onnx.GraphProto();
}
input.ReadMessage(Graph);
break;
}
case 66: {
opsetImport_.AddEntriesFrom(input, _repeated_opsetImport_codec);
break;
}
case 114: {
metadataProps_.AddEntriesFrom(input, _repeated_metadataProps_codec);
break;
}
case 162: {
trainingInfo_.AddEntriesFrom(input, _repeated_trainingInfo_codec);
break;
}
}
}
}
}
/// <summary>
/// StringStringEntryProto follows the pattern for cross-proto-version maps.
/// See https://developers.google.com/protocol-buffers/docs/proto3#maps
/// </summary>
public sealed partial class StringStringEntryProto : pb::IMessage<StringStringEntryProto> {
private static readonly pb::MessageParser<StringStringEntryProto> _parser = new pb::MessageParser<StringStringEntryProto>(() => new StringStringEntryProto());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<StringStringEntryProto> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Onnx.OnnxMlReflection.Descriptor.MessageTypes[5]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public StringStringEntryProto() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public StringStringEntryProto(StringStringEntryProto other) : this() {
key_ = other.key_;
value_ = other.value_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public StringStringEntryProto Clone() {
return new StringStringEntryProto(this);
}
/// <summary>Field number for the "key" field.</summary>
public const int KeyFieldNumber = 1;
private string key_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Key {
get { return key_; }
set {
key_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "value" field.</summary>
public const int ValueFieldNumber = 2;
private string value_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Value {
get { return value_; }
set {
value_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as StringStringEntryProto);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(StringStringEntryProto other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (Key != other.Key) return false;
if (Value != other.Value) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Key.Length != 0) hash ^= Key.GetHashCode();
if (Value.Length != 0) hash ^= Value.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Key.Length != 0) {
output.WriteRawTag(10);
output.WriteString(Key);
}
if (Value.Length != 0) {
output.WriteRawTag(18);
output.WriteString(Value);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Key.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Key);
}
if (Value.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Value);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(StringStringEntryProto other) {
if (other == null) {
return;
}
if (other.Key.Length != 0) {
Key = other.Key;
}
if (other.Value.Length != 0) {
Value = other.Value;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
Key = input.ReadString();
break;
}
case 18: {
Value = input.ReadString();
break;
}
}
}
}
}
public sealed partial class TensorAnnotation : pb::IMessage<TensorAnnotation> {
private static readonly pb::MessageParser<TensorAnnotation> _parser = new pb::MessageParser<TensorAnnotation>(() => new TensorAnnotation());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<TensorAnnotation> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Onnx.OnnxMlReflection.Descriptor.MessageTypes[6]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public TensorAnnotation() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public TensorAnnotation(TensorAnnotation other) : this() {
tensorName_ = other.tensorName_;
quantParameterTensorNames_ = other.quantParameterTensorNames_.Clone();
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public TensorAnnotation Clone() {
return new TensorAnnotation(this);
}
/// <summary>Field number for the "tensor_name" field.</summary>
public const int TensorNameFieldNumber = 1;
private string tensorName_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string TensorName {
get { return tensorName_; }
set {
tensorName_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "quant_parameter_tensor_names" field.</summary>
public const int QuantParameterTensorNamesFieldNumber = 2;
private static readonly pb::FieldCodec<global::Onnx.StringStringEntryProto> _repeated_quantParameterTensorNames_codec
= pb::FieldCodec.ForMessage(18, global::Onnx.StringStringEntryProto.Parser);
private readonly pbc::RepeatedField<global::Onnx.StringStringEntryProto> quantParameterTensorNames_ = new pbc::RepeatedField<global::Onnx.StringStringEntryProto>();
/// <summary>
/// &lt;key, value> pairs to annotate tensor specified by &lt;tensor_name> above.
/// The keys used in the mapping below must be pre-defined in ONNX spec.
/// For example, for 8-bit linear quantization case, 'SCALE_TENSOR', 'ZERO_POINT_TENSOR' will be pre-defined as
/// quantization parameter keys.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Onnx.StringStringEntryProto> QuantParameterTensorNames {
get { return quantParameterTensorNames_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as TensorAnnotation);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(TensorAnnotation other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (TensorName != other.TensorName) return false;
if(!quantParameterTensorNames_.Equals(other.quantParameterTensorNames_)) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (TensorName.Length != 0) hash ^= TensorName.GetHashCode();
hash ^= quantParameterTensorNames_.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (TensorName.Length != 0) {
output.WriteRawTag(10);
output.WriteString(TensorName);
}
quantParameterTensorNames_.WriteTo(output, _repeated_quantParameterTensorNames_codec);
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (TensorName.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(TensorName);
}
size += quantParameterTensorNames_.CalculateSize(_repeated_quantParameterTensorNames_codec);
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(TensorAnnotation other) {
if (other == null) {
return;
}
if (other.TensorName.Length != 0) {
TensorName = other.TensorName;
}
quantParameterTensorNames_.Add(other.quantParameterTensorNames_);
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
TensorName = input.ReadString();
break;
}
case 18: {
quantParameterTensorNames_.AddEntriesFrom(input, _repeated_quantParameterTensorNames_codec);
break;
}
}
}
}
}
/// <summary>
/// Graphs
///
/// A graph defines the computational logic of a model and is comprised of a parameterized
/// list of nodes that form a directed acyclic graph based on their inputs and outputs.
/// This is the equivalent of the "network" or "graph" in many deep learning
/// frameworks.
/// </summary>
public sealed partial class GraphProto : pb::IMessage<GraphProto> {
private static readonly pb::MessageParser<GraphProto> _parser = new pb::MessageParser<GraphProto>(() => new GraphProto());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<GraphProto> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Onnx.OnnxMlReflection.Descriptor.MessageTypes[7]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public GraphProto() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public GraphProto(GraphProto other) : this() {
node_ = other.node_.Clone();
name_ = other.name_;
initializer_ = other.initializer_.Clone();
sparseInitializer_ = other.sparseInitializer_.Clone();
docString_ = other.docString_;
input_ = other.input_.Clone();
output_ = other.output_.Clone();
valueInfo_ = other.valueInfo_.Clone();
quantizationAnnotation_ = other.quantizationAnnotation_.Clone();
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public GraphProto Clone() {
return new GraphProto(this);
}
/// <summary>Field number for the "node" field.</summary>
public const int NodeFieldNumber = 1;
private static readonly pb::FieldCodec<global::Onnx.NodeProto> _repeated_node_codec
= pb::FieldCodec.ForMessage(10, global::Onnx.NodeProto.Parser);
private readonly pbc::RepeatedField<global::Onnx.NodeProto> node_ = new pbc::RepeatedField<global::Onnx.NodeProto>();
/// <summary>
/// The nodes in the graph, sorted topologically.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Onnx.NodeProto> Node {
get { return node_; }
}
/// <summary>Field number for the "name" field.</summary>
public const int NameFieldNumber = 2;
private string name_ = "";
/// <summary>
/// The name of the graph.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Name {
get { return name_; }
set {
name_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "initializer" field.</summary>
public const int InitializerFieldNumber = 5;
private static readonly pb::FieldCodec<global::Onnx.TensorProto> _repeated_initializer_codec
= pb::FieldCodec.ForMessage(42, global::Onnx.TensorProto.Parser);
private readonly pbc::RepeatedField<global::Onnx.TensorProto> initializer_ = new pbc::RepeatedField<global::Onnx.TensorProto>();
/// <summary>
/// A list of named tensor values, used to specify constant inputs of the graph.
/// Each initializer (both TensorProto as well SparseTensorProto) MUST have a name.
/// The name MUST be unique across both initializer and sparse_initializer,
/// but the name MAY also appear in the input list.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Onnx.TensorProto> Initializer {
get { return initializer_; }
}
/// <summary>Field number for the "sparse_initializer" field.</summary>
public const int SparseInitializerFieldNumber = 15;
private static readonly pb::FieldCodec<global::Onnx.SparseTensorProto> _repeated_sparseInitializer_codec
= pb::FieldCodec.ForMessage(122, global::Onnx.SparseTensorProto.Parser);
private readonly pbc::RepeatedField<global::Onnx.SparseTensorProto> sparseInitializer_ = new pbc::RepeatedField<global::Onnx.SparseTensorProto>();
/// <summary>
/// Initializers (see above) stored in sparse format.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Onnx.SparseTensorProto> SparseInitializer {
get { return sparseInitializer_; }
}
/// <summary>Field number for the "doc_string" field.</summary>
public const int DocStringFieldNumber = 10;
private string docString_ = "";
/// <summary>
/// A human-readable documentation for this graph. Markdown is allowed.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string DocString {
get { return docString_; }
set {
docString_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "input" field.</summary>
public const int InputFieldNumber = 11;
private static readonly pb::FieldCodec<global::Onnx.ValueInfoProto> _repeated_input_codec
= pb::FieldCodec.ForMessage(90, global::Onnx.ValueInfoProto.Parser);
private readonly pbc::RepeatedField<global::Onnx.ValueInfoProto> input_ = new pbc::RepeatedField<global::Onnx.ValueInfoProto>();
/// <summary>
/// The inputs and outputs of the graph.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Onnx.ValueInfoProto> Input {
get { return input_; }
}
/// <summary>Field number for the "output" field.</summary>
public const int OutputFieldNumber = 12;
private static readonly pb::FieldCodec<global::Onnx.ValueInfoProto> _repeated_output_codec
= pb::FieldCodec.ForMessage(98, global::Onnx.ValueInfoProto.Parser);
private readonly pbc::RepeatedField<global::Onnx.ValueInfoProto> output_ = new pbc::RepeatedField<global::Onnx.ValueInfoProto>();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Onnx.ValueInfoProto> Output {
get { return output_; }
}
/// <summary>Field number for the "value_info" field.</summary>
public const int ValueInfoFieldNumber = 13;
private static readonly pb::FieldCodec<global::Onnx.ValueInfoProto> _repeated_valueInfo_codec
= pb::FieldCodec.ForMessage(106, global::Onnx.ValueInfoProto.Parser);
private readonly pbc::RepeatedField<global::Onnx.ValueInfoProto> valueInfo_ = new pbc::RepeatedField<global::Onnx.ValueInfoProto>();
/// <summary>
/// Information for the values in the graph. The ValueInfoProto.name's
/// must be distinct. It is optional for a value to appear in value_info list.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Onnx.ValueInfoProto> ValueInfo {
get { return valueInfo_; }
}
/// <summary>Field number for the "quantization_annotation" field.</summary>
public const int QuantizationAnnotationFieldNumber = 14;
private static readonly pb::FieldCodec<global::Onnx.TensorAnnotation> _repeated_quantizationAnnotation_codec
= pb::FieldCodec.ForMessage(114, global::Onnx.TensorAnnotation.Parser);
private readonly pbc::RepeatedField<global::Onnx.TensorAnnotation> quantizationAnnotation_ = new pbc::RepeatedField<global::Onnx.TensorAnnotation>();
/// <summary>
/// This field carries information to indicate the mapping among a tensor and its
/// quantization parameter tensors. For example:
/// For tensor 'a', it may have {'SCALE_TENSOR', 'a_scale'} and {'ZERO_POINT_TENSOR', 'a_zero_point'} annotated,
/// which means, tensor 'a_scale' and tensor 'a_zero_point' are scale and zero point of tensor 'a' in the model.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Onnx.TensorAnnotation> QuantizationAnnotation {
get { return quantizationAnnotation_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as GraphProto);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(GraphProto other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if(!node_.Equals(other.node_)) return false;
if (Name != other.Name) return false;
if(!initializer_.Equals(other.initializer_)) return false;
if(!sparseInitializer_.Equals(other.sparseInitializer_)) return false;
if (DocString != other.DocString) return false;
if(!input_.Equals(other.input_)) return false;
if(!output_.Equals(other.output_)) return false;
if(!valueInfo_.Equals(other.valueInfo_)) return false;
if(!quantizationAnnotation_.Equals(other.quantizationAnnotation_)) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
hash ^= node_.GetHashCode();
if (Name.Length != 0) hash ^= Name.GetHashCode();
hash ^= initializer_.GetHashCode();
hash ^= sparseInitializer_.GetHashCode();
if (DocString.Length != 0) hash ^= DocString.GetHashCode();
hash ^= input_.GetHashCode();
hash ^= output_.GetHashCode();
hash ^= valueInfo_.GetHashCode();
hash ^= quantizationAnnotation_.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
node_.WriteTo(output, _repeated_node_codec);
if (Name.Length != 0) {
output.WriteRawTag(18);
output.WriteString(Name);
}
initializer_.WriteTo(output, _repeated_initializer_codec);
if (DocString.Length != 0) {
output.WriteRawTag(82);
output.WriteString(DocString);
}
input_.WriteTo(output, _repeated_input_codec);
output_.WriteTo(output, _repeated_output_codec);
valueInfo_.WriteTo(output, _repeated_valueInfo_codec);
quantizationAnnotation_.WriteTo(output, _repeated_quantizationAnnotation_codec);
sparseInitializer_.WriteTo(output, _repeated_sparseInitializer_codec);
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
size += node_.CalculateSize(_repeated_node_codec);
if (Name.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);
}
size += initializer_.CalculateSize(_repeated_initializer_codec);
size += sparseInitializer_.CalculateSize(_repeated_sparseInitializer_codec);
if (DocString.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(DocString);
}
size += input_.CalculateSize(_repeated_input_codec);
size += output_.CalculateSize(_repeated_output_codec);
size += valueInfo_.CalculateSize(_repeated_valueInfo_codec);
size += quantizationAnnotation_.CalculateSize(_repeated_quantizationAnnotation_codec);
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(GraphProto other) {
if (other == null) {
return;
}
node_.Add(other.node_);
if (other.Name.Length != 0) {
Name = other.Name;
}
initializer_.Add(other.initializer_);
sparseInitializer_.Add(other.sparseInitializer_);
if (other.DocString.Length != 0) {
DocString = other.DocString;
}
input_.Add(other.input_);
output_.Add(other.output_);
valueInfo_.Add(other.valueInfo_);
quantizationAnnotation_.Add(other.quantizationAnnotation_);
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
node_.AddEntriesFrom(input, _repeated_node_codec);
break;
}
case 18: {
Name = input.ReadString();
break;
}
case 42: {
initializer_.AddEntriesFrom(input, _repeated_initializer_codec);
break;
}
case 82: {
DocString = input.ReadString();
break;
}
case 90: {
input_.AddEntriesFrom(input, _repeated_input_codec);
break;
}
case 98: {
output_.AddEntriesFrom(input, _repeated_output_codec);
break;
}
case 106: {
valueInfo_.AddEntriesFrom(input, _repeated_valueInfo_codec);
break;
}
case 114: {
quantizationAnnotation_.AddEntriesFrom(input, _repeated_quantizationAnnotation_codec);
break;
}
case 122: {
sparseInitializer_.AddEntriesFrom(input, _repeated_sparseInitializer_codec);
break;
}
}
}
}
}
/// <summary>
/// Tensors
///
/// A serialized tensor value.
/// </summary>
public sealed partial class TensorProto : pb::IMessage<TensorProto> {
private static readonly pb::MessageParser<TensorProto> _parser = new pb::MessageParser<TensorProto>(() => new TensorProto());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<TensorProto> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Onnx.OnnxMlReflection.Descriptor.MessageTypes[8]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public TensorProto() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public TensorProto(TensorProto other) : this() {
dims_ = other.dims_.Clone();
dataType_ = other.dataType_;
segment_ = other.segment_ != null ? other.segment_.Clone() : null;
floatData_ = other.floatData_.Clone();
int32Data_ = other.int32Data_.Clone();
stringData_ = other.stringData_.Clone();
int64Data_ = other.int64Data_.Clone();
name_ = other.name_;
docString_ = other.docString_;
rawData_ = other.rawData_;
externalData_ = other.externalData_.Clone();
dataLocation_ = other.dataLocation_;
doubleData_ = other.doubleData_.Clone();
uint64Data_ = other.uint64Data_.Clone();
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public TensorProto Clone() {
return new TensorProto(this);
}
/// <summary>Field number for the "dims" field.</summary>
public const int DimsFieldNumber = 1;
private static readonly pb::FieldCodec<long> _repeated_dims_codec
= pb::FieldCodec.ForInt64(10);
private readonly pbc::RepeatedField<long> dims_ = new pbc::RepeatedField<long>();
/// <summary>
/// The shape of the tensor.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<long> Dims {
get { return dims_; }
}
/// <summary>Field number for the "data_type" field.</summary>
public const int DataTypeFieldNumber = 2;
private int dataType_;
/// <summary>
/// The data type of the tensor.
/// This field MUST have a valid TensorProto.DataType value
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int DataType {
get { return dataType_; }
set {
dataType_ = value;
}
}
/// <summary>Field number for the "segment" field.</summary>
public const int SegmentFieldNumber = 3;
private global::Onnx.TensorProto.Types.Segment segment_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Onnx.TensorProto.Types.Segment Segment {
get { return segment_; }
set {
segment_ = value;
}
}
/// <summary>Field number for the "float_data" field.</summary>
public const int FloatDataFieldNumber = 4;
private static readonly pb::FieldCodec<float> _repeated_floatData_codec
= pb::FieldCodec.ForFloat(34);
private readonly pbc::RepeatedField<float> floatData_ = new pbc::RepeatedField<float>();
/// <summary>
/// For float and complex64 values
/// Complex64 tensors are encoded as a single array of floats,
/// with the real components appearing in odd numbered positions,
/// and the corresponding imaginary component appearing in the
/// subsequent even numbered position. (e.g., [1.0 + 2.0i, 3.0 + 4.0i]
/// is encoded as [1.0, 2.0 ,3.0 ,4.0]
/// When this field is present, the data_type field MUST be FLOAT or COMPLEX64.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<float> FloatData {
get { return floatData_; }
}
/// <summary>Field number for the "int32_data" field.</summary>
public const int Int32DataFieldNumber = 5;
private static readonly pb::FieldCodec<int> _repeated_int32Data_codec
= pb::FieldCodec.ForInt32(42);
private readonly pbc::RepeatedField<int> int32Data_ = new pbc::RepeatedField<int>();
/// <summary>
/// For int32, uint8, int8, uint16, int16, bool, and float16 values
/// float16 values must be bit-wise converted to an uint16_t prior
/// to writing to the buffer.
/// When this field is present, the data_type field MUST be
/// INT32, INT16, INT8, UINT16, UINT8, BOOL, or FLOAT16
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<int> Int32Data {
get { return int32Data_; }
}
/// <summary>Field number for the "string_data" field.</summary>
public const int StringDataFieldNumber = 6;
private static readonly pb::FieldCodec<pb::ByteString> _repeated_stringData_codec
= pb::FieldCodec.ForBytes(50);
private readonly pbc::RepeatedField<pb::ByteString> stringData_ = new pbc::RepeatedField<pb::ByteString>();
/// <summary>
/// For strings.
/// Each element of string_data is a UTF-8 encoded Unicode
/// string. No trailing null, no leading BOM. The protobuf "string"
/// scalar type is not used to match ML community conventions.
/// When this field is present, the data_type field MUST be STRING
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<pb::ByteString> StringData {
get { return stringData_; }
}
/// <summary>Field number for the "int64_data" field.</summary>
public const int Int64DataFieldNumber = 7;
private static readonly pb::FieldCodec<long> _repeated_int64Data_codec
= pb::FieldCodec.ForInt64(58);
private readonly pbc::RepeatedField<long> int64Data_ = new pbc::RepeatedField<long>();
/// <summary>
/// For int64.
/// When this field is present, the data_type field MUST be INT64
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<long> Int64Data {
get { return int64Data_; }
}
/// <summary>Field number for the "name" field.</summary>
public const int NameFieldNumber = 8;
private string name_ = "";
/// <summary>
/// Optionally, a name for the tensor.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Name {
get { return name_; }
set {
name_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "doc_string" field.</summary>
public const int DocStringFieldNumber = 12;
private string docString_ = "";
/// <summary>
/// A human-readable documentation for this tensor. Markdown is allowed.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string DocString {
get { return docString_; }
set {
docString_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "raw_data" field.</summary>
public const int RawDataFieldNumber = 9;
private pb::ByteString rawData_ = pb::ByteString.Empty;
/// <summary>
/// Serializations can either use one of the fields above, or use this
/// raw bytes field. The only exception is the string case, where one is
/// required to store the content in the repeated bytes string_data field.
///
/// When this raw_data field is used to store tensor value, elements MUST
/// be stored in as fixed-width, little-endian order.
/// Floating-point data types MUST be stored in IEEE 754 format.
/// Complex64 elements must be written as two consecutive FLOAT values, real component first.
/// Complex128 elements must be written as two consecutive DOUBLE values, real component first.
/// Boolean type MUST be written one byte per tensor element (00000001 for true, 00000000 for false).
///
/// Note: the advantage of specific field rather than the raw_data field is
/// that in some cases (e.g. int data), protobuf does a better packing via
/// variable length storage, and may lead to smaller binary footprint.
/// When this field is present, the data_type field MUST NOT be STRING or UNDEFINED
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pb::ByteString RawData {
get { return rawData_; }
set {
rawData_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "external_data" field.</summary>
public const int ExternalDataFieldNumber = 13;
private static readonly pb::FieldCodec<global::Onnx.StringStringEntryProto> _repeated_externalData_codec
= pb::FieldCodec.ForMessage(106, global::Onnx.StringStringEntryProto.Parser);
private readonly pbc::RepeatedField<global::Onnx.StringStringEntryProto> externalData_ = new pbc::RepeatedField<global::Onnx.StringStringEntryProto>();
/// <summary>
/// Data can be stored inside the protobuf file using type-specific fields or raw_data.
/// Alternatively, raw bytes data can be stored in an external file, using the external_data field.
/// external_data stores key-value pairs describing data location. Recognized keys are:
/// - "location" (required) - POSIX filesystem path relative to the directory where the ONNX
/// protobuf model was stored
/// - "offset" (optional) - position of byte at which stored data begins. Integer stored as string.
/// Offset values SHOULD be multiples 4096 (page size) to enable mmap support.
/// - "length" (optional) - number of bytes containing data. Integer stored as string.
/// - "checksum" (optional) - SHA1 digest of file specified in under 'location' key.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Onnx.StringStringEntryProto> ExternalData {
get { return externalData_; }
}
/// <summary>Field number for the "data_location" field.</summary>
public const int DataLocationFieldNumber = 14;
private global::Onnx.TensorProto.Types.DataLocation dataLocation_ = global::Onnx.TensorProto.Types.DataLocation.Default;
/// <summary>
/// If value not set, data is stored in raw_data (if set) otherwise in type-specified field.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Onnx.TensorProto.Types.DataLocation DataLocation {
get { return dataLocation_; }
set {
dataLocation_ = value;
}
}
/// <summary>Field number for the "double_data" field.</summary>
public const int DoubleDataFieldNumber = 10;
private static readonly pb::FieldCodec<double> _repeated_doubleData_codec
= pb::FieldCodec.ForDouble(82);
private readonly pbc::RepeatedField<double> doubleData_ = new pbc::RepeatedField<double>();
/// <summary>
/// For double
/// Complex128 tensors are encoded as a single array of doubles,
/// with the real components appearing in odd numbered positions,
/// and the corresponding imaginary component appearing in the
/// subsequent even numbered position. (e.g., [1.0 + 2.0i, 3.0 + 4.0i]
/// is encoded as [1.0, 2.0 ,3.0 ,4.0]
/// When this field is present, the data_type field MUST be DOUBLE or COMPLEX128
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<double> DoubleData {
get { return doubleData_; }
}
/// <summary>Field number for the "uint64_data" field.</summary>
public const int Uint64DataFieldNumber = 11;
private static readonly pb::FieldCodec<ulong> _repeated_uint64Data_codec
= pb::FieldCodec.ForUInt64(90);
private readonly pbc::RepeatedField<ulong> uint64Data_ = new pbc::RepeatedField<ulong>();
/// <summary>
/// For uint64 and uint32 values
/// When this field is present, the data_type field MUST be
/// UINT32 or UINT64
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<ulong> Uint64Data {
get { return uint64Data_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as TensorProto);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(TensorProto other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if(!dims_.Equals(other.dims_)) return false;
if (DataType != other.DataType) return false;
if (!object.Equals(Segment, other.Segment)) return false;
if(!floatData_.Equals(other.floatData_)) return false;
if(!int32Data_.Equals(other.int32Data_)) return false;
if(!stringData_.Equals(other.stringData_)) return false;
if(!int64Data_.Equals(other.int64Data_)) return false;
if (Name != other.Name) return false;
if (DocString != other.DocString) return false;
if (RawData != other.RawData) return false;
if(!externalData_.Equals(other.externalData_)) return false;
if (DataLocation != other.DataLocation) return false;
if(!doubleData_.Equals(other.doubleData_)) return false;
if(!uint64Data_.Equals(other.uint64Data_)) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
hash ^= dims_.GetHashCode();
if (DataType != 0) hash ^= DataType.GetHashCode();
if (segment_ != null) hash ^= Segment.GetHashCode();
hash ^= floatData_.GetHashCode();
hash ^= int32Data_.GetHashCode();
hash ^= stringData_.GetHashCode();
hash ^= int64Data_.GetHashCode();
if (Name.Length != 0) hash ^= Name.GetHashCode();
if (DocString.Length != 0) hash ^= DocString.GetHashCode();
if (RawData.Length != 0) hash ^= RawData.GetHashCode();
hash ^= externalData_.GetHashCode();
if (DataLocation != global::Onnx.TensorProto.Types.DataLocation.Default) hash ^= DataLocation.GetHashCode();
hash ^= doubleData_.GetHashCode();
hash ^= uint64Data_.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
dims_.WriteTo(output, _repeated_dims_codec);
if (DataType != 0) {
output.WriteRawTag(16);
output.WriteInt32(DataType);
}
if (segment_ != null) {
output.WriteRawTag(26);
output.WriteMessage(Segment);
}
floatData_.WriteTo(output, _repeated_floatData_codec);
int32Data_.WriteTo(output, _repeated_int32Data_codec);
stringData_.WriteTo(output, _repeated_stringData_codec);
int64Data_.WriteTo(output, _repeated_int64Data_codec);
if (Name.Length != 0) {
output.WriteRawTag(66);
output.WriteString(Name);
}
if (RawData.Length != 0) {
output.WriteRawTag(74);
output.WriteBytes(RawData);
}
doubleData_.WriteTo(output, _repeated_doubleData_codec);
uint64Data_.WriteTo(output, _repeated_uint64Data_codec);
if (DocString.Length != 0) {
output.WriteRawTag(98);
output.WriteString(DocString);
}
externalData_.WriteTo(output, _repeated_externalData_codec);
if (DataLocation != global::Onnx.TensorProto.Types.DataLocation.Default) {
output.WriteRawTag(112);
output.WriteEnum((int) DataLocation);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
size += dims_.CalculateSize(_repeated_dims_codec);
if (DataType != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(DataType);
}
if (segment_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(Segment);
}
size += floatData_.CalculateSize(_repeated_floatData_codec);
size += int32Data_.CalculateSize(_repeated_int32Data_codec);
size += stringData_.CalculateSize(_repeated_stringData_codec);
size += int64Data_.CalculateSize(_repeated_int64Data_codec);
if (Name.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);
}
if (DocString.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(DocString);
}
if (RawData.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeBytesSize(RawData);
}
size += externalData_.CalculateSize(_repeated_externalData_codec);
if (DataLocation != global::Onnx.TensorProto.Types.DataLocation.Default) {
size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) DataLocation);
}
size += doubleData_.CalculateSize(_repeated_doubleData_codec);
size += uint64Data_.CalculateSize(_repeated_uint64Data_codec);
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(TensorProto other) {
if (other == null) {
return;
}
dims_.Add(other.dims_);
if (other.DataType != 0) {
DataType = other.DataType;
}
if (other.segment_ != null) {
if (segment_ == null) {
Segment = new global::Onnx.TensorProto.Types.Segment();
}
Segment.MergeFrom(other.Segment);
}
floatData_.Add(other.floatData_);
int32Data_.Add(other.int32Data_);
stringData_.Add(other.stringData_);
int64Data_.Add(other.int64Data_);
if (other.Name.Length != 0) {
Name = other.Name;
}
if (other.DocString.Length != 0) {
DocString = other.DocString;
}
if (other.RawData.Length != 0) {
RawData = other.RawData;
}
externalData_.Add(other.externalData_);
if (other.DataLocation != global::Onnx.TensorProto.Types.DataLocation.Default) {
DataLocation = other.DataLocation;
}
doubleData_.Add(other.doubleData_);
uint64Data_.Add(other.uint64Data_);
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10:
case 8: {
dims_.AddEntriesFrom(input, _repeated_dims_codec);
break;
}
case 16: {
DataType = input.ReadInt32();
break;
}
case 26: {
if (segment_ == null) {
Segment = new global::Onnx.TensorProto.Types.Segment();
}
input.ReadMessage(Segment);
break;
}
case 34:
case 37: {
floatData_.AddEntriesFrom(input, _repeated_floatData_codec);
break;
}
case 42:
case 40: {
int32Data_.AddEntriesFrom(input, _repeated_int32Data_codec);
break;
}
case 50: {
stringData_.AddEntriesFrom(input, _repeated_stringData_codec);
break;
}
case 58:
case 56: {
int64Data_.AddEntriesFrom(input, _repeated_int64Data_codec);
break;
}
case 66: {
Name = input.ReadString();
break;
}
case 74: {
RawData = input.ReadBytes();
break;
}
case 82:
case 81: {
doubleData_.AddEntriesFrom(input, _repeated_doubleData_codec);
break;
}
case 90:
case 88: {
uint64Data_.AddEntriesFrom(input, _repeated_uint64Data_codec);
break;
}
case 98: {
DocString = input.ReadString();
break;
}
case 106: {
externalData_.AddEntriesFrom(input, _repeated_externalData_codec);
break;
}
case 112: {
DataLocation = (global::Onnx.TensorProto.Types.DataLocation) input.ReadEnum();
break;
}
}
}
}
#region Nested types
/// <summary>Container for nested types declared in the TensorProto message type.</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static partial class Types {
public enum DataType {
[pbr::OriginalName("UNDEFINED")] Undefined = 0,
/// <summary>
/// Basic types.
/// </summary>
[pbr::OriginalName("FLOAT")] Float = 1,
/// <summary>
/// uint8_t
/// </summary>
[pbr::OriginalName("UINT8")] Uint8 = 2,
/// <summary>
/// int8_t
/// </summary>
[pbr::OriginalName("INT8")] Int8 = 3,
/// <summary>
/// uint16_t
/// </summary>
[pbr::OriginalName("UINT16")] Uint16 = 4,
/// <summary>
/// int16_t
/// </summary>
[pbr::OriginalName("INT16")] Int16 = 5,
/// <summary>
/// int32_t
/// </summary>
[pbr::OriginalName("INT32")] Int32 = 6,
/// <summary>
/// int64_t
/// </summary>
[pbr::OriginalName("INT64")] Int64 = 7,
/// <summary>
/// string
/// </summary>
[pbr::OriginalName("STRING")] String = 8,
/// <summary>
/// bool
/// </summary>
[pbr::OriginalName("BOOL")] Bool = 9,
/// <summary>
/// IEEE754 half-precision floating-point format (16 bits wide).
/// This format has 1 sign bit, 5 exponent bits, and 10 mantissa bits.
/// </summary>
[pbr::OriginalName("FLOAT16")] Float16 = 10,
[pbr::OriginalName("DOUBLE")] Double = 11,
[pbr::OriginalName("UINT32")] Uint32 = 12,
[pbr::OriginalName("UINT64")] Uint64 = 13,
/// <summary>
/// complex with float32 real and imaginary components
/// </summary>
[pbr::OriginalName("COMPLEX64")] Complex64 = 14,
/// <summary>
/// complex with float64 real and imaginary components
/// </summary>
[pbr::OriginalName("COMPLEX128")] Complex128 = 15,
/// <summary>
/// Non-IEEE floating-point format based on IEEE754 single-precision
/// floating-point number truncated to 16 bits.
/// This format has 1 sign bit, 8 exponent bits, and 7 mantissa bits.
/// </summary>
[pbr::OriginalName("BFLOAT16")] Bfloat16 = 16,
}
/// <summary>
/// Location of the data for this tensor. MUST be one of:
/// - DEFAULT - data stored inside the protobuf message. Data is stored in raw_data (if set) otherwise in type-specified field.
/// - EXTERNAL - data stored in an external location as described by external_data field.
/// </summary>
public enum DataLocation {
[pbr::OriginalName("DEFAULT")] Default = 0,
[pbr::OriginalName("EXTERNAL")] External = 1,
}
/// <summary>
/// For very large tensors, we may want to store them in chunks, in which
/// case the following fields will specify the segment that is stored in
/// the current TensorProto.
/// </summary>
public sealed partial class Segment : pb::IMessage<Segment> {
private static readonly pb::MessageParser<Segment> _parser = new pb::MessageParser<Segment>(() => new Segment());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<Segment> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Onnx.TensorProto.Descriptor.NestedTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Segment() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Segment(Segment other) : this() {
begin_ = other.begin_;
end_ = other.end_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Segment Clone() {
return new Segment(this);
}
/// <summary>Field number for the "begin" field.</summary>
public const int BeginFieldNumber = 1;
private long begin_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long Begin {
get { return begin_; }
set {
begin_ = value;
}
}
/// <summary>Field number for the "end" field.</summary>
public const int EndFieldNumber = 2;
private long end_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long End {
get { return end_; }
set {
end_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as Segment);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(Segment other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (Begin != other.Begin) return false;
if (End != other.End) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Begin != 0L) hash ^= Begin.GetHashCode();
if (End != 0L) hash ^= End.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Begin != 0L) {
output.WriteRawTag(8);
output.WriteInt64(Begin);
}
if (End != 0L) {
output.WriteRawTag(16);
output.WriteInt64(End);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Begin != 0L) {
size += 1 + pb::CodedOutputStream.ComputeInt64Size(Begin);
}
if (End != 0L) {
size += 1 + pb::CodedOutputStream.ComputeInt64Size(End);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(Segment other) {
if (other == null) {
return;
}
if (other.Begin != 0L) {
Begin = other.Begin;
}
if (other.End != 0L) {
End = other.End;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
Begin = input.ReadInt64();
break;
}
case 16: {
End = input.ReadInt64();
break;
}
}
}
}
}
}
#endregion
}
/// <summary>
/// A serialized sparse-tensor value
/// </summary>
public sealed partial class SparseTensorProto : pb::IMessage<SparseTensorProto> {
private static readonly pb::MessageParser<SparseTensorProto> _parser = new pb::MessageParser<SparseTensorProto>(() => new SparseTensorProto());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<SparseTensorProto> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Onnx.OnnxMlReflection.Descriptor.MessageTypes[9]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public SparseTensorProto() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public SparseTensorProto(SparseTensorProto other) : this() {
values_ = other.values_ != null ? other.values_.Clone() : null;
indices_ = other.indices_ != null ? other.indices_.Clone() : null;
dims_ = other.dims_.Clone();
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public SparseTensorProto Clone() {
return new SparseTensorProto(this);
}
/// <summary>Field number for the "values" field.</summary>
public const int ValuesFieldNumber = 1;
private global::Onnx.TensorProto values_;
/// <summary>
/// The sequence of non-default values are encoded as a tensor of shape [NNZ].
/// The default-value is zero for numeric tensors, and empty-string for string tensors.
/// values must have a non-empty name present which serves as a name for SparseTensorProto
/// when used in sparse_initializer list.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Onnx.TensorProto Values {
get { return values_; }
set {
values_ = value;
}
}
/// <summary>Field number for the "indices" field.</summary>
public const int IndicesFieldNumber = 2;
private global::Onnx.TensorProto indices_;
/// <summary>
/// The indices of the non-default values, which may be stored in one of two formats.
/// (a) Indices can be a tensor of shape [NNZ, rank] with the [i,j]-th value
/// corresponding to the j-th index of the i-th value (in the values tensor).
/// (b) Indices can be a tensor of shape [NNZ], in which case the i-th value
/// must be the linearized-index of the i-th value (in the values tensor).
/// The linearized-index can be converted into an index tuple (k_1,...,k_rank)
/// using the shape provided below.
/// The indices must appear in ascending order without duplication.
/// In the first format, the ordering is lexicographic-ordering:
/// e.g., index-value [1,4] must appear before [2,1]
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Onnx.TensorProto Indices {
get { return indices_; }
set {
indices_ = value;
}
}
/// <summary>Field number for the "dims" field.</summary>
public const int DimsFieldNumber = 3;
private static readonly pb::FieldCodec<long> _repeated_dims_codec
= pb::FieldCodec.ForInt64(26);
private readonly pbc::RepeatedField<long> dims_ = new pbc::RepeatedField<long>();
/// <summary>
/// The shape of the underlying dense-tensor: [dim_1, dim_2, ... dim_rank]
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<long> Dims {
get { return dims_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as SparseTensorProto);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(SparseTensorProto other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (!object.Equals(Values, other.Values)) return false;
if (!object.Equals(Indices, other.Indices)) return false;
if(!dims_.Equals(other.dims_)) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (values_ != null) hash ^= Values.GetHashCode();
if (indices_ != null) hash ^= Indices.GetHashCode();
hash ^= dims_.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (values_ != null) {
output.WriteRawTag(10);
output.WriteMessage(Values);
}
if (indices_ != null) {
output.WriteRawTag(18);
output.WriteMessage(Indices);
}
dims_.WriteTo(output, _repeated_dims_codec);
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (values_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(Values);
}
if (indices_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(Indices);
}
size += dims_.CalculateSize(_repeated_dims_codec);
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(SparseTensorProto other) {
if (other == null) {
return;
}
if (other.values_ != null) {
if (values_ == null) {
Values = new global::Onnx.TensorProto();
}
Values.MergeFrom(other.Values);
}
if (other.indices_ != null) {
if (indices_ == null) {
Indices = new global::Onnx.TensorProto();
}
Indices.MergeFrom(other.Indices);
}
dims_.Add(other.dims_);
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
if (values_ == null) {
Values = new global::Onnx.TensorProto();
}
input.ReadMessage(Values);
break;
}
case 18: {
if (indices_ == null) {
Indices = new global::Onnx.TensorProto();
}
input.ReadMessage(Indices);
break;
}
case 26:
case 24: {
dims_.AddEntriesFrom(input, _repeated_dims_codec);
break;
}
}
}
}
}
/// <summary>
/// Defines a tensor shape. A dimension can be either an integer value
/// or a symbolic variable. A symbolic variable represents an unknown
/// dimension.
/// </summary>
public sealed partial class TensorShapeProto : pb::IMessage<TensorShapeProto> {
private static readonly pb::MessageParser<TensorShapeProto> _parser = new pb::MessageParser<TensorShapeProto>(() => new TensorShapeProto());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<TensorShapeProto> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Onnx.OnnxMlReflection.Descriptor.MessageTypes[10]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public TensorShapeProto() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public TensorShapeProto(TensorShapeProto other) : this() {
dim_ = other.dim_.Clone();
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public TensorShapeProto Clone() {
return new TensorShapeProto(this);
}
/// <summary>Field number for the "dim" field.</summary>
public const int DimFieldNumber = 1;
private static readonly pb::FieldCodec<global::Onnx.TensorShapeProto.Types.Dimension> _repeated_dim_codec
= pb::FieldCodec.ForMessage(10, global::Onnx.TensorShapeProto.Types.Dimension.Parser);
private readonly pbc::RepeatedField<global::Onnx.TensorShapeProto.Types.Dimension> dim_ = new pbc::RepeatedField<global::Onnx.TensorShapeProto.Types.Dimension>();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Onnx.TensorShapeProto.Types.Dimension> Dim {
get { return dim_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as TensorShapeProto);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(TensorShapeProto other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if(!dim_.Equals(other.dim_)) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
hash ^= dim_.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
dim_.WriteTo(output, _repeated_dim_codec);
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
size += dim_.CalculateSize(_repeated_dim_codec);
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(TensorShapeProto other) {
if (other == null) {
return;
}
dim_.Add(other.dim_);
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
dim_.AddEntriesFrom(input, _repeated_dim_codec);
break;
}
}
}
}
#region Nested types
/// <summary>Container for nested types declared in the TensorShapeProto message type.</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static partial class Types {
public sealed partial class Dimension : pb::IMessage<Dimension> {
private static readonly pb::MessageParser<Dimension> _parser = new pb::MessageParser<Dimension>(() => new Dimension());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<Dimension> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Onnx.TensorShapeProto.Descriptor.NestedTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Dimension() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Dimension(Dimension other) : this() {
denotation_ = other.denotation_;
switch (other.ValueCase) {
case ValueOneofCase.DimValue:
DimValue = other.DimValue;
break;
case ValueOneofCase.DimParam:
DimParam = other.DimParam;
break;
}
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Dimension Clone() {
return new Dimension(this);
}
/// <summary>Field number for the "dim_value" field.</summary>
public const int DimValueFieldNumber = 1;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long DimValue {
get { return valueCase_ == ValueOneofCase.DimValue ? (long) value_ : 0L; }
set {
value_ = value;
valueCase_ = ValueOneofCase.DimValue;
}
}
/// <summary>Field number for the "dim_param" field.</summary>
public const int DimParamFieldNumber = 2;
/// <summary>
/// namespace Shape
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string DimParam {
get { return valueCase_ == ValueOneofCase.DimParam ? (string) value_ : ""; }
set {
value_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
valueCase_ = ValueOneofCase.DimParam;
}
}
/// <summary>Field number for the "denotation" field.</summary>
public const int DenotationFieldNumber = 3;
private string denotation_ = "";
/// <summary>
/// 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
/// for pre-defined dimension denotations.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Denotation {
get { return denotation_; }
set {
denotation_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
private object value_;
/// <summary>Enum of possible cases for the "value" oneof.</summary>
public enum ValueOneofCase {
None = 0,
DimValue = 1,
DimParam = 2,
}
private ValueOneofCase valueCase_ = ValueOneofCase.None;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ValueOneofCase ValueCase {
get { return valueCase_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void ClearValue() {
valueCase_ = ValueOneofCase.None;
value_ = null;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as Dimension);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(Dimension other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (DimValue != other.DimValue) return false;
if (DimParam != other.DimParam) return false;
if (Denotation != other.Denotation) return false;
if (ValueCase != other.ValueCase) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (valueCase_ == ValueOneofCase.DimValue) hash ^= DimValue.GetHashCode();
if (valueCase_ == ValueOneofCase.DimParam) hash ^= DimParam.GetHashCode();
if (Denotation.Length != 0) hash ^= Denotation.GetHashCode();
hash ^= (int) valueCase_;
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (valueCase_ == ValueOneofCase.DimValue) {
output.WriteRawTag(8);
output.WriteInt64(DimValue);
}
if (valueCase_ == ValueOneofCase.DimParam) {
output.WriteRawTag(18);
output.WriteString(DimParam);
}
if (Denotation.Length != 0) {
output.WriteRawTag(26);
output.WriteString(Denotation);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (valueCase_ == ValueOneofCase.DimValue) {
size += 1 + pb::CodedOutputStream.ComputeInt64Size(DimValue);
}
if (valueCase_ == ValueOneofCase.DimParam) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(DimParam);
}
if (Denotation.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Denotation);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(Dimension other) {
if (other == null) {
return;
}
if (other.Denotation.Length != 0) {
Denotation = other.Denotation;
}
switch (other.ValueCase) {
case ValueOneofCase.DimValue:
DimValue = other.DimValue;
break;
case ValueOneofCase.DimParam:
DimParam = other.DimParam;
break;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
DimValue = input.ReadInt64();
break;
}
case 18: {
DimParam = input.ReadString();
break;
}
case 26: {
Denotation = input.ReadString();
break;
}
}
}
}
}
}
#endregion
}
/// <summary>
/// Types
///
/// The standard ONNX data types.
/// </summary>
public sealed partial class TypeProto : pb::IMessage<TypeProto> {
private static readonly pb::MessageParser<TypeProto> _parser = new pb::MessageParser<TypeProto>(() => new TypeProto());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<TypeProto> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Onnx.OnnxMlReflection.Descriptor.MessageTypes[11]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public TypeProto() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public TypeProto(TypeProto other) : this() {
denotation_ = other.denotation_;
switch (other.ValueCase) {
case ValueOneofCase.TensorType:
TensorType = other.TensorType.Clone();
break;
case ValueOneofCase.SequenceType:
SequenceType = other.SequenceType.Clone();
break;
case ValueOneofCase.MapType:
MapType = other.MapType.Clone();
break;
case ValueOneofCase.SparseTensorType:
SparseTensorType = other.SparseTensorType.Clone();
break;
case ValueOneofCase.OpaqueType:
OpaqueType = other.OpaqueType.Clone();
break;
}
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public TypeProto Clone() {
return new TypeProto(this);
}
/// <summary>Field number for the "tensor_type" field.</summary>
public const int TensorTypeFieldNumber = 1;
/// <summary>
/// The type of a tensor.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Onnx.TypeProto.Types.Tensor TensorType {
get { return valueCase_ == ValueOneofCase.TensorType ? (global::Onnx.TypeProto.Types.Tensor) value_ : null; }
set {
value_ = value;
valueCase_ = value == null ? ValueOneofCase.None : ValueOneofCase.TensorType;
}
}
/// <summary>Field number for the "sequence_type" field.</summary>
public const int SequenceTypeFieldNumber = 4;
/// <summary>
/// The type of a sequence.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Onnx.TypeProto.Types.Sequence SequenceType {
get { return valueCase_ == ValueOneofCase.SequenceType ? (global::Onnx.TypeProto.Types.Sequence) value_ : null; }
set {
value_ = value;
valueCase_ = value == null ? ValueOneofCase.None : ValueOneofCase.SequenceType;
}
}
/// <summary>Field number for the "map_type" field.</summary>
public const int MapTypeFieldNumber = 5;
/// <summary>
/// The type of a map.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Onnx.TypeProto.Types.Map MapType {
get { return valueCase_ == ValueOneofCase.MapType ? (global::Onnx.TypeProto.Types.Map) value_ : null; }
set {
value_ = value;
valueCase_ = value == null ? ValueOneofCase.None : ValueOneofCase.MapType;
}
}
/// <summary>Field number for the "sparse_tensor_type" field.</summary>
public const int SparseTensorTypeFieldNumber = 8;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Onnx.TypeProto.Types.SparseTensor SparseTensorType {
get { return valueCase_ == ValueOneofCase.SparseTensorType ? (global::Onnx.TypeProto.Types.SparseTensor) value_ : null; }
set {
value_ = value;
valueCase_ = value == null ? ValueOneofCase.None : ValueOneofCase.SparseTensorType;
}
}
/// <summary>Field number for the "opaque_type" field.</summary>
public const int OpaqueTypeFieldNumber = 7;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Onnx.TypeProto.Types.Opaque OpaqueType {
get { return valueCase_ == ValueOneofCase.OpaqueType ? (global::Onnx.TypeProto.Types.Opaque) value_ : null; }
set {
value_ = value;
valueCase_ = value == null ? ValueOneofCase.None : ValueOneofCase.OpaqueType;
}
}
/// <summary>Field number for the "denotation" field.</summary>
public const int DenotationFieldNumber = 6;
private string denotation_ = "";
/// <summary>
/// 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
/// for pre-defined type denotations.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Denotation {
get { return denotation_; }
set {
denotation_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
private object value_;
/// <summary>Enum of possible cases for the "value" oneof.</summary>
public enum ValueOneofCase {
None = 0,
TensorType = 1,
SequenceType = 4,
MapType = 5,
SparseTensorType = 8,
OpaqueType = 7,
}
private ValueOneofCase valueCase_ = ValueOneofCase.None;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ValueOneofCase ValueCase {
get { return valueCase_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void ClearValue() {
valueCase_ = ValueOneofCase.None;
value_ = null;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as TypeProto);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(TypeProto other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (!object.Equals(TensorType, other.TensorType)) return false;
if (!object.Equals(SequenceType, other.SequenceType)) return false;
if (!object.Equals(MapType, other.MapType)) return false;
if (!object.Equals(SparseTensorType, other.SparseTensorType)) return false;
if (!object.Equals(OpaqueType, other.OpaqueType)) return false;
if (Denotation != other.Denotation) return false;
if (ValueCase != other.ValueCase) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (valueCase_ == ValueOneofCase.TensorType) hash ^= TensorType.GetHashCode();
if (valueCase_ == ValueOneofCase.SequenceType) hash ^= SequenceType.GetHashCode();
if (valueCase_ == ValueOneofCase.MapType) hash ^= MapType.GetHashCode();
if (valueCase_ == ValueOneofCase.SparseTensorType) hash ^= SparseTensorType.GetHashCode();
if (valueCase_ == ValueOneofCase.OpaqueType) hash ^= OpaqueType.GetHashCode();
if (Denotation.Length != 0) hash ^= Denotation.GetHashCode();
hash ^= (int) valueCase_;
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (valueCase_ == ValueOneofCase.TensorType) {
output.WriteRawTag(10);
output.WriteMessage(TensorType);
}
if (valueCase_ == ValueOneofCase.SequenceType) {
output.WriteRawTag(34);
output.WriteMessage(SequenceType);
}
if (valueCase_ == ValueOneofCase.MapType) {
output.WriteRawTag(42);
output.WriteMessage(MapType);
}
if (Denotation.Length != 0) {
output.WriteRawTag(50);
output.WriteString(Denotation);
}
if (valueCase_ == ValueOneofCase.OpaqueType) {
output.WriteRawTag(58);
output.WriteMessage(OpaqueType);
}
if (valueCase_ == ValueOneofCase.SparseTensorType) {
output.WriteRawTag(66);
output.WriteMessage(SparseTensorType);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (valueCase_ == ValueOneofCase.TensorType) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(TensorType);
}
if (valueCase_ == ValueOneofCase.SequenceType) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(SequenceType);
}
if (valueCase_ == ValueOneofCase.MapType) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(MapType);
}
if (valueCase_ == ValueOneofCase.SparseTensorType) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(SparseTensorType);
}
if (valueCase_ == ValueOneofCase.OpaqueType) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(OpaqueType);
}
if (Denotation.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Denotation);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(TypeProto other) {
if (other == null) {
return;
}
if (other.Denotation.Length != 0) {
Denotation = other.Denotation;
}
switch (other.ValueCase) {
case ValueOneofCase.TensorType:
if (TensorType == null) {
TensorType = new global::Onnx.TypeProto.Types.Tensor();
}
TensorType.MergeFrom(other.TensorType);
break;
case ValueOneofCase.SequenceType:
if (SequenceType == null) {
SequenceType = new global::Onnx.TypeProto.Types.Sequence();
}
SequenceType.MergeFrom(other.SequenceType);
break;
case ValueOneofCase.MapType:
if (MapType == null) {
MapType = new global::Onnx.TypeProto.Types.Map();
}
MapType.MergeFrom(other.MapType);
break;
case ValueOneofCase.SparseTensorType:
if (SparseTensorType == null) {
SparseTensorType = new global::Onnx.TypeProto.Types.SparseTensor();
}
SparseTensorType.MergeFrom(other.SparseTensorType);
break;
case ValueOneofCase.OpaqueType:
if (OpaqueType == null) {
OpaqueType = new global::Onnx.TypeProto.Types.Opaque();
}
OpaqueType.MergeFrom(other.OpaqueType);
break;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
global::Onnx.TypeProto.Types.Tensor subBuilder = new global::Onnx.TypeProto.Types.Tensor();
if (valueCase_ == ValueOneofCase.TensorType) {
subBuilder.MergeFrom(TensorType);
}
input.ReadMessage(subBuilder);
TensorType = subBuilder;
break;
}
case 34: {
global::Onnx.TypeProto.Types.Sequence subBuilder = new global::Onnx.TypeProto.Types.Sequence();
if (valueCase_ == ValueOneofCase.SequenceType) {
subBuilder.MergeFrom(SequenceType);
}
input.ReadMessage(subBuilder);
SequenceType = subBuilder;
break;
}
case 42: {
global::Onnx.TypeProto.Types.Map subBuilder = new global::Onnx.TypeProto.Types.Map();
if (valueCase_ == ValueOneofCase.MapType) {
subBuilder.MergeFrom(MapType);
}
input.ReadMessage(subBuilder);
MapType = subBuilder;
break;
}
case 50: {
Denotation = input.ReadString();
break;
}
case 58: {
global::Onnx.TypeProto.Types.Opaque subBuilder = new global::Onnx.TypeProto.Types.Opaque();
if (valueCase_ == ValueOneofCase.OpaqueType) {
subBuilder.MergeFrom(OpaqueType);
}
input.ReadMessage(subBuilder);
OpaqueType = subBuilder;
break;
}
case 66: {
global::Onnx.TypeProto.Types.SparseTensor subBuilder = new global::Onnx.TypeProto.Types.SparseTensor();
if (valueCase_ == ValueOneofCase.SparseTensorType) {
subBuilder.MergeFrom(SparseTensorType);
}
input.ReadMessage(subBuilder);
SparseTensorType = subBuilder;
break;
}
}
}
}
#region Nested types
/// <summary>Container for nested types declared in the TypeProto message type.</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static partial class Types {
public sealed partial class Tensor : pb::IMessage<Tensor> {
private static readonly pb::MessageParser<Tensor> _parser = new pb::MessageParser<Tensor>(() => new Tensor());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<Tensor> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Onnx.TypeProto.Descriptor.NestedTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Tensor() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Tensor(Tensor other) : this() {
elemType_ = other.elemType_;
shape_ = other.shape_ != null ? other.shape_.Clone() : null;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Tensor Clone() {
return new Tensor(this);
}
/// <summary>Field number for the "elem_type" field.</summary>
public const int ElemTypeFieldNumber = 1;
private int elemType_;
/// <summary>
/// This field MUST NOT have the value of UNDEFINED
/// This field MUST have a valid TensorProto.DataType value
/// This field MUST be present for this version of the IR.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int ElemType {
get { return elemType_; }
set {
elemType_ = value;
}
}
/// <summary>Field number for the "shape" field.</summary>
public const int ShapeFieldNumber = 2;
private global::Onnx.TensorShapeProto shape_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Onnx.TensorShapeProto Shape {
get { return shape_; }
set {
shape_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as Tensor);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(Tensor other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (ElemType != other.ElemType) return false;
if (!object.Equals(Shape, other.Shape)) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (ElemType != 0) hash ^= ElemType.GetHashCode();
if (shape_ != null) hash ^= Shape.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (ElemType != 0) {
output.WriteRawTag(8);
output.WriteInt32(ElemType);
}
if (shape_ != null) {
output.WriteRawTag(18);
output.WriteMessage(Shape);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (ElemType != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(ElemType);
}
if (shape_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(Shape);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(Tensor other) {
if (other == null) {
return;
}
if (other.ElemType != 0) {
ElemType = other.ElemType;
}
if (other.shape_ != null) {
if (shape_ == null) {
Shape = new global::Onnx.TensorShapeProto();
}
Shape.MergeFrom(other.Shape);
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
ElemType = input.ReadInt32();
break;
}
case 18: {
if (shape_ == null) {
Shape = new global::Onnx.TensorShapeProto();
}
input.ReadMessage(Shape);
break;
}
}
}
}
}
/// <summary>
/// repeated T
/// </summary>
public sealed partial class Sequence : pb::IMessage<Sequence> {
private static readonly pb::MessageParser<Sequence> _parser = new pb::MessageParser<Sequence>(() => new Sequence());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<Sequence> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Onnx.TypeProto.Descriptor.NestedTypes[1]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Sequence() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Sequence(Sequence other) : this() {
elemType_ = other.elemType_ != null ? other.elemType_.Clone() : null;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Sequence Clone() {
return new Sequence(this);
}
/// <summary>Field number for the "elem_type" field.</summary>
public const int ElemTypeFieldNumber = 1;
private global::Onnx.TypeProto elemType_;
/// <summary>
/// The type and optional shape of each element of the sequence.
/// This field MUST be present for this version of the IR.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Onnx.TypeProto ElemType {
get { return elemType_; }
set {
elemType_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as Sequence);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(Sequence other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (!object.Equals(ElemType, other.ElemType)) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (elemType_ != null) hash ^= ElemType.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (elemType_ != null) {
output.WriteRawTag(10);
output.WriteMessage(ElemType);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (elemType_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(ElemType);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(Sequence other) {
if (other == null) {
return;
}
if (other.elemType_ != null) {
if (elemType_ == null) {
ElemType = new global::Onnx.TypeProto();
}
ElemType.MergeFrom(other.ElemType);
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
if (elemType_ == null) {
ElemType = new global::Onnx.TypeProto();
}
input.ReadMessage(ElemType);
break;
}
}
}
}
}
/// <summary>
/// map&lt;K,V>
/// </summary>
public sealed partial class Map : pb::IMessage<Map> {
private static readonly pb::MessageParser<Map> _parser = new pb::MessageParser<Map>(() => new Map());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<Map> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Onnx.TypeProto.Descriptor.NestedTypes[2]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Map() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Map(Map other) : this() {
keyType_ = other.keyType_;
valueType_ = other.valueType_ != null ? other.valueType_.Clone() : null;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Map Clone() {
return new Map(this);
}
/// <summary>Field number for the "key_type" field.</summary>
public const int KeyTypeFieldNumber = 1;
private int keyType_;
/// <summary>
/// This field MUST have a valid TensorProto.DataType value
/// This field MUST be present for this version of the IR.
/// This field MUST refer to an integral type ([U]INT{8|16|32|64}) or STRING
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int KeyType {
get { return keyType_; }
set {
keyType_ = value;
}
}
/// <summary>Field number for the "value_type" field.</summary>
public const int ValueTypeFieldNumber = 2;
private global::Onnx.TypeProto valueType_;
/// <summary>
/// This field MUST be present for this version of the IR.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Onnx.TypeProto ValueType {
get { return valueType_; }
set {
valueType_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as Map);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(Map other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (KeyType != other.KeyType) return false;
if (!object.Equals(ValueType, other.ValueType)) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (KeyType != 0) hash ^= KeyType.GetHashCode();
if (valueType_ != null) hash ^= ValueType.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (KeyType != 0) {
output.WriteRawTag(8);
output.WriteInt32(KeyType);
}
if (valueType_ != null) {
output.WriteRawTag(18);
output.WriteMessage(ValueType);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (KeyType != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(KeyType);
}
if (valueType_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(ValueType);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(Map other) {
if (other == null) {
return;
}
if (other.KeyType != 0) {
KeyType = other.KeyType;
}
if (other.valueType_ != null) {
if (valueType_ == null) {
ValueType = new global::Onnx.TypeProto();
}
ValueType.MergeFrom(other.ValueType);
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
KeyType = input.ReadInt32();
break;
}
case 18: {
if (valueType_ == null) {
ValueType = new global::Onnx.TypeProto();
}
input.ReadMessage(ValueType);
break;
}
}
}
}
}
public sealed partial class SparseTensor : pb::IMessage<SparseTensor> {
private static readonly pb::MessageParser<SparseTensor> _parser = new pb::MessageParser<SparseTensor>(() => new SparseTensor());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<SparseTensor> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Onnx.TypeProto.Descriptor.NestedTypes[3]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public SparseTensor() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public SparseTensor(SparseTensor other) : this() {
elemType_ = other.elemType_;
shape_ = other.shape_ != null ? other.shape_.Clone() : null;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public SparseTensor Clone() {
return new SparseTensor(this);
}
/// <summary>Field number for the "elem_type" field.</summary>
public const int ElemTypeFieldNumber = 1;
private int elemType_;
/// <summary>
/// This field MUST NOT have the value of UNDEFINED
/// This field MUST have a valid TensorProto.DataType value
/// This field MUST be present for this version of the IR.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int ElemType {
get { return elemType_; }
set {
elemType_ = value;
}
}
/// <summary>Field number for the "shape" field.</summary>
public const int ShapeFieldNumber = 2;
private global::Onnx.TensorShapeProto shape_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Onnx.TensorShapeProto Shape {
get { return shape_; }
set {
shape_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as SparseTensor);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(SparseTensor other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (ElemType != other.ElemType) return false;
if (!object.Equals(Shape, other.Shape)) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (ElemType != 0) hash ^= ElemType.GetHashCode();
if (shape_ != null) hash ^= Shape.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (ElemType != 0) {
output.WriteRawTag(8);
output.WriteInt32(ElemType);
}
if (shape_ != null) {
output.WriteRawTag(18);
output.WriteMessage(Shape);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (ElemType != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(ElemType);
}
if (shape_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(Shape);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(SparseTensor other) {
if (other == null) {
return;
}
if (other.ElemType != 0) {
ElemType = other.ElemType;
}
if (other.shape_ != null) {
if (shape_ == null) {
Shape = new global::Onnx.TensorShapeProto();
}
Shape.MergeFrom(other.Shape);
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
ElemType = input.ReadInt32();
break;
}
case 18: {
if (shape_ == null) {
Shape = new global::Onnx.TensorShapeProto();
}
input.ReadMessage(Shape);
break;
}
}
}
}
}
public sealed partial class Opaque : pb::IMessage<Opaque> {
private static readonly pb::MessageParser<Opaque> _parser = new pb::MessageParser<Opaque>(() => new Opaque());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<Opaque> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Onnx.TypeProto.Descriptor.NestedTypes[4]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Opaque() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Opaque(Opaque other) : this() {
domain_ = other.domain_;
name_ = other.name_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Opaque Clone() {
return new Opaque(this);
}
/// <summary>Field number for the "domain" field.</summary>
public const int DomainFieldNumber = 1;
private string domain_ = "";
/// <summary>
/// When missing, the domain is the same as the model's.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Domain {
get { return domain_; }
set {
domain_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "name" field.</summary>
public const int NameFieldNumber = 2;
private string name_ = "";
/// <summary>
/// The name is optional but significant when provided.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Name {
get { return name_; }
set {
name_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as Opaque);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(Opaque other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (Domain != other.Domain) return false;
if (Name != other.Name) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Domain.Length != 0) hash ^= Domain.GetHashCode();
if (Name.Length != 0) hash ^= Name.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Domain.Length != 0) {
output.WriteRawTag(10);
output.WriteString(Domain);
}
if (Name.Length != 0) {
output.WriteRawTag(18);
output.WriteString(Name);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Domain.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Domain);
}
if (Name.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(Opaque other) {
if (other == null) {
return;
}
if (other.Domain.Length != 0) {
Domain = other.Domain;
}
if (other.Name.Length != 0) {
Name = other.Name;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
Domain = input.ReadString();
break;
}
case 18: {
Name = input.ReadString();
break;
}
}
}
}
}
}
#endregion
}
/// <summary>
/// Operator Sets
///
/// OperatorSets are uniquely identified by a (domain, opset_version) pair.
/// </summary>
public sealed partial class OperatorSetIdProto : pb::IMessage<OperatorSetIdProto> {
private static readonly pb::MessageParser<OperatorSetIdProto> _parser = new pb::MessageParser<OperatorSetIdProto>(() => new OperatorSetIdProto());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<OperatorSetIdProto> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Onnx.OnnxMlReflection.Descriptor.MessageTypes[12]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public OperatorSetIdProto() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public OperatorSetIdProto(OperatorSetIdProto other) : this() {
domain_ = other.domain_;
version_ = other.version_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public OperatorSetIdProto Clone() {
return new OperatorSetIdProto(this);
}
/// <summary>Field number for the "domain" field.</summary>
public const int DomainFieldNumber = 1;
private string domain_ = "";
/// <summary>
/// The domain of the operator set being identified.
/// The empty string ("") or absence of this field implies the operator
/// set that is defined as part of the ONNX specification.
/// This field MUST be present in this version of the IR when referring to any other operator set.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Domain {
get { return domain_; }
set {
domain_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "version" field.</summary>
public const int VersionFieldNumber = 2;
private long version_;
/// <summary>
/// The version of the operator set being identified.
/// This field MUST be present in this version of the IR.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public long Version {
get { return version_; }
set {
version_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as OperatorSetIdProto);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(OperatorSetIdProto other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (Domain != other.Domain) return false;
if (Version != other.Version) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Domain.Length != 0) hash ^= Domain.GetHashCode();
if (Version != 0L) hash ^= Version.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Domain.Length != 0) {
output.WriteRawTag(10);
output.WriteString(Domain);
}
if (Version != 0L) {
output.WriteRawTag(16);
output.WriteInt64(Version);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Domain.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Domain);
}
if (Version != 0L) {
size += 1 + pb::CodedOutputStream.ComputeInt64Size(Version);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(OperatorSetIdProto other) {
if (other == null) {
return;
}
if (other.Domain.Length != 0) {
Domain = other.Domain;
}
if (other.Version != 0L) {
Version = other.Version;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
Domain = input.ReadString();
break;
}
case 16: {
Version = input.ReadInt64();
break;
}
}
}
}
}
#endregion
}
#endregion Designer generated code