onnx 1.16.1__cp38-cp38-win32.whl → 1.17.0__cp38-cp38-win32.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of onnx might be problematic. Click here for more details.
- onnx/__init__.py +3 -1
- onnx/_custom_element_types.py +63 -0
- onnx/backend/base.py +17 -15
- onnx/backend/sample/ops/__init__.py +4 -4
- onnx/backend/sample/ops/abs.py +1 -0
- onnx/backend/test/__init__.py +1 -0
- onnx/backend/test/case/__init__.py +2 -2
- onnx/backend/test/case/base.py +6 -5
- onnx/backend/test/case/model/__init__.py +4 -3
- onnx/backend/test/case/model/expand.py +1 -0
- onnx/backend/test/case/model/gradient.py +1 -0
- onnx/backend/test/case/model/sequence.py +3 -1
- onnx/backend/test/case/model/shrink.py +1 -0
- onnx/backend/test/case/model/sign.py +1 -0
- onnx/backend/test/case/model/single-relu.py +1 -0
- onnx/backend/test/case/model/stringnormalizer.py +1 -1
- onnx/backend/test/case/node/__init__.py +31 -22
- onnx/backend/test/case/node/_image_decoder_data.py +1 -0
- onnx/backend/test/case/node/abs.py +1 -0
- onnx/backend/test/case/node/acos.py +1 -0
- onnx/backend/test/case/node/acosh.py +1 -0
- onnx/backend/test/case/node/adagrad.py +2 -1
- onnx/backend/test/case/node/adam.py +4 -1
- onnx/backend/test/case/node/add.py +1 -0
- onnx/backend/test/case/node/affinegrid.py +1 -0
- onnx/backend/test/case/node/ai_onnx_ml/array_feature_extractor.py +1 -0
- onnx/backend/test/case/node/ai_onnx_ml/binarizer.py +1 -0
- onnx/backend/test/case/node/ai_onnx_ml/label_encoder.py +1 -0
- onnx/backend/test/case/node/ai_onnx_ml/tree_ensemble.py +1 -0
- onnx/backend/test/case/node/and.py +1 -0
- onnx/backend/test/case/node/argmax.py +1 -0
- onnx/backend/test/case/node/argmin.py +1 -0
- onnx/backend/test/case/node/asin.py +1 -0
- onnx/backend/test/case/node/asinh.py +1 -0
- onnx/backend/test/case/node/atan.py +1 -0
- onnx/backend/test/case/node/atanh.py +1 -0
- onnx/backend/test/case/node/averagepool.py +1 -0
- onnx/backend/test/case/node/batchnorm.py +1 -0
- onnx/backend/test/case/node/bernoulli.py +1 -0
- onnx/backend/test/case/node/bitshift.py +1 -0
- onnx/backend/test/case/node/bitwiseand.py +1 -0
- onnx/backend/test/case/node/bitwisenot.py +1 -0
- onnx/backend/test/case/node/bitwiseor.py +1 -0
- onnx/backend/test/case/node/bitwisexor.py +1 -0
- onnx/backend/test/case/node/blackmanwindow.py +13 -3
- onnx/backend/test/case/node/cast.py +2 -1
- onnx/backend/test/case/node/castlike.py +1 -0
- onnx/backend/test/case/node/ceil.py +1 -0
- onnx/backend/test/case/node/celu.py +1 -0
- onnx/backend/test/case/node/center_crop_pad.py +1 -0
- onnx/backend/test/case/node/clip.py +1 -0
- onnx/backend/test/case/node/col2im.py +1 -1
- onnx/backend/test/case/node/compress.py +1 -0
- onnx/backend/test/case/node/concat.py +3 -2
- onnx/backend/test/case/node/constant.py +1 -0
- onnx/backend/test/case/node/constantofshape.py +1 -0
- onnx/backend/test/case/node/conv.py +1 -0
- onnx/backend/test/case/node/convinteger.py +1 -0
- onnx/backend/test/case/node/convtranspose.py +135 -0
- onnx/backend/test/case/node/cos.py +1 -0
- onnx/backend/test/case/node/cosh.py +1 -0
- onnx/backend/test/case/node/cumsum.py +1 -0
- onnx/backend/test/case/node/deformconv.py +17 -26
- onnx/backend/test/case/node/depthtospace.py +1 -0
- onnx/backend/test/case/node/dequantizelinear.py +1 -0
- onnx/backend/test/case/node/det.py +1 -0
- onnx/backend/test/case/node/dft.py +1 -0
- onnx/backend/test/case/node/div.py +1 -0
- onnx/backend/test/case/node/dropout.py +1 -0
- onnx/backend/test/case/node/dynamicquantizelinear.py +1 -0
- onnx/backend/test/case/node/einsum.py +2 -3
- onnx/backend/test/case/node/elu.py +1 -0
- onnx/backend/test/case/node/equal.py +1 -0
- onnx/backend/test/case/node/erf.py +1 -0
- onnx/backend/test/case/node/exp.py +1 -0
- onnx/backend/test/case/node/expand.py +1 -0
- onnx/backend/test/case/node/eyelike.py +1 -0
- onnx/backend/test/case/node/flatten.py +1 -0
- onnx/backend/test/case/node/floor.py +1 -0
- onnx/backend/test/case/node/gather.py +1 -0
- onnx/backend/test/case/node/gatherelements.py +1 -0
- onnx/backend/test/case/node/gathernd.py +1 -0
- onnx/backend/test/case/node/gelu.py +1 -0
- onnx/backend/test/case/node/gemm.py +3 -4
- onnx/backend/test/case/node/globalaveragepool.py +1 -0
- onnx/backend/test/case/node/globalmaxpool.py +1 -0
- onnx/backend/test/case/node/greater.py +1 -0
- onnx/backend/test/case/node/greater_equal.py +1 -0
- onnx/backend/test/case/node/gridsample.py +1 -0
- onnx/backend/test/case/node/groupnormalization.py +1 -0
- onnx/backend/test/case/node/gru.py +3 -2
- onnx/backend/test/case/node/hammingwindow.py +13 -2
- onnx/backend/test/case/node/hannwindow.py +10 -2
- onnx/backend/test/case/node/hardmax.py +1 -0
- onnx/backend/test/case/node/hardsigmoid.py +1 -0
- onnx/backend/test/case/node/hardswish.py +1 -0
- onnx/backend/test/case/node/identity.py +1 -0
- onnx/backend/test/case/node/if.py +1 -0
- onnx/backend/test/case/node/instancenorm.py +1 -0
- onnx/backend/test/case/node/isinf.py +1 -0
- onnx/backend/test/case/node/isnan.py +1 -0
- onnx/backend/test/case/node/layernormalization.py +1 -0
- onnx/backend/test/case/node/leakyrelu.py +1 -0
- onnx/backend/test/case/node/less.py +1 -0
- onnx/backend/test/case/node/less_equal.py +1 -0
- onnx/backend/test/case/node/log.py +1 -0
- onnx/backend/test/case/node/logsoftmax.py +1 -0
- onnx/backend/test/case/node/loop.py +4 -3
- onnx/backend/test/case/node/lppool.py +1 -0
- onnx/backend/test/case/node/lrn.py +1 -0
- onnx/backend/test/case/node/lstm.py +3 -2
- onnx/backend/test/case/node/matmul.py +1 -0
- onnx/backend/test/case/node/matmulinteger.py +1 -0
- onnx/backend/test/case/node/max.py +1 -0
- onnx/backend/test/case/node/maxpool.py +1 -0
- onnx/backend/test/case/node/maxunpool.py +1 -0
- onnx/backend/test/case/node/mean.py +1 -0
- onnx/backend/test/case/node/meanvariancenormalization.py +1 -0
- onnx/backend/test/case/node/melweightmatrix.py +1 -0
- onnx/backend/test/case/node/min.py +1 -0
- onnx/backend/test/case/node/mish.py +1 -0
- onnx/backend/test/case/node/mod.py +1 -0
- onnx/backend/test/case/node/momentum.py +1 -0
- onnx/backend/test/case/node/mul.py +1 -0
- onnx/backend/test/case/node/neg.py +1 -0
- onnx/backend/test/case/node/negativeloglikelihoodloss.py +4 -1
- onnx/backend/test/case/node/nonmaxsuppression.py +1 -0
- onnx/backend/test/case/node/nonzero.py +1 -0
- onnx/backend/test/case/node/not.py +1 -0
- onnx/backend/test/case/node/onehot.py +1 -0
- onnx/backend/test/case/node/optionalgetelement.py +3 -2
- onnx/backend/test/case/node/optionalhaselement.py +2 -3
- onnx/backend/test/case/node/or.py +1 -0
- onnx/backend/test/case/node/pad.py +2 -1
- onnx/backend/test/case/node/pow.py +1 -0
- onnx/backend/test/case/node/prelu.py +1 -0
- onnx/backend/test/case/node/qlinearconv.py +1 -0
- onnx/backend/test/case/node/qlinearmatmul.py +1 -0
- onnx/backend/test/case/node/quantizelinear.py +1 -0
- onnx/backend/test/case/node/rangeop.py +1 -0
- onnx/backend/test/case/node/reciprocal.py +1 -0
- onnx/backend/test/case/node/reduce_log_sum.py +1 -0
- onnx/backend/test/case/node/reduce_log_sum_exp.py +1 -0
- onnx/backend/test/case/node/reducel1.py +1 -0
- onnx/backend/test/case/node/reducel2.py +1 -0
- onnx/backend/test/case/node/reducemax.py +2 -1
- onnx/backend/test/case/node/reducemean.py +1 -0
- onnx/backend/test/case/node/reducemin.py +1 -0
- onnx/backend/test/case/node/reduceprod.py +1 -0
- onnx/backend/test/case/node/reducesum.py +2 -1
- onnx/backend/test/case/node/reducesumsquare.py +1 -0
- onnx/backend/test/case/node/regex_full_match.py +1 -0
- onnx/backend/test/case/node/relu.py +1 -0
- onnx/backend/test/case/node/reshape.py +1 -0
- onnx/backend/test/case/node/resize.py +3 -2
- onnx/backend/test/case/node/reversesequence.py +1 -0
- onnx/backend/test/case/node/rnn.py +3 -2
- onnx/backend/test/case/node/roialign.py +1 -0
- onnx/backend/test/case/node/round.py +4 -3
- onnx/backend/test/case/node/scan.py +1 -0
- onnx/backend/test/case/node/scatter.py +1 -0
- onnx/backend/test/case/node/scatterelements.py +7 -3
- onnx/backend/test/case/node/scatternd.py +1 -0
- onnx/backend/test/case/node/selu.py +1 -0
- onnx/backend/test/case/node/sequence_map.py +1 -0
- onnx/backend/test/case/node/sequenceinsert.py +4 -3
- onnx/backend/test/case/node/shape.py +1 -0
- onnx/backend/test/case/node/shrink.py +1 -0
- onnx/backend/test/case/node/sigmoid.py +1 -0
- onnx/backend/test/case/node/sign.py +1 -0
- onnx/backend/test/case/node/sin.py +1 -0
- onnx/backend/test/case/node/sinh.py +1 -0
- onnx/backend/test/case/node/size.py +1 -0
- onnx/backend/test/case/node/slice.py +1 -0
- onnx/backend/test/case/node/softmax.py +1 -0
- onnx/backend/test/case/node/softmaxcrossentropy.py +4 -1
- onnx/backend/test/case/node/softplus.py +1 -0
- onnx/backend/test/case/node/softsign.py +1 -0
- onnx/backend/test/case/node/spacetodepth.py +1 -0
- onnx/backend/test/case/node/split.py +1 -0
- onnx/backend/test/case/node/splittosequence.py +1 -0
- onnx/backend/test/case/node/sqrt.py +1 -0
- onnx/backend/test/case/node/squeeze.py +1 -0
- onnx/backend/test/case/node/stft.py +4 -1
- onnx/backend/test/case/node/string_concat.py +1 -0
- onnx/backend/test/case/node/string_split.py +1 -0
- onnx/backend/test/case/node/stringnormalizer.py +1 -0
- onnx/backend/test/case/node/sub.py +1 -0
- onnx/backend/test/case/node/sum.py +1 -0
- onnx/backend/test/case/node/tan.py +1 -0
- onnx/backend/test/case/node/tanh.py +1 -0
- onnx/backend/test/case/node/tfidfvectorizer.py +1 -0
- onnx/backend/test/case/node/thresholdedrelu.py +1 -0
- onnx/backend/test/case/node/tile.py +1 -0
- onnx/backend/test/case/node/topk.py +1 -0
- onnx/backend/test/case/node/transpose.py +1 -0
- onnx/backend/test/case/node/trilu.py +1 -0
- onnx/backend/test/case/node/unique.py +7 -0
- onnx/backend/test/case/node/unsqueeze.py +1 -0
- onnx/backend/test/case/node/upsample.py +1 -0
- onnx/backend/test/case/node/where.py +1 -0
- onnx/backend/test/case/node/xor.py +1 -0
- onnx/backend/test/case/test_case.py +6 -5
- onnx/backend/test/case/utils.py +2 -2
- onnx/backend/test/cmd_tools.py +1 -0
- onnx/backend/test/data/node/test_acos/model.onnx +0 -0
- onnx/backend/test/data/node/test_acos/test_data_set_0/output_0.pb +0 -0
- onnx/backend/test/data/node/test_acos_example/model.onnx +0 -0
- onnx/backend/test/data/node/test_acosh/model.onnx +0 -0
- onnx/backend/test/data/node/test_acosh/test_data_set_0/output_0.pb +1 -1
- onnx/backend/test/data/node/test_acosh_example/model.onnx +0 -0
- onnx/backend/test/data/node/test_asin/model.onnx +0 -0
- onnx/backend/test/data/node/test_asin/test_data_set_0/output_0.pb +1 -1
- onnx/backend/test/data/node/test_asin_example/model.onnx +0 -0
- onnx/backend/test/data/node/test_asinh/model.onnx +0 -0
- onnx/backend/test/data/node/test_asinh/test_data_set_0/output_0.pb +1 -1
- onnx/backend/test/data/node/test_asinh_example/model.onnx +0 -0
- onnx/backend/test/data/node/test_atan/model.onnx +0 -0
- onnx/backend/test/data/node/test_atan/test_data_set_0/output_0.pb +1 -1
- onnx/backend/test/data/node/test_atan_example/model.onnx +0 -0
- onnx/backend/test/data/node/test_atanh/model.onnx +0 -0
- onnx/backend/test/data/node/test_atanh/test_data_set_0/output_0.pb +2 -2
- onnx/backend/test/data/node/test_atanh_example/model.onnx +0 -0
- onnx/backend/test/data/node/test_averagepool_1d_default/model.onnx +0 -0
- onnx/backend/test/data/node/test_averagepool_2d_ceil/model.onnx +0 -0
- onnx/backend/test/data/node/test_averagepool_2d_default/model.onnx +0 -0
- onnx/backend/test/data/node/test_averagepool_2d_dilations/model.onnx +0 -0
- onnx/backend/test/data/node/test_averagepool_2d_pads/model.onnx +0 -0
- onnx/backend/test/data/node/test_averagepool_2d_pads_count_include_pad/model.onnx +0 -0
- onnx/backend/test/data/node/test_averagepool_2d_precomputed_pads/model.onnx +0 -0
- onnx/backend/test/data/node/test_averagepool_2d_precomputed_pads_count_include_pad/model.onnx +0 -0
- onnx/backend/test/data/node/test_averagepool_2d_precomputed_same_upper/model.onnx +0 -0
- onnx/backend/test/data/node/test_averagepool_2d_precomputed_strides/model.onnx +0 -0
- onnx/backend/test/data/node/test_averagepool_2d_same_lower/model.onnx +0 -0
- onnx/backend/test/data/node/test_averagepool_2d_same_upper/model.onnx +0 -0
- onnx/backend/test/data/node/test_averagepool_2d_strides/model.onnx +0 -0
- onnx/backend/test/data/node/test_averagepool_3d_default/model.onnx +0 -0
- onnx/backend/test/data/node/test_averagepool_3d_dilations_large_count_include_pad_is_0_ceil_mode_is_False/model.onnx +0 -0
- onnx/backend/test/data/node/test_averagepool_3d_dilations_large_count_include_pad_is_0_ceil_mode_is_True/model.onnx +0 -0
- onnx/backend/test/data/node/test_averagepool_3d_dilations_large_count_include_pad_is_1_ceil_mode_is_False/model.onnx +0 -0
- onnx/backend/test/data/node/test_averagepool_3d_dilations_large_count_include_pad_is_1_ceil_mode_is_True/model.onnx +0 -0
- onnx/backend/test/data/node/test_averagepool_3d_dilations_small/model.onnx +0 -0
- onnx/backend/test/data/node/test_basic_conv_with_padding/model.onnx +0 -0
- onnx/backend/test/data/node/test_basic_conv_without_padding/model.onnx +0 -0
- onnx/backend/test/data/node/test_basic_deform_conv_with_padding/model.onnx +0 -0
- onnx/backend/test/data/node/test_basic_deform_conv_without_padding/model.onnx +0 -0
- onnx/backend/test/data/node/test_bernoulli/model.onnx +0 -0
- onnx/backend/test/data/node/test_bernoulli_double/model.onnx +0 -0
- onnx/backend/test/data/node/test_bernoulli_double_expanded/model.onnx +0 -0
- onnx/backend/test/data/node/test_bernoulli_expanded/model.onnx +0 -0
- onnx/backend/test/data/node/test_bernoulli_seed/model.onnx +0 -0
- onnx/backend/test/data/node/test_bernoulli_seed_expanded/model.onnx +0 -0
- onnx/backend/test/data/node/test_blackmanwindow/test_data_set_0/output_0.pb +0 -0
- onnx/backend/test/data/node/test_blackmanwindow_expanded/test_data_set_0/output_0.pb +0 -0
- onnx/backend/test/data/node/test_blackmanwindow_symmetric/test_data_set_0/output_0.pb +0 -0
- onnx/backend/test/data/node/test_blackmanwindow_symmetric_expanded/test_data_set_0/output_0.pb +0 -0
- onnx/backend/test/data/node/test_cast_FLOAT16_to_INT4/test_data_set_0/output_0.pb +1 -1
- onnx/backend/test/data/node/test_cast_FLOAT_to_INT4/test_data_set_0/output_0.pb +1 -1
- onnx/backend/test/data/node/test_cast_INT4_to_FLOAT/test_data_set_0/input_0.pb +1 -1
- onnx/backend/test/data/node/test_cast_INT4_to_FLOAT16/test_data_set_0/input_0.pb +1 -1
- onnx/backend/test/data/node/test_cast_INT4_to_INT8/test_data_set_0/input_0.pb +1 -1
- onnx/backend/test/data/node/test_conv_with_autopad_same/model.onnx +0 -0
- onnx/backend/test/data/node/test_conv_with_strides_and_asymmetric_padding/model.onnx +0 -0
- onnx/backend/test/data/node/test_conv_with_strides_no_padding/model.onnx +0 -0
- onnx/backend/test/data/node/test_conv_with_strides_padding/model.onnx +0 -0
- onnx/backend/test/data/node/test_convtranspose/model.onnx +0 -0
- onnx/backend/test/data/node/test_convtranspose_1d/model.onnx +0 -0
- onnx/backend/test/data/node/test_convtranspose_3d/model.onnx +0 -0
- onnx/backend/test/data/node/test_convtranspose_autopad_same/model.onnx +0 -0
- onnx/backend/test/data/node/test_convtranspose_dilations/model.onnx +0 -0
- onnx/backend/test/data/node/test_convtranspose_group_2/model.onnx +0 -0
- onnx/backend/test/data/node/test_convtranspose_group_2/test_data_set_0/input_0.pb +0 -0
- onnx/backend/test/data/node/test_convtranspose_group_2/test_data_set_0/input_1.pb +0 -0
- onnx/backend/test/data/node/test_convtranspose_group_2/test_data_set_0/output_0.pb +0 -0
- onnx/backend/test/data/node/test_convtranspose_group_2_image_3/model.onnx +0 -0
- onnx/backend/test/data/node/test_convtranspose_group_2_image_3/test_data_set_0/input_0.pb +0 -0
- onnx/backend/test/data/node/test_convtranspose_group_2_image_3/test_data_set_0/input_1.pb +0 -0
- onnx/backend/test/data/node/test_convtranspose_group_2_image_3/test_data_set_0/output_0.pb +0 -0
- onnx/backend/test/data/node/test_convtranspose_kernel_shape/model.onnx +0 -0
- onnx/backend/test/data/node/test_convtranspose_output_shape/model.onnx +0 -0
- onnx/backend/test/data/node/test_convtranspose_pad/model.onnx +0 -0
- onnx/backend/test/data/node/test_convtranspose_pads/model.onnx +0 -0
- onnx/backend/test/data/node/test_cos/model.onnx +0 -0
- onnx/backend/test/data/node/test_cos_example/model.onnx +0 -0
- onnx/backend/test/data/node/test_cosh/model.onnx +0 -0
- onnx/backend/test/data/node/test_cosh/test_data_set_0/output_0.pb +1 -1
- onnx/backend/test/data/node/test_cosh_example/model.onnx +0 -0
- onnx/backend/test/data/node/test_cosh_example/test_data_set_0/output_0.pb +0 -0
- onnx/backend/test/data/node/test_deform_conv_with_mask_bias/model.onnx +0 -0
- onnx/backend/test/data/node/test_deform_conv_with_multiple_offset_groups/model.onnx +0 -0
- onnx/backend/test/data/node/test_dequantizelinear_int4/test_data_set_0/input_0.pb +1 -1
- onnx/backend/test/data/node/test_det_2d/model.onnx +0 -0
- onnx/backend/test/data/node/test_det_nd/model.onnx +0 -0
- onnx/backend/test/data/node/test_dft/test_data_set_0/output_0.pb +0 -0
- onnx/backend/test/data/node/test_dft_axis/test_data_set_0/output_0.pb +0 -0
- onnx/backend/test/data/node/test_dft_axis_opset19/test_data_set_0/output_0.pb +0 -0
- onnx/backend/test/data/node/test_dft_inverse/test_data_set_0/output_0.pb +0 -0
- onnx/backend/test/data/node/test_dft_inverse_opset19/test_data_set_0/output_0.pb +0 -0
- onnx/backend/test/data/node/test_dft_opset19/test_data_set_0/output_0.pb +0 -0
- onnx/backend/test/data/node/test_dropout_default/model.onnx +0 -0
- onnx/backend/test/data/node/test_dropout_default_mask/model.onnx +0 -0
- onnx/backend/test/data/node/test_dropout_default_mask_ratio/model.onnx +0 -0
- onnx/backend/test/data/node/test_dropout_default_ratio/model.onnx +0 -0
- onnx/backend/test/data/node/test_elu/model.onnx +0 -0
- onnx/backend/test/data/node/test_elu_default/model.onnx +0 -0
- onnx/backend/test/data/node/test_elu_example/model.onnx +0 -0
- onnx/backend/test/data/node/test_eyelike_populate_off_main_diagonal/model.onnx +0 -0
- onnx/backend/test/data/node/test_eyelike_with_dtype/model.onnx +0 -0
- onnx/backend/test/data/node/test_eyelike_without_dtype/model.onnx +0 -0
- onnx/backend/test/data/node/test_gelu_default_1/test_data_set_0/output_0.pb +0 -0
- onnx/backend/test/data/node/test_gelu_default_1_expanded/test_data_set_0/output_0.pb +0 -0
- onnx/backend/test/data/node/test_gelu_default_2/test_data_set_0/output_0.pb +4 -3
- onnx/backend/test/data/node/test_gelu_default_2_expanded/test_data_set_0/output_0.pb +4 -3
- onnx/backend/test/data/node/test_gelu_tanh_2/test_data_set_0/output_0.pb +0 -0
- onnx/backend/test/data/node/test_gelu_tanh_2_expanded/test_data_set_0/output_0.pb +0 -0
- onnx/backend/test/data/node/test_globalaveragepool/model.onnx +0 -0
- onnx/backend/test/data/node/test_globalaveragepool_precomputed/model.onnx +0 -0
- onnx/backend/test/data/node/test_globalmaxpool/model.onnx +0 -0
- onnx/backend/test/data/node/test_globalmaxpool_precomputed/model.onnx +0 -0
- onnx/backend/test/data/node/test_gridsample/model.onnx +0 -0
- onnx/backend/test/data/node/test_gridsample_aligncorners_true/model.onnx +0 -0
- onnx/backend/test/data/node/test_gridsample_bicubic/model.onnx +0 -0
- onnx/backend/test/data/node/test_gridsample_bicubic_align_corners_0_additional_1/model.onnx +0 -0
- onnx/backend/test/data/node/test_gridsample_bicubic_align_corners_1_additional_1/model.onnx +0 -0
- onnx/backend/test/data/node/test_gridsample_bilinear/model.onnx +0 -0
- onnx/backend/test/data/node/test_gridsample_bilinear_align_corners_0_additional_1/model.onnx +0 -0
- onnx/backend/test/data/node/test_gridsample_bilinear_align_corners_1_additional_1/model.onnx +0 -0
- onnx/backend/test/data/node/test_gridsample_border_padding/model.onnx +0 -0
- onnx/backend/test/data/node/test_gridsample_nearest/model.onnx +0 -0
- onnx/backend/test/data/node/test_gridsample_nearest_align_corners_0_additional_1/model.onnx +0 -0
- onnx/backend/test/data/node/test_gridsample_nearest_align_corners_1_additional_1/model.onnx +0 -0
- onnx/backend/test/data/node/test_gridsample_reflection_padding/model.onnx +0 -0
- onnx/backend/test/data/node/test_gridsample_volumetric_bilinear_align_corners_0/model.onnx +0 -0
- onnx/backend/test/data/node/test_gridsample_volumetric_bilinear_align_corners_1/model.onnx +0 -0
- onnx/backend/test/data/node/test_gridsample_volumetric_nearest_align_corners_0/model.onnx +0 -0
- onnx/backend/test/data/node/test_gridsample_volumetric_nearest_align_corners_1/model.onnx +0 -0
- onnx/backend/test/data/node/test_gridsample_zeros_padding/model.onnx +0 -0
- onnx/backend/test/data/node/test_gru_batchwise/model.onnx +0 -0
- onnx/backend/test/data/node/test_gru_defaults/model.onnx +0 -0
- onnx/backend/test/data/node/test_gru_seq_length/model.onnx +0 -0
- onnx/backend/test/data/node/test_gru_with_initial_bias/model.onnx +0 -0
- onnx/backend/test/data/node/test_hammingwindow/test_data_set_0/output_0.pb +0 -0
- onnx/backend/test/data/node/test_hammingwindow_expanded/test_data_set_0/output_0.pb +0 -0
- onnx/backend/test/data/node/test_hammingwindow_symmetric/test_data_set_0/output_0.pb +1 -1
- onnx/backend/test/data/node/test_hammingwindow_symmetric_expanded/test_data_set_0/output_0.pb +1 -1
- onnx/backend/test/data/node/test_hannwindow/test_data_set_0/output_0.pb +0 -0
- onnx/backend/test/data/node/test_hannwindow_expanded/test_data_set_0/output_0.pb +0 -0
- onnx/backend/test/data/node/test_hannwindow_symmetric/test_data_set_0/output_0.pb +0 -0
- onnx/backend/test/data/node/test_hannwindow_symmetric_expanded/test_data_set_0/output_0.pb +0 -0
- onnx/backend/test/data/node/test_hardsigmoid/model.onnx +0 -0
- onnx/backend/test/data/node/test_hardsigmoid_default/model.onnx +0 -0
- onnx/backend/test/data/node/test_hardsigmoid_example/model.onnx +0 -0
- onnx/backend/test/data/node/test_hardswish/model.onnx +0 -0
- onnx/backend/test/data/node/test_hardswish_expanded/model.onnx +0 -0
- onnx/backend/test/data/node/test_image_decoder_decode_jpeg2k_rgb/test_data_set_0/input_0.pb +0 -0
- onnx/backend/test/data/node/test_instancenorm_epsilon/model.onnx +0 -0
- onnx/backend/test/data/node/test_instancenorm_example/model.onnx +0 -0
- onnx/backend/test/data/node/test_lppool_1d_default/model.onnx +0 -0
- onnx/backend/test/data/node/test_lppool_1d_default/test_data_set_0/output_0.pb +2 -2
- onnx/backend/test/data/node/test_lppool_2d_default/model.onnx +0 -0
- onnx/backend/test/data/node/test_lppool_2d_default/test_data_set_0/output_0.pb +0 -0
- onnx/backend/test/data/node/test_lppool_2d_dilations/model.onnx +0 -0
- onnx/backend/test/data/node/test_lppool_2d_pads/model.onnx +0 -0
- onnx/backend/test/data/node/test_lppool_2d_pads/test_data_set_0/output_0.pb +0 -0
- onnx/backend/test/data/node/test_lppool_2d_same_lower/model.onnx +0 -0
- onnx/backend/test/data/node/test_lppool_2d_same_lower/test_data_set_0/output_0.pb +0 -0
- onnx/backend/test/data/node/test_lppool_2d_same_upper/model.onnx +0 -0
- onnx/backend/test/data/node/test_lppool_2d_same_upper/test_data_set_0/output_0.pb +0 -0
- onnx/backend/test/data/node/test_lppool_2d_strides/model.onnx +0 -0
- onnx/backend/test/data/node/test_lppool_2d_strides/test_data_set_0/output_0.pb +0 -0
- onnx/backend/test/data/node/test_lppool_3d_default/model.onnx +0 -0
- onnx/backend/test/data/node/test_lppool_3d_default/test_data_set_0/output_0.pb +0 -0
- onnx/backend/test/data/node/test_lstm_batchwise/model.onnx +0 -0
- onnx/backend/test/data/node/test_lstm_defaults/model.onnx +0 -0
- onnx/backend/test/data/node/test_lstm_with_initial_bias/model.onnx +0 -0
- onnx/backend/test/data/node/test_lstm_with_peepholes/model.onnx +0 -0
- onnx/backend/test/data/node/test_maxpool_1d_default/model.onnx +0 -0
- onnx/backend/test/data/node/test_maxpool_2d_ceil/model.onnx +0 -0
- onnx/backend/test/data/node/test_maxpool_2d_ceil_output_size_reduce_by_one/model.onnx +0 -0
- onnx/backend/test/data/node/test_maxpool_2d_default/model.onnx +0 -0
- onnx/backend/test/data/node/test_maxpool_2d_dilations/model.onnx +0 -0
- onnx/backend/test/data/node/test_maxpool_2d_pads/model.onnx +0 -0
- onnx/backend/test/data/node/test_maxpool_2d_precomputed_pads/model.onnx +0 -0
- onnx/backend/test/data/node/test_maxpool_2d_precomputed_same_upper/model.onnx +0 -0
- onnx/backend/test/data/node/test_maxpool_2d_precomputed_strides/model.onnx +0 -0
- onnx/backend/test/data/node/test_maxpool_2d_same_lower/model.onnx +0 -0
- onnx/backend/test/data/node/test_maxpool_2d_same_upper/model.onnx +0 -0
- onnx/backend/test/data/node/test_maxpool_2d_strides/model.onnx +0 -0
- onnx/backend/test/data/node/test_maxpool_2d_uint8/model.onnx +0 -0
- onnx/backend/test/data/node/test_maxpool_3d_default/model.onnx +0 -0
- onnx/backend/test/data/node/test_maxpool_3d_dilations/model.onnx +0 -0
- onnx/backend/test/data/node/test_maxpool_3d_dilations_use_ref_impl/model.onnx +0 -0
- onnx/backend/test/data/node/test_maxpool_3d_dilations_use_ref_impl_large/model.onnx +0 -0
- onnx/backend/test/data/node/test_maxpool_with_argmax_2d_precomputed_pads/model.onnx +0 -0
- onnx/backend/test/data/node/test_maxpool_with_argmax_2d_precomputed_strides/model.onnx +0 -0
- onnx/backend/test/data/node/test_maxunpool_export_with_output_shape/model.onnx +0 -0
- onnx/backend/test/data/node/test_maxunpool_export_without_output_shape/model.onnx +0 -0
- onnx/backend/test/data/node/test_mish/model.onnx +0 -0
- onnx/backend/test/data/node/test_mish/test_data_set_0/output_0.pb +0 -0
- onnx/backend/test/data/node/test_mish_expanded/model.onnx +0 -0
- onnx/backend/test/data/node/test_mish_expanded/test_data_set_0/output_0.pb +0 -0
- onnx/backend/test/data/node/test_nllloss_NC/model.onnx +0 -0
- onnx/backend/test/data/node/test_nllloss_NC_expanded/model.onnx +0 -0
- onnx/backend/test/data/node/test_nllloss_NCd1/model.onnx +0 -0
- onnx/backend/test/data/node/test_nllloss_NCd1_expanded/model.onnx +0 -0
- onnx/backend/test/data/node/test_nllloss_NCd1_ii/model.onnx +0 -0
- onnx/backend/test/data/node/test_nllloss_NCd1_ii_expanded/model.onnx +0 -0
- onnx/backend/test/data/node/test_nllloss_NCd1_mean_weight_negative_ii/model.onnx +0 -0
- onnx/backend/test/data/node/test_nllloss_NCd1_mean_weight_negative_ii_expanded/model.onnx +0 -0
- onnx/backend/test/data/node/test_nllloss_NCd1_weight/model.onnx +0 -0
- onnx/backend/test/data/node/test_nllloss_NCd1_weight_expanded/model.onnx +0 -0
- onnx/backend/test/data/node/test_nllloss_NCd1_weight_ii/model.onnx +0 -0
- onnx/backend/test/data/node/test_nllloss_NCd1_weight_ii_expanded/model.onnx +0 -0
- onnx/backend/test/data/node/test_nllloss_NCd1d2/model.onnx +0 -0
- onnx/backend/test/data/node/test_nllloss_NCd1d2_expanded/model.onnx +0 -0
- onnx/backend/test/data/node/test_nllloss_NCd1d2_no_weight_reduction_mean_ii/model.onnx +0 -0
- onnx/backend/test/data/node/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded/model.onnx +0 -0
- onnx/backend/test/data/node/test_nllloss_NCd1d2_reduction_mean/model.onnx +0 -0
- onnx/backend/test/data/node/test_nllloss_NCd1d2_reduction_mean_expanded/model.onnx +0 -0
- onnx/backend/test/data/node/test_nllloss_NCd1d2_reduction_sum/model.onnx +0 -0
- onnx/backend/test/data/node/test_nllloss_NCd1d2_reduction_sum_expanded/model.onnx +0 -0
- onnx/backend/test/data/node/test_nllloss_NCd1d2_with_weight/model.onnx +0 -0
- onnx/backend/test/data/node/test_nllloss_NCd1d2_with_weight_expanded/model.onnx +0 -0
- onnx/backend/test/data/node/test_nllloss_NCd1d2_with_weight_reduction_mean/model.onnx +0 -0
- onnx/backend/test/data/node/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded/model.onnx +0 -0
- onnx/backend/test/data/node/test_nllloss_NCd1d2_with_weight_reduction_sum/model.onnx +0 -0
- onnx/backend/test/data/node/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded/model.onnx +0 -0
- onnx/backend/test/data/node/test_nllloss_NCd1d2_with_weight_reduction_sum_ii/model.onnx +0 -0
- onnx/backend/test/data/node/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded/model.onnx +0 -0
- onnx/backend/test/data/node/test_nllloss_NCd1d2d3_none_no_weight_negative_ii/model.onnx +0 -0
- onnx/backend/test/data/node/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded/model.onnx +0 -0
- onnx/backend/test/data/node/test_nllloss_NCd1d2d3_sum_weight_high_ii/model.onnx +0 -0
- onnx/backend/test/data/node/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded/model.onnx +0 -0
- onnx/backend/test/data/node/test_nllloss_NCd1d2d3d4d5_mean_weight/model.onnx +0 -0
- onnx/backend/test/data/node/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded/model.onnx +0 -0
- onnx/backend/test/data/node/test_nllloss_NCd1d2d3d4d5_none_no_weight/model.onnx +0 -0
- onnx/backend/test/data/node/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded/model.onnx +0 -0
- onnx/backend/test/data/node/test_quantizelinear_int4/test_data_set_0/output_0.pb +1 -1
- onnx/backend/test/data/node/test_reduce_log_sum_exp_do_not_keepdims_random/test_data_set_0/output_0.pb +1 -1
- onnx/backend/test/data/node/test_reduce_log_sum_exp_do_not_keepdims_random_expanded/test_data_set_0/output_0.pb +1 -1
- onnx/backend/test/data/node/test_reduce_log_sum_exp_keepdims_random/test_data_set_0/output_0.pb +1 -1
- onnx/backend/test/data/node/test_reduce_log_sum_exp_keepdims_random_expanded/test_data_set_0/output_0.pb +1 -1
- onnx/backend/test/data/node/test_reduce_log_sum_exp_negative_axes_keepdims_random/test_data_set_0/output_0.pb +1 -1
- onnx/backend/test/data/node/test_reduce_log_sum_exp_negative_axes_keepdims_random_expanded/test_data_set_0/output_0.pb +1 -1
- onnx/backend/test/data/node/test_reduce_max_empty_set/model.onnx +0 -0
- onnx/backend/test/data/node/test_reduce_max_empty_set/test_data_set_0/input_0.pb +0 -0
- onnx/backend/test/data/node/test_reduce_max_empty_set/test_data_set_0/input_1.pb +0 -0
- onnx/backend/test/data/node/test_reduce_max_empty_set/test_data_set_0/output_0.pb +0 -0
- onnx/backend/test/data/node/test_reduce_sum_empty_axes_input_noop/model.onnx +0 -0
- onnx/backend/test/data/node/test_reduce_sum_empty_axes_input_noop/test_data_set_0/input_0.pb +1 -0
- onnx/backend/test/data/node/test_reduce_sum_empty_axes_input_noop/test_data_set_0/input_1.pb +0 -0
- onnx/backend/test/data/node/test_reduce_sum_empty_axes_input_noop/test_data_set_0/output_0.pb +1 -0
- onnx/backend/test/data/node/test_reduce_sum_negative_axes_keepdims_random/model.onnx +0 -0
- onnx/backend/test/data/node/test_reduce_sum_negative_axes_keepdims_random/test_data_set_0/input_1.pb +0 -0
- onnx/backend/test/data/node/test_reduce_sum_negative_axes_keepdims_random/test_data_set_0/output_0.pb +1 -1
- onnx/backend/test/data/node/test_resize_tf_crop_and_resize/model.onnx +0 -0
- onnx/backend/test/data/node/test_resize_tf_crop_and_resize/test_data_set_0/input_1.pb +0 -0
- onnx/backend/test/data/node/test_resize_tf_crop_and_resize/test_data_set_0/output_0.pb +0 -0
- onnx/backend/test/data/node/test_resize_tf_crop_and_resize_extrapolation_value/model.onnx +0 -0
- onnx/backend/test/data/node/test_resize_tf_crop_and_resize_extrapolation_value/test_data_set_0/input_0.pb +0 -0
- onnx/backend/test/data/node/test_resize_tf_crop_and_resize_extrapolation_value/test_data_set_0/input_1.pb +0 -0
- onnx/backend/test/data/node/test_resize_tf_crop_and_resize_extrapolation_value/test_data_set_0/input_2.pb +0 -0
- onnx/backend/test/data/node/test_resize_tf_crop_and_resize_extrapolation_value/test_data_set_0/output_0.pb +0 -0
- onnx/backend/test/data/node/test_resize_upsample_sizes_nearest_not_larger/model.onnx +0 -0
- onnx/backend/test/data/node/test_resize_upsample_sizes_nearest_not_larger/test_data_set_0/output_0.pb +0 -0
- onnx/backend/test/data/node/test_resize_upsample_sizes_nearest_not_smaller/model.onnx +0 -0
- onnx/backend/test/data/node/test_resize_upsample_sizes_nearest_not_smaller/test_data_set_0/input_0.pb +0 -0
- onnx/backend/test/data/node/test_resize_upsample_sizes_nearest_not_smaller/test_data_set_0/input_1.pb +0 -0
- onnx/backend/test/data/node/test_resize_upsample_sizes_nearest_not_smaller/test_data_set_0/output_0.pb +0 -0
- onnx/backend/test/data/node/test_rnn_seq_length/model.onnx +0 -0
- onnx/backend/test/data/node/test_roialign_aligned_false/model.onnx +0 -0
- onnx/backend/test/data/node/test_roialign_aligned_true/model.onnx +0 -0
- onnx/backend/test/data/node/test_roialign_mode_max/model.onnx +0 -0
- onnx/backend/test/data/node/test_round/model.onnx +0 -0
- onnx/backend/test/data/node/test_selu/model.onnx +0 -0
- onnx/backend/test/data/node/test_selu_default/model.onnx +0 -0
- onnx/backend/test/data/node/test_selu_example/model.onnx +0 -0
- onnx/backend/test/data/node/test_simple_rnn_batchwise/model.onnx +0 -0
- onnx/backend/test/data/node/test_simple_rnn_defaults/model.onnx +0 -0
- onnx/backend/test/data/node/test_simple_rnn_with_initial_bias/model.onnx +0 -0
- onnx/backend/test/data/node/test_sin/model.onnx +0 -0
- onnx/backend/test/data/node/test_sin_example/model.onnx +0 -0
- onnx/backend/test/data/node/test_sinh/model.onnx +0 -0
- onnx/backend/test/data/node/test_sinh/test_data_set_0/output_0.pb +1 -1
- onnx/backend/test/data/node/test_sinh_example/model.onnx +0 -0
- onnx/backend/test/data/node/test_softplus/model.onnx +0 -0
- onnx/backend/test/data/node/test_softplus_example/model.onnx +0 -0
- onnx/backend/test/data/node/test_softsign/model.onnx +0 -0
- onnx/backend/test/data/node/test_softsign_example/model.onnx +0 -0
- onnx/backend/test/data/node/test_stft_with_window/test_data_set_0/input_2.pb +0 -0
- onnx/backend/test/data/node/test_stft_with_window/test_data_set_0/output_0.pb +0 -0
- onnx/backend/test/data/node/test_tan/model.onnx +0 -0
- onnx/backend/test/data/node/test_tan/test_data_set_0/output_0.pb +1 -1
- onnx/backend/test/data/node/test_tan_example/model.onnx +0 -0
- onnx/backend/test/data/node/test_thresholdedrelu/model.onnx +0 -0
- onnx/backend/test/data/node/test_thresholdedrelu_default/model.onnx +0 -0
- onnx/backend/test/data/node/test_thresholdedrelu_example/model.onnx +0 -0
- onnx/backend/test/data/node/test_training_dropout/model.onnx +0 -0
- onnx/backend/test/data/node/test_training_dropout_default/model.onnx +0 -0
- onnx/backend/test/data/node/test_training_dropout_default_mask/model.onnx +0 -0
- onnx/backend/test/data/node/test_training_dropout_mask/model.onnx +0 -0
- onnx/backend/test/data/node/test_training_dropout_zero_ratio/model.onnx +0 -0
- onnx/backend/test/data/node/test_training_dropout_zero_ratio_mask/model.onnx +0 -0
- onnx/backend/test/loader/__init__.py +11 -6
- onnx/backend/test/report/__init__.py +4 -3
- onnx/backend/test/report/base.py +1 -0
- onnx/backend/test/report/coverage.py +21 -20
- onnx/backend/test/runner/__init__.py +13 -11
- onnx/backend/test/runner/item.py +3 -2
- onnx/backend/test/stat_coverage.py +6 -5
- onnx/bin/checker.py +1 -0
- onnx/checker.cc +6 -1
- onnx/common/version.h +1 -1
- onnx/compose.py +66 -50
- onnx/cpp2py_export.cc +4 -0
- onnx/defs/__init__.py +2 -2
- onnx/defs/data_type_utils.cc +0 -1
- onnx/defs/gen_doc.py +9 -8
- onnx/defs/gen_shape_inference_information.py +1 -0
- onnx/defs/generator/defs.cc +32 -84
- onnx/defs/generator/old.cc +389 -0
- onnx/defs/math/defs.cc +308 -313
- onnx/defs/math/old.cc +996 -9
- onnx/defs/math/utils.cc +12 -1
- onnx/defs/math/utils.h +2 -0
- onnx/defs/nn/defs.cc +57 -75
- onnx/defs/nn/old.cc +1536 -2
- onnx/defs/object_detection/defs.cc +4 -7
- onnx/defs/object_detection/old.cc +117 -0
- onnx/defs/operator_sets.h +108 -1
- onnx/defs/parser.cc +10 -1
- onnx/defs/quantization/defs.cc +3 -2
- onnx/defs/quantization/old.cc +4 -1
- onnx/defs/rnn/defs.cc +10 -13
- onnx/defs/rnn/old.cc +517 -2
- onnx/defs/schema.cc +53 -59
- onnx/defs/schema.h +58 -2
- onnx/defs/shape_inference.h +67 -18
- onnx/defs/tensor/defs.cc +22 -20
- onnx/defs/tensor/old.cc +114 -3
- onnx/external_data_helper.py +27 -14
- onnx/gen_proto.py +3 -2
- onnx/helper.py +86 -61
- onnx/hub.py +39 -35
- onnx/inliner/inliner.cc +0 -1
- onnx/mapping.py +3 -2
- onnx/numpy_helper.py +159 -23
- onnx/onnx-ml.proto +1 -1
- onnx/onnx.in.proto +1 -1
- onnx/onnx.proto +1 -1
- onnx/onnx_cpp2py_export/defs.pyi +0 -2
- onnx/onnx_cpp2py_export/inliner.pyi +0 -4
- onnx/onnx_cpp2py_export/parser.pyi +0 -4
- onnx/onnx_cpp2py_export.cp38-win32.pyd +0 -0
- onnx/parser.py +1 -0
- onnx/printer.py +2 -3
- onnx/reference/__init__.py +1 -0
- onnx/reference/custom_element_types.py +73 -8
- onnx/reference/op_run.py +13 -58
- onnx/reference/ops/__init__.py +1 -0
- onnx/reference/ops/_helpers.py +6 -4
- onnx/reference/ops/_op.py +16 -5
- onnx/reference/ops/_op_common_indices.py +1 -1
- onnx/reference/ops/_op_common_pool.py +38 -29
- onnx/reference/ops/_op_common_random.py +1 -1
- onnx/reference/ops/_op_common_window.py +2 -2
- onnx/reference/ops/_op_list.py +9 -6
- onnx/reference/ops/aionnx_preview_training/__init__.py +1 -0
- onnx/reference/ops/aionnx_preview_training/_op_list.py +5 -7
- onnx/reference/ops/aionnx_preview_training/_op_run_training.py +1 -1
- onnx/reference/ops/aionnx_preview_training/op_adagrad.py +14 -5
- onnx/reference/ops/aionnx_preview_training/op_adam.py +2 -2
- onnx/reference/ops/aionnx_preview_training/op_momentum.py +14 -2
- onnx/reference/ops/aionnxml/__init__.py +1 -0
- onnx/reference/ops/aionnxml/_common_classifier.py +1 -0
- onnx/reference/ops/aionnxml/_op_list.py +5 -6
- onnx/reference/ops/aionnxml/_op_run_aionnxml.py +1 -1
- onnx/reference/ops/aionnxml/op_array_feature_extractor.py +1 -1
- onnx/reference/ops/aionnxml/op_binarizer.py +1 -1
- onnx/reference/ops/aionnxml/op_dict_vectorizer.py +2 -2
- onnx/reference/ops/aionnxml/op_feature_vectorizer.py +1 -1
- onnx/reference/ops/aionnxml/op_imputer.py +3 -3
- onnx/reference/ops/aionnxml/op_label_encoder.py +1 -1
- onnx/reference/ops/aionnxml/op_linear_classifier.py +2 -2
- onnx/reference/ops/aionnxml/op_linear_regressor.py +1 -1
- onnx/reference/ops/aionnxml/op_normalizer.py +1 -1
- onnx/reference/ops/aionnxml/op_one_hot_encoder.py +1 -1
- onnx/reference/ops/aionnxml/op_scaler.py +1 -1
- onnx/reference/ops/aionnxml/op_svm_classifier.py +10 -7
- onnx/reference/ops/aionnxml/op_svm_helper.py +2 -2
- onnx/reference/ops/aionnxml/op_svm_regressor.py +1 -1
- onnx/reference/ops/aionnxml/op_tree_ensemble.py +3 -3
- onnx/reference/ops/aionnxml/op_tree_ensemble_classifier.py +1 -1
- onnx/reference/ops/aionnxml/op_tree_ensemble_helper.py +2 -2
- onnx/reference/ops/aionnxml/op_tree_ensemble_regressor.py +5 -3
- onnx/reference/ops/experimental/__init__.py +1 -0
- onnx/reference/ops/experimental/_op_list.py +6 -12
- onnx/reference/ops/experimental/_op_run_experimental.py +1 -1
- onnx/reference/ops/experimental/op_im2col.py +1 -1
- onnx/reference/ops/op_abs.py +1 -1
- onnx/reference/ops/op_acos.py +1 -1
- onnx/reference/ops/op_acosh.py +1 -1
- onnx/reference/ops/op_add.py +1 -1
- onnx/reference/ops/op_affine_grid.py +1 -1
- onnx/reference/ops/op_and.py +1 -1
- onnx/reference/ops/op_argmax.py +1 -1
- onnx/reference/ops/op_argmin.py +1 -1
- onnx/reference/ops/op_asin.py +1 -1
- onnx/reference/ops/op_asinh.py +1 -1
- onnx/reference/ops/op_atan.py +1 -1
- onnx/reference/ops/op_atanh.py +1 -1
- onnx/reference/ops/op_attribute_has_value.py +15 -15
- onnx/reference/ops/op_average_pool.py +1 -1
- onnx/reference/ops/op_batch_normalization.py +13 -2
- onnx/reference/ops/op_bernoulli.py +1 -1
- onnx/reference/ops/op_bitshift.py +1 -1
- onnx/reference/ops/op_bitwise_and.py +1 -1
- onnx/reference/ops/op_bitwise_not.py +1 -1
- onnx/reference/ops/op_bitwise_or.py +1 -1
- onnx/reference/ops/op_bitwise_xor.py +1 -1
- onnx/reference/ops/op_blackman_window.py +1 -1
- onnx/reference/ops/op_cast.py +11 -10
- onnx/reference/ops/op_cast_like.py +1 -1
- onnx/reference/ops/op_ceil.py +1 -1
- onnx/reference/ops/op_celu.py +1 -1
- onnx/reference/ops/op_center_crop_pad.py +1 -1
- onnx/reference/ops/op_clip.py +1 -1
- onnx/reference/ops/op_col2im.py +10 -4
- onnx/reference/ops/op_compress.py +1 -1
- onnx/reference/ops/op_concat.py +1 -1
- onnx/reference/ops/op_concat_from_sequence.py +3 -3
- onnx/reference/ops/op_constant.py +2 -2
- onnx/reference/ops/op_constant_of_shape.py +1 -1
- onnx/reference/ops/op_conv.py +22 -17
- onnx/reference/ops/op_conv_integer.py +1 -1
- onnx/reference/ops/op_conv_transpose.py +37 -6
- onnx/reference/ops/op_cos.py +1 -1
- onnx/reference/ops/op_cosh.py +1 -1
- onnx/reference/ops/op_cum_sum.py +1 -1
- onnx/reference/ops/op_deform_conv.py +1 -1
- onnx/reference/ops/op_depth_to_space.py +1 -1
- onnx/reference/ops/op_dequantize_linear.py +7 -9
- onnx/reference/ops/op_det.py +1 -1
- onnx/reference/ops/op_dft.py +16 -2
- onnx/reference/ops/op_div.py +1 -1
- onnx/reference/ops/op_dropout.py +9 -8
- onnx/reference/ops/op_dynamic_quantize_linear.py +1 -1
- onnx/reference/ops/op_einsum.py +1 -1
- onnx/reference/ops/op_elu.py +1 -1
- onnx/reference/ops/op_equal.py +1 -1
- onnx/reference/ops/op_erf.py +1 -1
- onnx/reference/ops/op_exp.py +1 -1
- onnx/reference/ops/op_expand.py +1 -1
- onnx/reference/ops/op_eyelike.py +2 -2
- onnx/reference/ops/op_flatten.py +1 -1
- onnx/reference/ops/op_floor.py +1 -1
- onnx/reference/ops/op_gather.py +1 -1
- onnx/reference/ops/op_gather_elements.py +3 -3
- onnx/reference/ops/op_gathernd.py +2 -4
- onnx/reference/ops/op_gemm.py +12 -2
- onnx/reference/ops/op_global_average_pool.py +1 -1
- onnx/reference/ops/op_global_max_pool.py +1 -1
- onnx/reference/ops/op_greater.py +1 -1
- onnx/reference/ops/op_greater_or_equal.py +1 -1
- onnx/reference/ops/op_grid_sample.py +2 -3
- onnx/reference/ops/op_gru.py +7 -7
- onnx/reference/ops/op_hamming_window.py +1 -1
- onnx/reference/ops/op_hann_window.py +1 -1
- onnx/reference/ops/op_hard_sigmoid.py +1 -1
- onnx/reference/ops/op_hardmax.py +5 -2
- onnx/reference/ops/op_identity.py +3 -3
- onnx/reference/ops/op_if.py +2 -2
- onnx/reference/ops/op_instance_normalization.py +1 -1
- onnx/reference/ops/op_isinf.py +1 -1
- onnx/reference/ops/op_isnan.py +1 -1
- onnx/reference/ops/op_layer_normalization.py +2 -4
- onnx/reference/ops/op_leaky_relu.py +1 -1
- onnx/reference/ops/op_less.py +1 -1
- onnx/reference/ops/op_less_or_equal.py +1 -1
- onnx/reference/ops/op_log.py +1 -1
- onnx/reference/ops/op_log_softmax.py +1 -1
- onnx/reference/ops/op_loop.py +4 -2
- onnx/reference/ops/op_lp_normalization.py +1 -1
- onnx/reference/ops/op_lp_pool.py +4 -2
- onnx/reference/ops/op_lrn.py +1 -1
- onnx/reference/ops/op_lstm.py +9 -11
- onnx/reference/ops/op_matmul.py +1 -1
- onnx/reference/ops/op_matmul_integer.py +1 -1
- onnx/reference/ops/op_max.py +1 -1
- onnx/reference/ops/op_max_pool.py +8 -8
- onnx/reference/ops/op_max_unpool.py +5 -3
- onnx/reference/ops/op_mean.py +1 -1
- onnx/reference/ops/op_mel_weight_matrix.py +1 -1
- onnx/reference/ops/op_min.py +1 -1
- onnx/reference/ops/op_mod.py +1 -1
- onnx/reference/ops/op_mul.py +1 -1
- onnx/reference/ops/op_neg.py +1 -1
- onnx/reference/ops/op_negative_log_likelihood_loss.py +4 -2
- onnx/reference/ops/op_non_max_suppression.py +10 -11
- onnx/reference/ops/op_non_zero.py +1 -1
- onnx/reference/ops/op_not.py +1 -1
- onnx/reference/ops/op_one_hot.py +1 -1
- onnx/reference/ops/op_optional.py +1 -1
- onnx/reference/ops/op_optional_get_element.py +1 -1
- onnx/reference/ops/op_optional_has_element.py +1 -1
- onnx/reference/ops/op_or.py +1 -1
- onnx/reference/ops/op_pad.py +1 -1
- onnx/reference/ops/op_pool_common.py +7 -6
- onnx/reference/ops/op_pow.py +1 -1
- onnx/reference/ops/op_prelu.py +3 -3
- onnx/reference/ops/op_qlinear_conv.py +1 -1
- onnx/reference/ops/op_qlinear_matmul.py +1 -1
- onnx/reference/ops/op_quantize_linear.py +15 -9
- onnx/reference/ops/op_random_normal.py +1 -1
- onnx/reference/ops/op_random_normal_like.py +1 -1
- onnx/reference/ops/op_random_uniform.py +1 -1
- onnx/reference/ops/op_random_uniform_like.py +1 -1
- onnx/reference/ops/op_range.py +1 -1
- onnx/reference/ops/op_reciprocal.py +1 -1
- onnx/reference/ops/op_reduce_l1.py +1 -1
- onnx/reference/ops/op_reduce_l2.py +1 -1
- onnx/reference/ops/op_reduce_log_sum.py +1 -1
- onnx/reference/ops/op_reduce_log_sum_exp.py +1 -1
- onnx/reference/ops/op_reduce_max.py +1 -1
- onnx/reference/ops/op_reduce_mean.py +2 -2
- onnx/reference/ops/op_reduce_min.py +1 -1
- onnx/reference/ops/op_reduce_prod.py +1 -1
- onnx/reference/ops/op_reduce_sum.py +2 -2
- onnx/reference/ops/op_reduce_sum_square.py +1 -1
- onnx/reference/ops/op_regex_full_match.py +1 -1
- onnx/reference/ops/op_relu.py +1 -1
- onnx/reference/ops/op_reshape.py +1 -1
- onnx/reference/ops/op_reverse_sequence.py +1 -1
- onnx/reference/ops/op_rnn.py +10 -8
- onnx/reference/ops/op_roi_align.py +5 -5
- onnx/reference/ops/op_round.py +1 -1
- onnx/reference/ops/op_scan.py +8 -8
- onnx/reference/ops/op_scatter_elements.py +19 -50
- onnx/reference/ops/op_scatternd.py +1 -1
- onnx/reference/ops/op_selu.py +1 -1
- onnx/reference/ops/op_sequence_at.py +1 -1
- onnx/reference/ops/op_sequence_construct.py +1 -1
- onnx/reference/ops/op_sequence_empty.py +2 -2
- onnx/reference/ops/op_sequence_erase.py +1 -1
- onnx/reference/ops/op_sequence_insert.py +6 -6
- onnx/reference/ops/op_sequence_length.py +1 -1
- onnx/reference/ops/op_sequence_map.py +1 -1
- onnx/reference/ops/op_shape.py +2 -6
- onnx/reference/ops/op_shrink.py +1 -1
- onnx/reference/ops/op_sigmoid.py +1 -1
- onnx/reference/ops/op_sign.py +1 -1
- onnx/reference/ops/op_sin.py +1 -1
- onnx/reference/ops/op_sinh.py +1 -1
- onnx/reference/ops/op_size.py +1 -1
- onnx/reference/ops/op_slice.py +3 -5
- onnx/reference/ops/op_softmax.py +1 -1
- onnx/reference/ops/op_softmax_cross_entropy_loss.py +1 -1
- onnx/reference/ops/op_softplus.py +1 -1
- onnx/reference/ops/op_softsign.py +1 -1
- onnx/reference/ops/op_space_to_depth.py +1 -1
- onnx/reference/ops/op_split.py +1 -1
- onnx/reference/ops/op_split_to_sequence.py +5 -7
- onnx/reference/ops/op_sqrt.py +1 -1
- onnx/reference/ops/op_squeeze.py +1 -1
- onnx/reference/ops/op_stft.py +3 -2
- onnx/reference/ops/op_string_concat.py +1 -1
- onnx/reference/ops/op_string_normalizer.py +8 -8
- onnx/reference/ops/op_string_split.py +2 -4
- onnx/reference/ops/op_sub.py +1 -1
- onnx/reference/ops/op_sum.py +1 -1
- onnx/reference/ops/op_tan.py +1 -1
- onnx/reference/ops/op_tanh.py +1 -1
- onnx/reference/ops/op_tfidf_vectorizer.py +11 -12
- onnx/reference/ops/op_thresholded_relu.py +1 -1
- onnx/reference/ops/op_tile.py +1 -1
- onnx/reference/ops/op_topk.py +7 -2
- onnx/reference/ops/op_transpose.py +1 -1
- onnx/reference/ops/op_trilu.py +1 -1
- onnx/reference/ops/op_unique.py +3 -1
- onnx/reference/ops/op_unsqueeze.py +2 -2
- onnx/reference/ops/op_upsample.py +1 -1
- onnx/reference/ops/op_where.py +1 -1
- onnx/reference/ops/op_xor.py +1 -1
- onnx/reference/ops_optimized/__init__.py +1 -0
- onnx/reference/ops_optimized/op_conv_optimized.py +1 -1
- onnx/reference/reference_evaluator.py +27 -13
- onnx/serialization.py +1 -1
- onnx/shape_inference/implementation.cc +15 -1
- onnx/shape_inference/implementation.h +15 -1
- onnx/shape_inference.py +1 -1
- onnx/subbyte.py +6 -6
- onnx/test/basic_test.py +1 -0
- onnx/test/checker_test.py +37 -2
- onnx/test/compose_test.py +12 -11
- onnx/test/cpp/schema_registration_test.cc +3 -3
- onnx/test/cpp/shape_inference_test.cc +38 -2
- onnx/test/elu_test.py +2 -0
- onnx/test/function_inference_test.py +2 -0
- onnx/test/function_test.py +1 -0
- onnx/test/helper_test.py +77 -16
- onnx/test/hub_test.py +1 -1
- onnx/test/inference_function_test.py +25 -8
- onnx/test/inliner_test.py +2 -0
- onnx/test/model_container_refeval_test.py +2 -1
- onnx/test/model_container_test.py +1 -0
- onnx/test/model_inference_test.py +2 -0
- onnx/test/numpy_helper_test.py +56 -1
- onnx/test/parser_test.py +48 -2
- onnx/test/printer_test.py +2 -0
- onnx/test/reference_evaluator_ml_test.py +2 -3
- onnx/test/reference_evaluator_model_test.py +2 -0
- onnx/test/reference_evaluator_test.py +173 -19
- onnx/test/relu_test.py +2 -0
- onnx/test/schema_test.py +4 -2
- onnx/test/serialization_test.py +2 -0
- onnx/test/shape_inference_test.py +349 -19
- onnx/test/symbolic_shape_test.py +3 -3
- onnx/test/test_backend_onnxruntime.py +272 -1
- onnx/test/test_backend_reference.py +24 -3
- onnx/test/test_backend_test.py +6 -5
- onnx/test/test_external_data.py +91 -2
- onnx/test/test_with_ort.py +1 -0
- onnx/test/tools_test.py +15 -14
- onnx/test/training_tool_test.py +1 -0
- onnx/test/utils_test.py +1 -0
- onnx/test/version_converter/automatic_downgrade_test.py +2 -0
- onnx/test/version_converter/automatic_upgrade_test.py +2 -0
- onnx/test/version_converter_test.py +26 -7
- onnx/test/version_utils.py +8 -0
- onnx/tools/net_drawer.py +7 -6
- onnx/tools/replace_constants.py +11 -11
- onnx/tools/update_model_dims.py +7 -6
- onnx/utils.py +104 -21
- onnx/version.py +2 -2
- onnx/version_converter/adapters/split_17_18.h +1 -1
- onnx/version_converter/convert.h +107 -2
- onnx/version_converter.py +3 -2
- {onnx-1.16.1.dist-info → onnx-1.17.0.dist-info}/METADATA +8 -11
- {onnx-1.16.1.dist-info → onnx-1.17.0.dist-info}/RECORD +843 -817
- {onnx-1.16.1.dist-info → onnx-1.17.0.dist-info}/WHEEL +1 -1
- {onnx-1.16.1.dist-info → onnx-1.17.0.dist-info}/LICENSE +0 -0
- {onnx-1.16.1.dist-info → onnx-1.17.0.dist-info}/entry_points.txt +0 -0
- {onnx-1.16.1.dist-info → onnx-1.17.0.dist-info}/top_level.txt +0 -0
onnx/defs/generator/defs.cc
CHANGED
|
@@ -126,7 +126,7 @@ ONNX_OPERATOR_SET_SCHEMA(
|
|
|
126
126
|
}
|
|
127
127
|
}));
|
|
128
128
|
|
|
129
|
-
static const char*
|
|
129
|
+
static const char* EyeLike_ver22_doc = R"DOC(
|
|
130
130
|
Generate a 2D tensor (matrix) with ones on the diagonal and zeros everywhere else. Only 2D
|
|
131
131
|
tensors are supported, i.e. input T1 must be of rank 2. The shape of the output tensor is the
|
|
132
132
|
same as the input tensor. The data type can be specified by the 'dtype' argument. If
|
|
@@ -138,9 +138,9 @@ TensorProto message and be valid as an output type.
|
|
|
138
138
|
|
|
139
139
|
ONNX_OPERATOR_SET_SCHEMA(
|
|
140
140
|
EyeLike,
|
|
141
|
-
|
|
141
|
+
22,
|
|
142
142
|
OpSchema()
|
|
143
|
-
.SetDoc(
|
|
143
|
+
.SetDoc(EyeLike_ver22_doc)
|
|
144
144
|
.Attr(
|
|
145
145
|
"k",
|
|
146
146
|
"(Optional) Index of the diagonal to be populated with ones. Default is 0."
|
|
@@ -159,33 +159,11 @@ ONNX_OPERATOR_SET_SCHEMA(
|
|
|
159
159
|
.Output(0, "output", "Output tensor, same shape as input tensor T1.", "T2")
|
|
160
160
|
.TypeConstraint(
|
|
161
161
|
"T1",
|
|
162
|
-
|
|
163
|
-
"tensor(float)",
|
|
164
|
-
"tensor(double)",
|
|
165
|
-
"tensor(int8)",
|
|
166
|
-
"tensor(int16)",
|
|
167
|
-
"tensor(int32)",
|
|
168
|
-
"tensor(int64)",
|
|
169
|
-
"tensor(uint8)",
|
|
170
|
-
"tensor(uint16)",
|
|
171
|
-
"tensor(uint32)",
|
|
172
|
-
"tensor(uint64)",
|
|
173
|
-
"tensor(bool)"},
|
|
162
|
+
OpSchema::all_non_complex_numeric_types_plus_bool_ir4(),
|
|
174
163
|
"Constrain input types. Strings and complex are not supported.")
|
|
175
164
|
.TypeConstraint(
|
|
176
165
|
"T2",
|
|
177
|
-
|
|
178
|
-
"tensor(float)",
|
|
179
|
-
"tensor(double)",
|
|
180
|
-
"tensor(int8)",
|
|
181
|
-
"tensor(int16)",
|
|
182
|
-
"tensor(int32)",
|
|
183
|
-
"tensor(int64)",
|
|
184
|
-
"tensor(uint8)",
|
|
185
|
-
"tensor(uint16)",
|
|
186
|
-
"tensor(uint32)",
|
|
187
|
-
"tensor(uint64)",
|
|
188
|
-
"tensor(bool)"},
|
|
166
|
+
OpSchema::all_non_complex_numeric_types_plus_bool_ir4(),
|
|
189
167
|
"Constrain output types. Strings and complex are not supported.")
|
|
190
168
|
.TypeAndShapeInferenceFunction([](InferenceContext& ctx) {
|
|
191
169
|
if (ctx.getAttribute("dtype") != nullptr) {
|
|
@@ -202,7 +180,7 @@ ONNX_OPERATOR_SET_SCHEMA(
|
|
|
202
180
|
propagateShapeFromInputToOutput(ctx, 0, 0);
|
|
203
181
|
}));
|
|
204
182
|
|
|
205
|
-
static const char*
|
|
183
|
+
static const char* RandomUniform_ver22_doc = R"DOC(
|
|
206
184
|
Generate a tensor with random values drawn from a uniform distribution. The shape
|
|
207
185
|
of the tensor is specified by the `shape` argument and the range by `low` and `high`.
|
|
208
186
|
|
|
@@ -213,9 +191,9 @@ TensorProto message.
|
|
|
213
191
|
|
|
214
192
|
ONNX_OPERATOR_SET_SCHEMA(
|
|
215
193
|
RandomUniform,
|
|
216
|
-
|
|
194
|
+
22,
|
|
217
195
|
OpSchema()
|
|
218
|
-
.SetDoc(
|
|
196
|
+
.SetDoc(RandomUniform_ver22_doc)
|
|
219
197
|
.Attr("low", "Lower boundary of the output values.", AttributeProto::FLOAT, 0.0f)
|
|
220
198
|
.Attr("high", "Upper boundary of the output values.", AttributeProto::FLOAT, 1.0f)
|
|
221
199
|
.Attr(
|
|
@@ -230,16 +208,13 @@ ONNX_OPERATOR_SET_SCHEMA(
|
|
|
230
208
|
static_cast<int64_t>(TensorProto::FLOAT))
|
|
231
209
|
.Attr("shape", "The shape of the output tensor.", AttributeProto::INTS)
|
|
232
210
|
.Output(0, "output", "Output tensor of random values drawn from uniform distribution", "T")
|
|
233
|
-
.TypeConstraint(
|
|
234
|
-
"T",
|
|
235
|
-
{"tensor(float16)", "tensor(float)", "tensor(double)"},
|
|
236
|
-
"Constrain output types to float tensors.")
|
|
211
|
+
.TypeConstraint("T", OpSchema::all_float_types_ir4(), "Constrain output types to float tensors.")
|
|
237
212
|
.TypeAndShapeInferenceFunction([](InferenceContext& ctx) {
|
|
238
213
|
propagateElemTypeFromAttributeToOutput(ctx, "dtype", 0, TensorProto::FLOAT);
|
|
239
214
|
propagateShapeFromAttributeToOutput(ctx, "shape", 0);
|
|
240
215
|
}));
|
|
241
216
|
|
|
242
|
-
static const char*
|
|
217
|
+
static const char* RandomNormal_ver22_doc = R"DOC(
|
|
243
218
|
Generate a tensor with random values drawn from a normal distribution. The shape
|
|
244
219
|
of the tensor is specified by the `shape` argument and the parameter of the normal distribution
|
|
245
220
|
specified by `mean` and `scale`.
|
|
@@ -251,9 +226,9 @@ TensorProto message.
|
|
|
251
226
|
|
|
252
227
|
ONNX_OPERATOR_SET_SCHEMA(
|
|
253
228
|
RandomNormal,
|
|
254
|
-
|
|
229
|
+
22,
|
|
255
230
|
OpSchema()
|
|
256
|
-
.SetDoc(
|
|
231
|
+
.SetDoc(RandomNormal_ver22_doc)
|
|
257
232
|
.Attr("mean", "The mean of the normal distribution.", AttributeProto::FLOAT, 0.0f)
|
|
258
233
|
.Attr("scale", "The standard deviation of the normal distribution.", AttributeProto::FLOAT, 1.0f)
|
|
259
234
|
.Attr(
|
|
@@ -268,16 +243,13 @@ ONNX_OPERATOR_SET_SCHEMA(
|
|
|
268
243
|
static_cast<int64_t>(TensorProto::FLOAT))
|
|
269
244
|
.Attr("shape", "The shape of the output tensor.", AttributeProto::INTS)
|
|
270
245
|
.Output(0, "output", "Output tensor of random values drawn from normal distribution", "T")
|
|
271
|
-
.TypeConstraint(
|
|
272
|
-
"T",
|
|
273
|
-
{"tensor(float16)", "tensor(float)", "tensor(double)"},
|
|
274
|
-
"Constrain output types to float tensors.")
|
|
246
|
+
.TypeConstraint("T", OpSchema::all_float_types_ir4(), "Constrain output types to float tensors.")
|
|
275
247
|
.TypeAndShapeInferenceFunction([](InferenceContext& ctx) {
|
|
276
248
|
propagateElemTypeFromAttributeToOutput(ctx, "dtype", 0, TensorProto::FLOAT);
|
|
277
249
|
propagateShapeFromAttributeToOutput(ctx, "shape", 0);
|
|
278
250
|
}));
|
|
279
251
|
|
|
280
|
-
static const char*
|
|
252
|
+
static const char* RandomUniformLike_ver22_doc = R"DOC(
|
|
281
253
|
Generate a tensor with random values drawn from a uniform distribution.
|
|
282
254
|
The shape of the output tensor is copied from the shape of the input tensor,
|
|
283
255
|
and the parameters of the uniform distribution are specified by `low` and `high`.
|
|
@@ -289,9 +261,9 @@ TensorProto message and be valid as an output type.
|
|
|
289
261
|
|
|
290
262
|
ONNX_OPERATOR_SET_SCHEMA(
|
|
291
263
|
RandomUniformLike,
|
|
292
|
-
|
|
264
|
+
22,
|
|
293
265
|
OpSchema()
|
|
294
|
-
.SetDoc(
|
|
266
|
+
.SetDoc(RandomUniformLike_ver22_doc)
|
|
295
267
|
.Attr("low", "Lower boundary of the output values.", AttributeProto::FLOAT, 0.0f)
|
|
296
268
|
.Attr("high", "Upper boundary of the output values.", AttributeProto::FLOAT, 1.0f)
|
|
297
269
|
.Attr(
|
|
@@ -309,12 +281,9 @@ ONNX_OPERATOR_SET_SCHEMA(
|
|
|
309
281
|
.Output(0, "output", "Output tensor of random values drawn from uniform distribution", "T2")
|
|
310
282
|
.TypeConstraint(
|
|
311
283
|
"T1",
|
|
312
|
-
OpSchema::
|
|
284
|
+
OpSchema::all_tensor_types_ir4(),
|
|
313
285
|
"Constrain to any tensor type. If the dtype attribute is not provided this must be a valid output type.")
|
|
314
|
-
.TypeConstraint(
|
|
315
|
-
"T2",
|
|
316
|
-
{"tensor(float16)", "tensor(float)", "tensor(double)"},
|
|
317
|
-
"Constrain output types to float tensors.")
|
|
286
|
+
.TypeConstraint("T2", OpSchema::all_float_types_ir4(), "Constrain output types to float tensors.")
|
|
318
287
|
.TypeAndShapeInferenceFunction([](InferenceContext& ctx) {
|
|
319
288
|
if (ctx.getAttribute("dtype") != nullptr)
|
|
320
289
|
propagateElemTypeFromAttributeToOutput(ctx, "dtype", 0);
|
|
@@ -326,7 +295,7 @@ ONNX_OPERATOR_SET_SCHEMA(
|
|
|
326
295
|
propagateShapeFromInputToOutput(ctx, 0, 0);
|
|
327
296
|
}));
|
|
328
297
|
|
|
329
|
-
static const char*
|
|
298
|
+
static const char* RandomNormalLike_ver22_doc = R"DOC(
|
|
330
299
|
Generate a tensor with random values drawn from a normal distribution.
|
|
331
300
|
The shape of the output tensor is copied from the shape of the input tensor,
|
|
332
301
|
and the parameters of the normal distribution are specified by `mean` and `scale`.
|
|
@@ -338,9 +307,9 @@ TensorProto message, and be valid as an output type.
|
|
|
338
307
|
|
|
339
308
|
ONNX_OPERATOR_SET_SCHEMA(
|
|
340
309
|
RandomNormalLike,
|
|
341
|
-
|
|
310
|
+
22,
|
|
342
311
|
OpSchema()
|
|
343
|
-
.SetDoc(
|
|
312
|
+
.SetDoc(RandomNormalLike_ver22_doc)
|
|
344
313
|
.Attr("mean", "The mean of the normal distribution.", AttributeProto::FLOAT, 0.0f)
|
|
345
314
|
.Attr("scale", "The standard deviation of the normal distribution.", AttributeProto::FLOAT, 1.0f)
|
|
346
315
|
.Attr(
|
|
@@ -358,12 +327,9 @@ ONNX_OPERATOR_SET_SCHEMA(
|
|
|
358
327
|
.Output(0, "output", "Output tensor of random values drawn from normal distribution", "T2")
|
|
359
328
|
.TypeConstraint(
|
|
360
329
|
"T1",
|
|
361
|
-
OpSchema::
|
|
330
|
+
OpSchema::all_tensor_types_ir4(),
|
|
362
331
|
"Constrain to any tensor type. If the dtype attribute is not provided this must be a valid output type.")
|
|
363
|
-
.TypeConstraint(
|
|
364
|
-
"T2",
|
|
365
|
-
{"tensor(float16)", "tensor(float)", "tensor(double)"},
|
|
366
|
-
"Constrain output types to float tensors.")
|
|
332
|
+
.TypeConstraint("T2", OpSchema::all_float_types_ir4(), "Constrain output types to float tensors.")
|
|
367
333
|
.TypeAndShapeInferenceFunction([](InferenceContext& ctx) {
|
|
368
334
|
if (ctx.getAttribute("dtype") != nullptr)
|
|
369
335
|
propagateElemTypeFromAttributeToOutput(ctx, "dtype", 0);
|
|
@@ -375,16 +341,16 @@ ONNX_OPERATOR_SET_SCHEMA(
|
|
|
375
341
|
propagateShapeFromInputToOutput(ctx, 0, 0);
|
|
376
342
|
}));
|
|
377
343
|
|
|
378
|
-
static const char*
|
|
344
|
+
static const char* Multinomial_ver22_doc = R"DOC(
|
|
379
345
|
Generate a tensor of samples from a multinomial distribution according to the probabilities
|
|
380
346
|
of each of the possible outcomes.
|
|
381
347
|
)DOC";
|
|
382
348
|
|
|
383
349
|
ONNX_OPERATOR_SET_SCHEMA(
|
|
384
350
|
Multinomial,
|
|
385
|
-
|
|
351
|
+
22,
|
|
386
352
|
OpSchema()
|
|
387
|
-
.SetDoc(
|
|
353
|
+
.SetDoc(Multinomial_ver22_doc)
|
|
388
354
|
.Attr("sample_size", "Number of times to sample.", AttributeProto::INT, static_cast<int64_t>(1))
|
|
389
355
|
.Attr(
|
|
390
356
|
"seed",
|
|
@@ -406,10 +372,7 @@ ONNX_OPERATOR_SET_SCHEMA(
|
|
|
406
372
|
"output",
|
|
407
373
|
"Output tensor with shape [batch_size, sample_size], where sample_size is the number of times to sample. Each value along the axis zero represents the outcome of the corresponding sample in a batch.",
|
|
408
374
|
"T2")
|
|
409
|
-
.TypeConstraint(
|
|
410
|
-
"T1",
|
|
411
|
-
{"tensor(float16)", "tensor(float)", "tensor(double)"},
|
|
412
|
-
"Constrain input types to float tensors.")
|
|
375
|
+
.TypeConstraint("T1", OpSchema::all_float_types_ir4(), "Constrain input types to float tensors.")
|
|
413
376
|
.TypeConstraint("T2", {"tensor(int32)", "tensor(int64)"}, "Constrain output types to integral tensors.")
|
|
414
377
|
.TypeAndShapeInferenceFunction([](InferenceContext& ctx) {
|
|
415
378
|
auto dtype = ctx.getAttribute("dtype");
|
|
@@ -562,7 +525,7 @@ ONNX_OPERATOR_SET_SCHEMA(
|
|
|
562
525
|
}
|
|
563
526
|
}));
|
|
564
527
|
|
|
565
|
-
static const char*
|
|
528
|
+
static const char* Bernoulli_ver22_doc = R"DOC(
|
|
566
529
|
Draws binary random numbers (0 or 1) from a Bernoulli distribution. The input tensor should be a tensor
|
|
567
530
|
containing probabilities p (a value in the range [0,1]) to be used for drawing the binary random number,
|
|
568
531
|
where an output of 1 is produced with probability p and an output of 0 is produced with probability (1-p).
|
|
@@ -573,9 +536,9 @@ implementations (even if a seed is specified).
|
|
|
573
536
|
|
|
574
537
|
ONNX_OPERATOR_SET_SCHEMA(
|
|
575
538
|
Bernoulli,
|
|
576
|
-
|
|
539
|
+
22,
|
|
577
540
|
OpSchema()
|
|
578
|
-
.SetDoc(
|
|
541
|
+
.SetDoc(Bernoulli_ver22_doc)
|
|
579
542
|
.Attr(
|
|
580
543
|
"seed",
|
|
581
544
|
"(Optional) Seed to the random generator, if not specified we will auto generate one.",
|
|
@@ -589,25 +552,10 @@ ONNX_OPERATOR_SET_SCHEMA(
|
|
|
589
552
|
OPTIONAL_VALUE)
|
|
590
553
|
.Input(0, "input", "All values in input have to be in the range:[0, 1].", "T1")
|
|
591
554
|
.Output(0, "output", "The returned output tensor only has values 0 or 1, same shape as input tensor.", "T2")
|
|
592
|
-
.TypeConstraint(
|
|
593
|
-
"T1",
|
|
594
|
-
{"tensor(float16)", "tensor(float)", "tensor(double)"},
|
|
595
|
-
"Constrain input types to float tensors.")
|
|
555
|
+
.TypeConstraint("T1", OpSchema::all_float_types_ir4(), "Constrain input types to float tensors.")
|
|
596
556
|
.TypeConstraint(
|
|
597
557
|
"T2",
|
|
598
|
-
|
|
599
|
-
"tensor(float)",
|
|
600
|
-
"tensor(double)",
|
|
601
|
-
"tensor(bfloat16)",
|
|
602
|
-
"tensor(uint8)",
|
|
603
|
-
"tensor(uint16)",
|
|
604
|
-
"tensor(uint32)",
|
|
605
|
-
"tensor(uint64)",
|
|
606
|
-
"tensor(int8)",
|
|
607
|
-
"tensor(int16)",
|
|
608
|
-
"tensor(int32)",
|
|
609
|
-
"tensor(int64)",
|
|
610
|
-
"tensor(bool)"},
|
|
558
|
+
OpSchema::all_non_complex_numeric_types_plus_bool_ir4(),
|
|
611
559
|
"Constrain output types to all numeric tensors and bool tensors.")
|
|
612
560
|
.TypeAndShapeInferenceFunction([](ONNX_NAMESPACE::InferenceContext& ctx) {
|
|
613
561
|
if (ctx.getAttribute("dtype") != nullptr)
|
onnx/defs/generator/old.cc
CHANGED
|
@@ -5,11 +5,400 @@
|
|
|
5
5
|
#include <algorithm>
|
|
6
6
|
#include <functional>
|
|
7
7
|
|
|
8
|
+
#include "onnx/defs/function.h"
|
|
8
9
|
#include "onnx/defs/generator/utils.h"
|
|
9
10
|
#include "onnx/defs/schema.h"
|
|
10
11
|
|
|
11
12
|
namespace ONNX_NAMESPACE {
|
|
12
13
|
|
|
14
|
+
static const char* Bernoulli_ver15_doc = R"DOC(
|
|
15
|
+
Draws binary random numbers (0 or 1) from a Bernoulli distribution. The input tensor should be a tensor
|
|
16
|
+
containing probabilities p (a value in the range [0,1]) to be used for drawing the binary random number,
|
|
17
|
+
where an output of 1 is produced with probability p and an output of 0 is produced with probability (1-p).
|
|
18
|
+
|
|
19
|
+
This operator is non-deterministic and may not produce the same values in different
|
|
20
|
+
implementations (even if a seed is specified).
|
|
21
|
+
)DOC";
|
|
22
|
+
|
|
23
|
+
ONNX_OPERATOR_SET_SCHEMA(
|
|
24
|
+
Bernoulli,
|
|
25
|
+
15,
|
|
26
|
+
OpSchema()
|
|
27
|
+
.SetDoc(Bernoulli_ver15_doc)
|
|
28
|
+
.Attr(
|
|
29
|
+
"seed",
|
|
30
|
+
"(Optional) Seed to the random generator, if not specified we will auto generate one.",
|
|
31
|
+
AttributeProto::FLOAT,
|
|
32
|
+
OPTIONAL_VALUE)
|
|
33
|
+
.Attr(
|
|
34
|
+
"dtype",
|
|
35
|
+
"The data type for the elements of the output tensor. if not specified, we will use "
|
|
36
|
+
"the data type of the input tensor.",
|
|
37
|
+
AttributeProto::INT,
|
|
38
|
+
OPTIONAL_VALUE)
|
|
39
|
+
.Input(0, "input", "All values in input have to be in the range:[0, 1].", "T1")
|
|
40
|
+
.Output(0, "output", "The returned output tensor only has values 0 or 1, same shape as input tensor.", "T2")
|
|
41
|
+
.TypeConstraint(
|
|
42
|
+
"T1",
|
|
43
|
+
{"tensor(float16)", "tensor(float)", "tensor(double)"},
|
|
44
|
+
"Constrain input types to float tensors.")
|
|
45
|
+
.TypeConstraint(
|
|
46
|
+
"T2",
|
|
47
|
+
{"tensor(float16)",
|
|
48
|
+
"tensor(float)",
|
|
49
|
+
"tensor(double)",
|
|
50
|
+
"tensor(bfloat16)",
|
|
51
|
+
"tensor(uint8)",
|
|
52
|
+
"tensor(uint16)",
|
|
53
|
+
"tensor(uint32)",
|
|
54
|
+
"tensor(uint64)",
|
|
55
|
+
"tensor(int8)",
|
|
56
|
+
"tensor(int16)",
|
|
57
|
+
"tensor(int32)",
|
|
58
|
+
"tensor(int64)",
|
|
59
|
+
"tensor(bool)"},
|
|
60
|
+
"Constrain output types to all numeric tensors and bool tensors.")
|
|
61
|
+
.TypeAndShapeInferenceFunction([](ONNX_NAMESPACE::InferenceContext& ctx) {
|
|
62
|
+
if (ctx.getAttribute("dtype") != nullptr)
|
|
63
|
+
propagateElemTypeFromAttributeToOutput(ctx, "dtype", 0);
|
|
64
|
+
else
|
|
65
|
+
propagateElemTypeFromInputToOutput(ctx, 0, 0);
|
|
66
|
+
if (!hasNInputShapes(ctx, 1)) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
propagateShapeFromInputToOutput(ctx, 0, 0);
|
|
70
|
+
})
|
|
71
|
+
.SetContextDependentFunctionBodyBuilder(
|
|
72
|
+
[](const FunctionBodyBuildContext& ctx, const OpSchema& schema, FunctionProto& functionProto) -> bool {
|
|
73
|
+
if (ctx.getInputType(0) == nullptr) {
|
|
74
|
+
// we cannot create a correct function body without knowing the input type
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
auto input_type = ctx.getInputType(0)->tensor_type().elem_type();
|
|
78
|
+
auto dtype = ctx.getAttribute("dtype") != nullptr
|
|
79
|
+
? static_cast<TensorProto_DataType>(ctx.getAttribute("dtype")->i())
|
|
80
|
+
: input_type;
|
|
81
|
+
FunctionBuilder builder(functionProto);
|
|
82
|
+
builder
|
|
83
|
+
.Add(
|
|
84
|
+
"X_random = RandomUniformLike <low = 0.0, high = 1.0, seed = @seed> (input)",
|
|
85
|
+
"dtype",
|
|
86
|
+
int64_t(input_type))
|
|
87
|
+
.Add("X_greater = Greater (X_random, input)")
|
|
88
|
+
.Add("output = Cast (X_greater)", "to", int64_t(dtype));
|
|
89
|
+
schema.BuildFunction(functionProto);
|
|
90
|
+
return true;
|
|
91
|
+
}));
|
|
92
|
+
|
|
93
|
+
static const char* Multinomial_ver7_doc = R"DOC(
|
|
94
|
+
Generate a tensor of samples from a multinomial distribution according to the probabilities
|
|
95
|
+
of each of the possible outcomes.
|
|
96
|
+
)DOC";
|
|
97
|
+
|
|
98
|
+
ONNX_OPERATOR_SET_SCHEMA(
|
|
99
|
+
Multinomial,
|
|
100
|
+
7,
|
|
101
|
+
OpSchema()
|
|
102
|
+
.SetDoc(Multinomial_ver7_doc)
|
|
103
|
+
.Attr("sample_size", "Number of times to sample.", AttributeProto::INT, static_cast<int64_t>(1))
|
|
104
|
+
.Attr(
|
|
105
|
+
"seed",
|
|
106
|
+
"(Optional) Seed to the random generator, if not specified we will auto generate one.",
|
|
107
|
+
AttributeProto::FLOAT,
|
|
108
|
+
OPTIONAL_VALUE)
|
|
109
|
+
.Attr(
|
|
110
|
+
"dtype",
|
|
111
|
+
"(Optional) The data type for the elements of the output tensor, if not specified, we will use int32.",
|
|
112
|
+
AttributeProto::INT,
|
|
113
|
+
static_cast<int64_t>(TensorProto::INT32))
|
|
114
|
+
.Input(
|
|
115
|
+
0,
|
|
116
|
+
"input",
|
|
117
|
+
"Input tensor with shape [batch_size, class_size], where class_size is the number of all possible outcomes. Each value along the axis zero represents the unnormalized log-probability of each corresponding outcome in a batch.",
|
|
118
|
+
"T1")
|
|
119
|
+
.Output(
|
|
120
|
+
0,
|
|
121
|
+
"output",
|
|
122
|
+
"Output tensor with shape [batch_size, sample_size], where sample_size is the number of times to sample. Each value along the axis zero represents the outcome of the corresponding sample in a batch.",
|
|
123
|
+
"T2")
|
|
124
|
+
.TypeConstraint(
|
|
125
|
+
"T1",
|
|
126
|
+
{"tensor(float16)", "tensor(float)", "tensor(double)"},
|
|
127
|
+
"Constrain input types to float tensors.")
|
|
128
|
+
.TypeConstraint("T2", {"tensor(int32)", "tensor(int64)"}, "Constrain output types to integral tensors.")
|
|
129
|
+
.TypeAndShapeInferenceFunction([](InferenceContext& ctx) {
|
|
130
|
+
auto dtype = ctx.getAttribute("dtype");
|
|
131
|
+
auto dataType = TensorProto_DataType::TensorProto_DataType_INT32;
|
|
132
|
+
if (dtype != nullptr) {
|
|
133
|
+
dataType = static_cast<TensorProto_DataType>(dtype->i());
|
|
134
|
+
if (dataType != TensorProto_DataType::TensorProto_DataType_INT32 &&
|
|
135
|
+
dataType != TensorProto_DataType::TensorProto_DataType_INT64) {
|
|
136
|
+
fail_type_inference("Output type must be int32 or int64");
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
updateOutputElemType(ctx, 0, dataType);
|
|
140
|
+
|
|
141
|
+
TensorShapeProto::Dimension batch_size, sample_size;
|
|
142
|
+
if (hasInputShape(ctx, 0)) {
|
|
143
|
+
auto& input_shape = getInputShape(ctx, 0);
|
|
144
|
+
if (input_shape.dim_size() != 2) {
|
|
145
|
+
fail_shape_inference("Input tensor must have rank 2");
|
|
146
|
+
}
|
|
147
|
+
batch_size = input_shape.dim(0);
|
|
148
|
+
} // else statically-unknown batch-size
|
|
149
|
+
sample_size.set_dim_value(getAttribute(ctx, "sample_size", 1));
|
|
150
|
+
updateOutputShape(ctx, 0, {batch_size, sample_size});
|
|
151
|
+
}));
|
|
152
|
+
|
|
153
|
+
static const char* RandomNormalLike_ver1_doc = R"DOC(
|
|
154
|
+
Generate a tensor with random values drawn from a normal distribution.
|
|
155
|
+
The shape of the output tensor is copied from the shape of the input tensor,
|
|
156
|
+
and the parameters of the normal distribution are specified by `mean` and `scale`.
|
|
157
|
+
|
|
158
|
+
The data type is specified by the 'dtype' argument, or copied from the input tensor if not provided.
|
|
159
|
+
The 'dtype' argument must be one of the data types specified in the 'DataType' enum field in the
|
|
160
|
+
TensorProto message, and be valid as an output type.
|
|
161
|
+
)DOC";
|
|
162
|
+
|
|
163
|
+
ONNX_OPERATOR_SET_SCHEMA(
|
|
164
|
+
RandomNormalLike,
|
|
165
|
+
1,
|
|
166
|
+
OpSchema()
|
|
167
|
+
.SetDoc(RandomNormalLike_ver1_doc)
|
|
168
|
+
.Attr("mean", "The mean of the normal distribution.", AttributeProto::FLOAT, 0.0f)
|
|
169
|
+
.Attr("scale", "The standard deviation of the normal distribution.", AttributeProto::FLOAT, 1.0f)
|
|
170
|
+
.Attr(
|
|
171
|
+
"seed",
|
|
172
|
+
"(Optional) Seed to the random generator, if not specified we will auto generate one.",
|
|
173
|
+
AttributeProto::FLOAT,
|
|
174
|
+
OPTIONAL_VALUE)
|
|
175
|
+
.Attr(
|
|
176
|
+
"dtype",
|
|
177
|
+
"(Optional) The data type for the elements of the output tensor, if not specified, we will use "
|
|
178
|
+
"the data type of the input tensor.",
|
|
179
|
+
AttributeProto::INT,
|
|
180
|
+
OPTIONAL_VALUE)
|
|
181
|
+
.Input(0, "input", "Input tensor to copy shape and optionally type information from.", "T1")
|
|
182
|
+
.Output(0, "output", "Output tensor of random values drawn from normal distribution", "T2")
|
|
183
|
+
.TypeConstraint(
|
|
184
|
+
"T1",
|
|
185
|
+
OpSchema::all_tensor_types(),
|
|
186
|
+
"Constrain to any tensor type. If the dtype attribute is not provided this must be a valid output type.")
|
|
187
|
+
.TypeConstraint(
|
|
188
|
+
"T2",
|
|
189
|
+
{"tensor(float16)", "tensor(float)", "tensor(double)"},
|
|
190
|
+
"Constrain output types to float tensors.")
|
|
191
|
+
.TypeAndShapeInferenceFunction([](InferenceContext& ctx) {
|
|
192
|
+
if (ctx.getAttribute("dtype") != nullptr)
|
|
193
|
+
propagateElemTypeFromAttributeToOutput(ctx, "dtype", 0);
|
|
194
|
+
else
|
|
195
|
+
propagateElemTypeFromInputToOutput(ctx, 0, 0);
|
|
196
|
+
if (!hasNInputShapes(ctx, 1)) {
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
propagateShapeFromInputToOutput(ctx, 0, 0);
|
|
200
|
+
}));
|
|
201
|
+
|
|
202
|
+
static const char* RandomUniformLike_ver1_doc = R"DOC(
|
|
203
|
+
Generate a tensor with random values drawn from a uniform distribution.
|
|
204
|
+
The shape of the output tensor is copied from the shape of the input tensor,
|
|
205
|
+
and the parameters of the uniform distribution are specified by `low` and `high`.
|
|
206
|
+
|
|
207
|
+
The data type is specified by the 'dtype' argument, or copied from the input tensor if not provided.
|
|
208
|
+
The 'dtype' argument must be one of the data types specified in the 'DataType' enum field in the
|
|
209
|
+
TensorProto message and be valid as an output type.
|
|
210
|
+
)DOC";
|
|
211
|
+
|
|
212
|
+
ONNX_OPERATOR_SET_SCHEMA(
|
|
213
|
+
RandomUniformLike,
|
|
214
|
+
1,
|
|
215
|
+
OpSchema()
|
|
216
|
+
.SetDoc(RandomUniformLike_ver1_doc)
|
|
217
|
+
.Attr("low", "Lower boundary of the output values.", AttributeProto::FLOAT, 0.0f)
|
|
218
|
+
.Attr("high", "Upper boundary of the output values.", AttributeProto::FLOAT, 1.0f)
|
|
219
|
+
.Attr(
|
|
220
|
+
"seed",
|
|
221
|
+
"(Optional) Seed to the random generator, if not specified we will auto generate one.",
|
|
222
|
+
AttributeProto::FLOAT,
|
|
223
|
+
OPTIONAL_VALUE)
|
|
224
|
+
.Attr(
|
|
225
|
+
"dtype",
|
|
226
|
+
"(Optional) The data type for the elements of the output tensor, if not specified, we will use "
|
|
227
|
+
"the data type of the input tensor.",
|
|
228
|
+
AttributeProto::INT,
|
|
229
|
+
OPTIONAL_VALUE)
|
|
230
|
+
.Input(0, "input", "Input tensor to copy shape and optionally type information from.", "T1")
|
|
231
|
+
.Output(0, "output", "Output tensor of random values drawn from uniform distribution", "T2")
|
|
232
|
+
.TypeConstraint(
|
|
233
|
+
"T1",
|
|
234
|
+
OpSchema::all_tensor_types(),
|
|
235
|
+
"Constrain to any tensor type. If the dtype attribute is not provided this must be a valid output type.")
|
|
236
|
+
.TypeConstraint(
|
|
237
|
+
"T2",
|
|
238
|
+
{"tensor(float16)", "tensor(float)", "tensor(double)"},
|
|
239
|
+
"Constrain output types to float tensors.")
|
|
240
|
+
.TypeAndShapeInferenceFunction([](InferenceContext& ctx) {
|
|
241
|
+
if (ctx.getAttribute("dtype") != nullptr)
|
|
242
|
+
propagateElemTypeFromAttributeToOutput(ctx, "dtype", 0);
|
|
243
|
+
else
|
|
244
|
+
propagateElemTypeFromInputToOutput(ctx, 0, 0);
|
|
245
|
+
if (!hasNInputShapes(ctx, 1)) {
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
propagateShapeFromInputToOutput(ctx, 0, 0);
|
|
249
|
+
}));
|
|
250
|
+
|
|
251
|
+
static const char* RandomNormal_ver1_doc = R"DOC(
|
|
252
|
+
Generate a tensor with random values drawn from a normal distribution. The shape
|
|
253
|
+
of the tensor is specified by the `shape` argument and the parameter of the normal distribution
|
|
254
|
+
specified by `mean` and `scale`.
|
|
255
|
+
|
|
256
|
+
The data type is specified by the 'dtype' argument. The 'dtype' argument must
|
|
257
|
+
be one of the data types specified in the 'DataType' enum field in the
|
|
258
|
+
TensorProto message.
|
|
259
|
+
)DOC";
|
|
260
|
+
|
|
261
|
+
ONNX_OPERATOR_SET_SCHEMA(
|
|
262
|
+
RandomNormal,
|
|
263
|
+
1,
|
|
264
|
+
OpSchema()
|
|
265
|
+
.SetDoc(RandomNormal_ver1_doc)
|
|
266
|
+
.Attr("mean", "The mean of the normal distribution.", AttributeProto::FLOAT, 0.0f)
|
|
267
|
+
.Attr("scale", "The standard deviation of the normal distribution.", AttributeProto::FLOAT, 1.0f)
|
|
268
|
+
.Attr(
|
|
269
|
+
"seed",
|
|
270
|
+
"(Optional) Seed to the random generator, if not specified we will auto generate one.",
|
|
271
|
+
AttributeProto::FLOAT,
|
|
272
|
+
OPTIONAL_VALUE)
|
|
273
|
+
.Attr(
|
|
274
|
+
"dtype",
|
|
275
|
+
"The data type for the elements of the output tensor. Default is TensorProto::FLOAT.",
|
|
276
|
+
AttributeProto::INT,
|
|
277
|
+
static_cast<int64_t>(TensorProto::FLOAT))
|
|
278
|
+
.Attr("shape", "The shape of the output tensor.", AttributeProto::INTS)
|
|
279
|
+
.Output(0, "output", "Output tensor of random values drawn from normal distribution", "T")
|
|
280
|
+
.TypeConstraint(
|
|
281
|
+
"T",
|
|
282
|
+
{"tensor(float16)", "tensor(float)", "tensor(double)"},
|
|
283
|
+
"Constrain output types to float tensors.")
|
|
284
|
+
.TypeAndShapeInferenceFunction([](InferenceContext& ctx) {
|
|
285
|
+
propagateElemTypeFromAttributeToOutput(ctx, "dtype", 0, TensorProto::FLOAT);
|
|
286
|
+
propagateShapeFromAttributeToOutput(ctx, "shape", 0);
|
|
287
|
+
}));
|
|
288
|
+
|
|
289
|
+
static const char* RandomUniform_ver1_doc = R"DOC(
|
|
290
|
+
Generate a tensor with random values drawn from a uniform distribution. The shape
|
|
291
|
+
of the tensor is specified by the `shape` argument and the range by `low` and `high`.
|
|
292
|
+
|
|
293
|
+
The data type is specified by the 'dtype' argument. The 'dtype' argument must
|
|
294
|
+
be one of the data types specified in the 'DataType' enum field in the
|
|
295
|
+
TensorProto message.
|
|
296
|
+
)DOC";
|
|
297
|
+
|
|
298
|
+
ONNX_OPERATOR_SET_SCHEMA(
|
|
299
|
+
RandomUniform,
|
|
300
|
+
1,
|
|
301
|
+
OpSchema()
|
|
302
|
+
.SetDoc(RandomUniform_ver1_doc)
|
|
303
|
+
.Attr("low", "Lower boundary of the output values.", AttributeProto::FLOAT, 0.0f)
|
|
304
|
+
.Attr("high", "Upper boundary of the output values.", AttributeProto::FLOAT, 1.0f)
|
|
305
|
+
.Attr(
|
|
306
|
+
"seed",
|
|
307
|
+
"(Optional) Seed to the random generator, if not specified we will auto generate one.",
|
|
308
|
+
AttributeProto::FLOAT,
|
|
309
|
+
OPTIONAL_VALUE)
|
|
310
|
+
.Attr(
|
|
311
|
+
"dtype",
|
|
312
|
+
"The data type for the elements of the output tensor. If not specified, default is TensorProto::FLOAT.",
|
|
313
|
+
AttributeProto::INT,
|
|
314
|
+
static_cast<int64_t>(TensorProto::FLOAT))
|
|
315
|
+
.Attr("shape", "The shape of the output tensor.", AttributeProto::INTS)
|
|
316
|
+
.Output(0, "output", "Output tensor of random values drawn from uniform distribution", "T")
|
|
317
|
+
.TypeConstraint(
|
|
318
|
+
"T",
|
|
319
|
+
{"tensor(float16)", "tensor(float)", "tensor(double)"},
|
|
320
|
+
"Constrain output types to float tensors.")
|
|
321
|
+
.TypeAndShapeInferenceFunction([](InferenceContext& ctx) {
|
|
322
|
+
propagateElemTypeFromAttributeToOutput(ctx, "dtype", 0, TensorProto::FLOAT);
|
|
323
|
+
propagateShapeFromAttributeToOutput(ctx, "shape", 0);
|
|
324
|
+
}));
|
|
325
|
+
|
|
326
|
+
static const char* EyeLike_ver9_doc = R"DOC(
|
|
327
|
+
Generate a 2D tensor (matrix) with ones on the diagonal and zeros everywhere else. Only 2D
|
|
328
|
+
tensors are supported, i.e. input T1 must be of rank 2. The shape of the output tensor is the
|
|
329
|
+
same as the input tensor. The data type can be specified by the 'dtype' argument. If
|
|
330
|
+
'dtype' is not specified, then the type of input tensor is used. By default, the main diagonal
|
|
331
|
+
is populated with ones, but attribute 'k' can be used to populate upper or lower diagonals.
|
|
332
|
+
The 'dtype' argument must be one of the data types specified in the 'DataType' enum field in the
|
|
333
|
+
TensorProto message and be valid as an output type.
|
|
334
|
+
)DOC";
|
|
335
|
+
|
|
336
|
+
ONNX_OPERATOR_SET_SCHEMA(
|
|
337
|
+
EyeLike,
|
|
338
|
+
9,
|
|
339
|
+
OpSchema()
|
|
340
|
+
.SetDoc(EyeLike_ver9_doc)
|
|
341
|
+
.Attr(
|
|
342
|
+
"k",
|
|
343
|
+
"(Optional) Index of the diagonal to be populated with ones. Default is 0."
|
|
344
|
+
" If T2 is the output, this op sets T2[i, i+k] = 1. k = 0 populates the main diagonal, "
|
|
345
|
+
"k > 0 populates an upper diagonal, and k < 0 populates a lower diagonal.",
|
|
346
|
+
AttributeProto::INT,
|
|
347
|
+
static_cast<int64_t>(0))
|
|
348
|
+
.Attr(
|
|
349
|
+
"dtype",
|
|
350
|
+
"(Optional) The data type for the elements of the output tensor. If not specified,"
|
|
351
|
+
"the data type of the input tensor T1 is used. If input tensor T1 is also not"
|
|
352
|
+
"specified, then type defaults to 'float'.",
|
|
353
|
+
AttributeProto::INT,
|
|
354
|
+
OPTIONAL_VALUE)
|
|
355
|
+
.Input(0, "input", "2D input tensor to copy shape, and optionally, type information from.", "T1")
|
|
356
|
+
.Output(0, "output", "Output tensor, same shape as input tensor T1.", "T2")
|
|
357
|
+
.TypeConstraint(
|
|
358
|
+
"T1",
|
|
359
|
+
{"tensor(float16)",
|
|
360
|
+
"tensor(float)",
|
|
361
|
+
"tensor(double)",
|
|
362
|
+
"tensor(int8)",
|
|
363
|
+
"tensor(int16)",
|
|
364
|
+
"tensor(int32)",
|
|
365
|
+
"tensor(int64)",
|
|
366
|
+
"tensor(uint8)",
|
|
367
|
+
"tensor(uint16)",
|
|
368
|
+
"tensor(uint32)",
|
|
369
|
+
"tensor(uint64)",
|
|
370
|
+
"tensor(bool)"},
|
|
371
|
+
"Constrain input types. Strings and complex are not supported.")
|
|
372
|
+
.TypeConstraint(
|
|
373
|
+
"T2",
|
|
374
|
+
{"tensor(float16)",
|
|
375
|
+
"tensor(float)",
|
|
376
|
+
"tensor(double)",
|
|
377
|
+
"tensor(int8)",
|
|
378
|
+
"tensor(int16)",
|
|
379
|
+
"tensor(int32)",
|
|
380
|
+
"tensor(int64)",
|
|
381
|
+
"tensor(uint8)",
|
|
382
|
+
"tensor(uint16)",
|
|
383
|
+
"tensor(uint32)",
|
|
384
|
+
"tensor(uint64)",
|
|
385
|
+
"tensor(bool)"},
|
|
386
|
+
"Constrain output types. Strings and complex are not supported.")
|
|
387
|
+
.TypeAndShapeInferenceFunction([](InferenceContext& ctx) {
|
|
388
|
+
if (ctx.getAttribute("dtype") != nullptr) {
|
|
389
|
+
propagateElemTypeFromAttributeToOutput(ctx, "dtype", 0);
|
|
390
|
+
} else {
|
|
391
|
+
propagateElemTypeFromInputToOutput(ctx, 0, 0);
|
|
392
|
+
}
|
|
393
|
+
if (hasInputShape(ctx, 0)) {
|
|
394
|
+
auto& input_shape = getInputShape(ctx, 0);
|
|
395
|
+
if (input_shape.dim_size() != 2) {
|
|
396
|
+
fail_shape_inference("Input tensor must be 2-dimensional");
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
propagateShapeFromInputToOutput(ctx, 0, 0);
|
|
400
|
+
}));
|
|
401
|
+
|
|
13
402
|
static const char* Constant_ver19_doc = R"DOC(
|
|
14
403
|
This operator produces a constant tensor. Exactly one of the provided attributes, either value, sparse_value,
|
|
15
404
|
or value_* must be specified.
|