onnx 1.16.2__cp311-cp311-win32.whl → 1.17.0__cp311-cp311-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.

Files changed (843) hide show
  1. onnx/__init__.py +3 -1
  2. onnx/_custom_element_types.py +63 -0
  3. onnx/backend/base.py +17 -15
  4. onnx/backend/sample/ops/__init__.py +4 -4
  5. onnx/backend/sample/ops/abs.py +1 -0
  6. onnx/backend/test/__init__.py +1 -0
  7. onnx/backend/test/case/__init__.py +2 -2
  8. onnx/backend/test/case/base.py +6 -5
  9. onnx/backend/test/case/model/__init__.py +4 -3
  10. onnx/backend/test/case/model/expand.py +1 -0
  11. onnx/backend/test/case/model/gradient.py +1 -0
  12. onnx/backend/test/case/model/sequence.py +3 -1
  13. onnx/backend/test/case/model/shrink.py +1 -0
  14. onnx/backend/test/case/model/sign.py +1 -0
  15. onnx/backend/test/case/model/single-relu.py +1 -0
  16. onnx/backend/test/case/model/stringnormalizer.py +1 -1
  17. onnx/backend/test/case/node/__init__.py +31 -22
  18. onnx/backend/test/case/node/_image_decoder_data.py +1 -0
  19. onnx/backend/test/case/node/abs.py +1 -0
  20. onnx/backend/test/case/node/acos.py +1 -0
  21. onnx/backend/test/case/node/acosh.py +1 -0
  22. onnx/backend/test/case/node/adagrad.py +2 -1
  23. onnx/backend/test/case/node/adam.py +4 -1
  24. onnx/backend/test/case/node/add.py +1 -0
  25. onnx/backend/test/case/node/affinegrid.py +1 -0
  26. onnx/backend/test/case/node/ai_onnx_ml/array_feature_extractor.py +1 -0
  27. onnx/backend/test/case/node/ai_onnx_ml/binarizer.py +1 -0
  28. onnx/backend/test/case/node/ai_onnx_ml/label_encoder.py +1 -0
  29. onnx/backend/test/case/node/ai_onnx_ml/tree_ensemble.py +1 -0
  30. onnx/backend/test/case/node/and.py +1 -0
  31. onnx/backend/test/case/node/argmax.py +1 -0
  32. onnx/backend/test/case/node/argmin.py +1 -0
  33. onnx/backend/test/case/node/asin.py +1 -0
  34. onnx/backend/test/case/node/asinh.py +1 -0
  35. onnx/backend/test/case/node/atan.py +1 -0
  36. onnx/backend/test/case/node/atanh.py +1 -0
  37. onnx/backend/test/case/node/averagepool.py +1 -0
  38. onnx/backend/test/case/node/batchnorm.py +1 -0
  39. onnx/backend/test/case/node/bernoulli.py +1 -0
  40. onnx/backend/test/case/node/bitshift.py +1 -0
  41. onnx/backend/test/case/node/bitwiseand.py +1 -0
  42. onnx/backend/test/case/node/bitwisenot.py +1 -0
  43. onnx/backend/test/case/node/bitwiseor.py +1 -0
  44. onnx/backend/test/case/node/bitwisexor.py +1 -0
  45. onnx/backend/test/case/node/blackmanwindow.py +13 -3
  46. onnx/backend/test/case/node/cast.py +2 -1
  47. onnx/backend/test/case/node/castlike.py +1 -0
  48. onnx/backend/test/case/node/ceil.py +1 -0
  49. onnx/backend/test/case/node/celu.py +1 -0
  50. onnx/backend/test/case/node/center_crop_pad.py +1 -0
  51. onnx/backend/test/case/node/clip.py +1 -0
  52. onnx/backend/test/case/node/col2im.py +1 -1
  53. onnx/backend/test/case/node/compress.py +1 -0
  54. onnx/backend/test/case/node/concat.py +3 -2
  55. onnx/backend/test/case/node/constant.py +1 -0
  56. onnx/backend/test/case/node/constantofshape.py +1 -0
  57. onnx/backend/test/case/node/conv.py +1 -0
  58. onnx/backend/test/case/node/convinteger.py +1 -0
  59. onnx/backend/test/case/node/convtranspose.py +135 -0
  60. onnx/backend/test/case/node/cos.py +1 -0
  61. onnx/backend/test/case/node/cosh.py +1 -0
  62. onnx/backend/test/case/node/cumsum.py +1 -0
  63. onnx/backend/test/case/node/deformconv.py +17 -26
  64. onnx/backend/test/case/node/depthtospace.py +1 -0
  65. onnx/backend/test/case/node/dequantizelinear.py +1 -0
  66. onnx/backend/test/case/node/det.py +1 -0
  67. onnx/backend/test/case/node/dft.py +1 -0
  68. onnx/backend/test/case/node/div.py +1 -0
  69. onnx/backend/test/case/node/dropout.py +1 -0
  70. onnx/backend/test/case/node/dynamicquantizelinear.py +1 -0
  71. onnx/backend/test/case/node/einsum.py +2 -3
  72. onnx/backend/test/case/node/elu.py +1 -0
  73. onnx/backend/test/case/node/equal.py +1 -0
  74. onnx/backend/test/case/node/erf.py +1 -0
  75. onnx/backend/test/case/node/exp.py +1 -0
  76. onnx/backend/test/case/node/expand.py +1 -0
  77. onnx/backend/test/case/node/eyelike.py +1 -0
  78. onnx/backend/test/case/node/flatten.py +1 -0
  79. onnx/backend/test/case/node/floor.py +1 -0
  80. onnx/backend/test/case/node/gather.py +1 -0
  81. onnx/backend/test/case/node/gatherelements.py +1 -0
  82. onnx/backend/test/case/node/gathernd.py +1 -0
  83. onnx/backend/test/case/node/gelu.py +1 -0
  84. onnx/backend/test/case/node/gemm.py +3 -4
  85. onnx/backend/test/case/node/globalaveragepool.py +1 -0
  86. onnx/backend/test/case/node/globalmaxpool.py +1 -0
  87. onnx/backend/test/case/node/greater.py +1 -0
  88. onnx/backend/test/case/node/greater_equal.py +1 -0
  89. onnx/backend/test/case/node/gridsample.py +1 -0
  90. onnx/backend/test/case/node/groupnormalization.py +1 -0
  91. onnx/backend/test/case/node/gru.py +3 -2
  92. onnx/backend/test/case/node/hammingwindow.py +13 -2
  93. onnx/backend/test/case/node/hannwindow.py +10 -2
  94. onnx/backend/test/case/node/hardmax.py +1 -0
  95. onnx/backend/test/case/node/hardsigmoid.py +1 -0
  96. onnx/backend/test/case/node/hardswish.py +1 -0
  97. onnx/backend/test/case/node/identity.py +1 -0
  98. onnx/backend/test/case/node/if.py +1 -0
  99. onnx/backend/test/case/node/instancenorm.py +1 -0
  100. onnx/backend/test/case/node/isinf.py +1 -0
  101. onnx/backend/test/case/node/isnan.py +1 -0
  102. onnx/backend/test/case/node/layernormalization.py +1 -0
  103. onnx/backend/test/case/node/leakyrelu.py +1 -0
  104. onnx/backend/test/case/node/less.py +1 -0
  105. onnx/backend/test/case/node/less_equal.py +1 -0
  106. onnx/backend/test/case/node/log.py +1 -0
  107. onnx/backend/test/case/node/logsoftmax.py +1 -0
  108. onnx/backend/test/case/node/loop.py +4 -3
  109. onnx/backend/test/case/node/lppool.py +1 -0
  110. onnx/backend/test/case/node/lrn.py +1 -0
  111. onnx/backend/test/case/node/lstm.py +3 -2
  112. onnx/backend/test/case/node/matmul.py +1 -0
  113. onnx/backend/test/case/node/matmulinteger.py +1 -0
  114. onnx/backend/test/case/node/max.py +1 -0
  115. onnx/backend/test/case/node/maxpool.py +1 -0
  116. onnx/backend/test/case/node/maxunpool.py +1 -0
  117. onnx/backend/test/case/node/mean.py +1 -0
  118. onnx/backend/test/case/node/meanvariancenormalization.py +1 -0
  119. onnx/backend/test/case/node/melweightmatrix.py +1 -0
  120. onnx/backend/test/case/node/min.py +1 -0
  121. onnx/backend/test/case/node/mish.py +1 -0
  122. onnx/backend/test/case/node/mod.py +1 -0
  123. onnx/backend/test/case/node/momentum.py +1 -0
  124. onnx/backend/test/case/node/mul.py +1 -0
  125. onnx/backend/test/case/node/neg.py +1 -0
  126. onnx/backend/test/case/node/negativeloglikelihoodloss.py +4 -1
  127. onnx/backend/test/case/node/nonmaxsuppression.py +1 -0
  128. onnx/backend/test/case/node/nonzero.py +1 -0
  129. onnx/backend/test/case/node/not.py +1 -0
  130. onnx/backend/test/case/node/onehot.py +1 -0
  131. onnx/backend/test/case/node/optionalgetelement.py +3 -2
  132. onnx/backend/test/case/node/optionalhaselement.py +2 -3
  133. onnx/backend/test/case/node/or.py +1 -0
  134. onnx/backend/test/case/node/pad.py +2 -1
  135. onnx/backend/test/case/node/pow.py +1 -0
  136. onnx/backend/test/case/node/prelu.py +1 -0
  137. onnx/backend/test/case/node/qlinearconv.py +1 -0
  138. onnx/backend/test/case/node/qlinearmatmul.py +1 -0
  139. onnx/backend/test/case/node/quantizelinear.py +1 -0
  140. onnx/backend/test/case/node/rangeop.py +1 -0
  141. onnx/backend/test/case/node/reciprocal.py +1 -0
  142. onnx/backend/test/case/node/reduce_log_sum.py +1 -0
  143. onnx/backend/test/case/node/reduce_log_sum_exp.py +1 -0
  144. onnx/backend/test/case/node/reducel1.py +1 -0
  145. onnx/backend/test/case/node/reducel2.py +1 -0
  146. onnx/backend/test/case/node/reducemax.py +2 -1
  147. onnx/backend/test/case/node/reducemean.py +1 -0
  148. onnx/backend/test/case/node/reducemin.py +1 -0
  149. onnx/backend/test/case/node/reduceprod.py +1 -0
  150. onnx/backend/test/case/node/reducesum.py +2 -1
  151. onnx/backend/test/case/node/reducesumsquare.py +1 -0
  152. onnx/backend/test/case/node/regex_full_match.py +1 -0
  153. onnx/backend/test/case/node/relu.py +1 -0
  154. onnx/backend/test/case/node/reshape.py +1 -0
  155. onnx/backend/test/case/node/resize.py +3 -2
  156. onnx/backend/test/case/node/reversesequence.py +1 -0
  157. onnx/backend/test/case/node/rnn.py +3 -2
  158. onnx/backend/test/case/node/roialign.py +1 -0
  159. onnx/backend/test/case/node/round.py +4 -3
  160. onnx/backend/test/case/node/scan.py +1 -0
  161. onnx/backend/test/case/node/scatter.py +1 -0
  162. onnx/backend/test/case/node/scatterelements.py +7 -3
  163. onnx/backend/test/case/node/scatternd.py +1 -0
  164. onnx/backend/test/case/node/selu.py +1 -0
  165. onnx/backend/test/case/node/sequence_map.py +1 -0
  166. onnx/backend/test/case/node/sequenceinsert.py +4 -3
  167. onnx/backend/test/case/node/shape.py +1 -0
  168. onnx/backend/test/case/node/shrink.py +1 -0
  169. onnx/backend/test/case/node/sigmoid.py +1 -0
  170. onnx/backend/test/case/node/sign.py +1 -0
  171. onnx/backend/test/case/node/sin.py +1 -0
  172. onnx/backend/test/case/node/sinh.py +1 -0
  173. onnx/backend/test/case/node/size.py +1 -0
  174. onnx/backend/test/case/node/slice.py +1 -0
  175. onnx/backend/test/case/node/softmax.py +1 -0
  176. onnx/backend/test/case/node/softmaxcrossentropy.py +4 -1
  177. onnx/backend/test/case/node/softplus.py +1 -0
  178. onnx/backend/test/case/node/softsign.py +1 -0
  179. onnx/backend/test/case/node/spacetodepth.py +1 -0
  180. onnx/backend/test/case/node/split.py +1 -0
  181. onnx/backend/test/case/node/splittosequence.py +1 -0
  182. onnx/backend/test/case/node/sqrt.py +1 -0
  183. onnx/backend/test/case/node/squeeze.py +1 -0
  184. onnx/backend/test/case/node/stft.py +4 -1
  185. onnx/backend/test/case/node/string_concat.py +1 -0
  186. onnx/backend/test/case/node/string_split.py +1 -0
  187. onnx/backend/test/case/node/stringnormalizer.py +1 -0
  188. onnx/backend/test/case/node/sub.py +1 -0
  189. onnx/backend/test/case/node/sum.py +1 -0
  190. onnx/backend/test/case/node/tan.py +1 -0
  191. onnx/backend/test/case/node/tanh.py +1 -0
  192. onnx/backend/test/case/node/tfidfvectorizer.py +1 -0
  193. onnx/backend/test/case/node/thresholdedrelu.py +1 -0
  194. onnx/backend/test/case/node/tile.py +1 -0
  195. onnx/backend/test/case/node/topk.py +1 -0
  196. onnx/backend/test/case/node/transpose.py +1 -0
  197. onnx/backend/test/case/node/trilu.py +1 -0
  198. onnx/backend/test/case/node/unique.py +7 -0
  199. onnx/backend/test/case/node/unsqueeze.py +1 -0
  200. onnx/backend/test/case/node/upsample.py +1 -0
  201. onnx/backend/test/case/node/where.py +1 -0
  202. onnx/backend/test/case/node/xor.py +1 -0
  203. onnx/backend/test/case/test_case.py +6 -5
  204. onnx/backend/test/case/utils.py +2 -2
  205. onnx/backend/test/cmd_tools.py +1 -0
  206. onnx/backend/test/data/node/test_acos/model.onnx +0 -0
  207. onnx/backend/test/data/node/test_acos/test_data_set_0/output_0.pb +0 -0
  208. onnx/backend/test/data/node/test_acos_example/model.onnx +0 -0
  209. onnx/backend/test/data/node/test_acosh/model.onnx +0 -0
  210. onnx/backend/test/data/node/test_acosh/test_data_set_0/output_0.pb +1 -1
  211. onnx/backend/test/data/node/test_acosh_example/model.onnx +0 -0
  212. onnx/backend/test/data/node/test_asin/model.onnx +0 -0
  213. onnx/backend/test/data/node/test_asin/test_data_set_0/output_0.pb +1 -1
  214. onnx/backend/test/data/node/test_asin_example/model.onnx +0 -0
  215. onnx/backend/test/data/node/test_asinh/model.onnx +0 -0
  216. onnx/backend/test/data/node/test_asinh/test_data_set_0/output_0.pb +1 -1
  217. onnx/backend/test/data/node/test_asinh_example/model.onnx +0 -0
  218. onnx/backend/test/data/node/test_atan/model.onnx +0 -0
  219. onnx/backend/test/data/node/test_atan/test_data_set_0/output_0.pb +1 -1
  220. onnx/backend/test/data/node/test_atan_example/model.onnx +0 -0
  221. onnx/backend/test/data/node/test_atanh/model.onnx +0 -0
  222. onnx/backend/test/data/node/test_atanh/test_data_set_0/output_0.pb +2 -2
  223. onnx/backend/test/data/node/test_atanh_example/model.onnx +0 -0
  224. onnx/backend/test/data/node/test_averagepool_1d_default/model.onnx +0 -0
  225. onnx/backend/test/data/node/test_averagepool_2d_ceil/model.onnx +0 -0
  226. onnx/backend/test/data/node/test_averagepool_2d_default/model.onnx +0 -0
  227. onnx/backend/test/data/node/test_averagepool_2d_dilations/model.onnx +0 -0
  228. onnx/backend/test/data/node/test_averagepool_2d_pads/model.onnx +0 -0
  229. onnx/backend/test/data/node/test_averagepool_2d_pads_count_include_pad/model.onnx +0 -0
  230. onnx/backend/test/data/node/test_averagepool_2d_precomputed_pads/model.onnx +0 -0
  231. onnx/backend/test/data/node/test_averagepool_2d_precomputed_pads_count_include_pad/model.onnx +0 -0
  232. onnx/backend/test/data/node/test_averagepool_2d_precomputed_same_upper/model.onnx +0 -0
  233. onnx/backend/test/data/node/test_averagepool_2d_precomputed_strides/model.onnx +0 -0
  234. onnx/backend/test/data/node/test_averagepool_2d_same_lower/model.onnx +0 -0
  235. onnx/backend/test/data/node/test_averagepool_2d_same_upper/model.onnx +0 -0
  236. onnx/backend/test/data/node/test_averagepool_2d_strides/model.onnx +0 -0
  237. onnx/backend/test/data/node/test_averagepool_3d_default/model.onnx +0 -0
  238. onnx/backend/test/data/node/test_averagepool_3d_dilations_large_count_include_pad_is_0_ceil_mode_is_False/model.onnx +0 -0
  239. onnx/backend/test/data/node/test_averagepool_3d_dilations_large_count_include_pad_is_0_ceil_mode_is_True/model.onnx +0 -0
  240. onnx/backend/test/data/node/test_averagepool_3d_dilations_large_count_include_pad_is_1_ceil_mode_is_False/model.onnx +0 -0
  241. onnx/backend/test/data/node/test_averagepool_3d_dilations_large_count_include_pad_is_1_ceil_mode_is_True/model.onnx +0 -0
  242. onnx/backend/test/data/node/test_averagepool_3d_dilations_small/model.onnx +0 -0
  243. onnx/backend/test/data/node/test_basic_conv_with_padding/model.onnx +0 -0
  244. onnx/backend/test/data/node/test_basic_conv_without_padding/model.onnx +0 -0
  245. onnx/backend/test/data/node/test_basic_deform_conv_with_padding/model.onnx +0 -0
  246. onnx/backend/test/data/node/test_basic_deform_conv_without_padding/model.onnx +0 -0
  247. onnx/backend/test/data/node/test_bernoulli/model.onnx +0 -0
  248. onnx/backend/test/data/node/test_bernoulli_double/model.onnx +0 -0
  249. onnx/backend/test/data/node/test_bernoulli_double_expanded/model.onnx +0 -0
  250. onnx/backend/test/data/node/test_bernoulli_expanded/model.onnx +0 -0
  251. onnx/backend/test/data/node/test_bernoulli_seed/model.onnx +0 -0
  252. onnx/backend/test/data/node/test_bernoulli_seed_expanded/model.onnx +0 -0
  253. onnx/backend/test/data/node/test_blackmanwindow/test_data_set_0/output_0.pb +0 -0
  254. onnx/backend/test/data/node/test_blackmanwindow_expanded/test_data_set_0/output_0.pb +0 -0
  255. onnx/backend/test/data/node/test_blackmanwindow_symmetric/test_data_set_0/output_0.pb +0 -0
  256. onnx/backend/test/data/node/test_blackmanwindow_symmetric_expanded/test_data_set_0/output_0.pb +0 -0
  257. onnx/backend/test/data/node/test_cast_FLOAT16_to_INT4/test_data_set_0/output_0.pb +1 -1
  258. onnx/backend/test/data/node/test_cast_FLOAT_to_INT4/test_data_set_0/output_0.pb +1 -1
  259. onnx/backend/test/data/node/test_cast_INT4_to_FLOAT/test_data_set_0/input_0.pb +1 -1
  260. onnx/backend/test/data/node/test_cast_INT4_to_FLOAT16/test_data_set_0/input_0.pb +1 -1
  261. onnx/backend/test/data/node/test_cast_INT4_to_INT8/test_data_set_0/input_0.pb +1 -1
  262. onnx/backend/test/data/node/test_conv_with_autopad_same/model.onnx +0 -0
  263. onnx/backend/test/data/node/test_conv_with_strides_and_asymmetric_padding/model.onnx +0 -0
  264. onnx/backend/test/data/node/test_conv_with_strides_no_padding/model.onnx +0 -0
  265. onnx/backend/test/data/node/test_conv_with_strides_padding/model.onnx +0 -0
  266. onnx/backend/test/data/node/test_convtranspose/model.onnx +0 -0
  267. onnx/backend/test/data/node/test_convtranspose_1d/model.onnx +0 -0
  268. onnx/backend/test/data/node/test_convtranspose_3d/model.onnx +0 -0
  269. onnx/backend/test/data/node/test_convtranspose_autopad_same/model.onnx +0 -0
  270. onnx/backend/test/data/node/test_convtranspose_dilations/model.onnx +0 -0
  271. onnx/backend/test/data/node/test_convtranspose_group_2/model.onnx +0 -0
  272. onnx/backend/test/data/node/test_convtranspose_group_2/test_data_set_0/input_0.pb +0 -0
  273. onnx/backend/test/data/node/test_convtranspose_group_2/test_data_set_0/input_1.pb +0 -0
  274. onnx/backend/test/data/node/test_convtranspose_group_2/test_data_set_0/output_0.pb +0 -0
  275. onnx/backend/test/data/node/test_convtranspose_group_2_image_3/model.onnx +0 -0
  276. onnx/backend/test/data/node/test_convtranspose_group_2_image_3/test_data_set_0/input_0.pb +0 -0
  277. onnx/backend/test/data/node/test_convtranspose_group_2_image_3/test_data_set_0/input_1.pb +0 -0
  278. onnx/backend/test/data/node/test_convtranspose_group_2_image_3/test_data_set_0/output_0.pb +0 -0
  279. onnx/backend/test/data/node/test_convtranspose_kernel_shape/model.onnx +0 -0
  280. onnx/backend/test/data/node/test_convtranspose_output_shape/model.onnx +0 -0
  281. onnx/backend/test/data/node/test_convtranspose_pad/model.onnx +0 -0
  282. onnx/backend/test/data/node/test_convtranspose_pads/model.onnx +0 -0
  283. onnx/backend/test/data/node/test_cos/model.onnx +0 -0
  284. onnx/backend/test/data/node/test_cos_example/model.onnx +0 -0
  285. onnx/backend/test/data/node/test_cosh/model.onnx +0 -0
  286. onnx/backend/test/data/node/test_cosh/test_data_set_0/output_0.pb +1 -1
  287. onnx/backend/test/data/node/test_cosh_example/model.onnx +0 -0
  288. onnx/backend/test/data/node/test_cosh_example/test_data_set_0/output_0.pb +0 -0
  289. onnx/backend/test/data/node/test_deform_conv_with_mask_bias/model.onnx +0 -0
  290. onnx/backend/test/data/node/test_deform_conv_with_multiple_offset_groups/model.onnx +0 -0
  291. onnx/backend/test/data/node/test_dequantizelinear_int4/test_data_set_0/input_0.pb +1 -1
  292. onnx/backend/test/data/node/test_det_2d/model.onnx +0 -0
  293. onnx/backend/test/data/node/test_det_nd/model.onnx +0 -0
  294. onnx/backend/test/data/node/test_dft/test_data_set_0/output_0.pb +0 -0
  295. onnx/backend/test/data/node/test_dft_axis/test_data_set_0/output_0.pb +0 -0
  296. onnx/backend/test/data/node/test_dft_axis_opset19/test_data_set_0/output_0.pb +0 -0
  297. onnx/backend/test/data/node/test_dft_inverse/test_data_set_0/output_0.pb +0 -0
  298. onnx/backend/test/data/node/test_dft_inverse_opset19/test_data_set_0/output_0.pb +0 -0
  299. onnx/backend/test/data/node/test_dft_opset19/test_data_set_0/output_0.pb +0 -0
  300. onnx/backend/test/data/node/test_dropout_default/model.onnx +0 -0
  301. onnx/backend/test/data/node/test_dropout_default_mask/model.onnx +0 -0
  302. onnx/backend/test/data/node/test_dropout_default_mask_ratio/model.onnx +0 -0
  303. onnx/backend/test/data/node/test_dropout_default_ratio/model.onnx +0 -0
  304. onnx/backend/test/data/node/test_elu/model.onnx +0 -0
  305. onnx/backend/test/data/node/test_elu_default/model.onnx +0 -0
  306. onnx/backend/test/data/node/test_elu_example/model.onnx +0 -0
  307. onnx/backend/test/data/node/test_eyelike_populate_off_main_diagonal/model.onnx +0 -0
  308. onnx/backend/test/data/node/test_eyelike_with_dtype/model.onnx +0 -0
  309. onnx/backend/test/data/node/test_eyelike_without_dtype/model.onnx +0 -0
  310. onnx/backend/test/data/node/test_gelu_default_1/test_data_set_0/output_0.pb +0 -0
  311. onnx/backend/test/data/node/test_gelu_default_1_expanded/test_data_set_0/output_0.pb +0 -0
  312. onnx/backend/test/data/node/test_gelu_default_2/test_data_set_0/output_0.pb +4 -3
  313. onnx/backend/test/data/node/test_gelu_default_2_expanded/test_data_set_0/output_0.pb +4 -3
  314. onnx/backend/test/data/node/test_gelu_tanh_2/test_data_set_0/output_0.pb +0 -0
  315. onnx/backend/test/data/node/test_gelu_tanh_2_expanded/test_data_set_0/output_0.pb +0 -0
  316. onnx/backend/test/data/node/test_globalaveragepool/model.onnx +0 -0
  317. onnx/backend/test/data/node/test_globalaveragepool_precomputed/model.onnx +0 -0
  318. onnx/backend/test/data/node/test_globalmaxpool/model.onnx +0 -0
  319. onnx/backend/test/data/node/test_globalmaxpool_precomputed/model.onnx +0 -0
  320. onnx/backend/test/data/node/test_gridsample/model.onnx +0 -0
  321. onnx/backend/test/data/node/test_gridsample_aligncorners_true/model.onnx +0 -0
  322. onnx/backend/test/data/node/test_gridsample_bicubic/model.onnx +0 -0
  323. onnx/backend/test/data/node/test_gridsample_bicubic_align_corners_0_additional_1/model.onnx +0 -0
  324. onnx/backend/test/data/node/test_gridsample_bicubic_align_corners_1_additional_1/model.onnx +0 -0
  325. onnx/backend/test/data/node/test_gridsample_bilinear/model.onnx +0 -0
  326. onnx/backend/test/data/node/test_gridsample_bilinear_align_corners_0_additional_1/model.onnx +0 -0
  327. onnx/backend/test/data/node/test_gridsample_bilinear_align_corners_1_additional_1/model.onnx +0 -0
  328. onnx/backend/test/data/node/test_gridsample_border_padding/model.onnx +0 -0
  329. onnx/backend/test/data/node/test_gridsample_nearest/model.onnx +0 -0
  330. onnx/backend/test/data/node/test_gridsample_nearest_align_corners_0_additional_1/model.onnx +0 -0
  331. onnx/backend/test/data/node/test_gridsample_nearest_align_corners_1_additional_1/model.onnx +0 -0
  332. onnx/backend/test/data/node/test_gridsample_reflection_padding/model.onnx +0 -0
  333. onnx/backend/test/data/node/test_gridsample_volumetric_bilinear_align_corners_0/model.onnx +0 -0
  334. onnx/backend/test/data/node/test_gridsample_volumetric_bilinear_align_corners_1/model.onnx +0 -0
  335. onnx/backend/test/data/node/test_gridsample_volumetric_nearest_align_corners_0/model.onnx +0 -0
  336. onnx/backend/test/data/node/test_gridsample_volumetric_nearest_align_corners_1/model.onnx +0 -0
  337. onnx/backend/test/data/node/test_gridsample_zeros_padding/model.onnx +0 -0
  338. onnx/backend/test/data/node/test_gru_batchwise/model.onnx +0 -0
  339. onnx/backend/test/data/node/test_gru_defaults/model.onnx +0 -0
  340. onnx/backend/test/data/node/test_gru_seq_length/model.onnx +0 -0
  341. onnx/backend/test/data/node/test_gru_with_initial_bias/model.onnx +0 -0
  342. onnx/backend/test/data/node/test_hammingwindow/test_data_set_0/output_0.pb +0 -0
  343. onnx/backend/test/data/node/test_hammingwindow_expanded/test_data_set_0/output_0.pb +0 -0
  344. onnx/backend/test/data/node/test_hammingwindow_symmetric/test_data_set_0/output_0.pb +1 -1
  345. onnx/backend/test/data/node/test_hammingwindow_symmetric_expanded/test_data_set_0/output_0.pb +1 -1
  346. onnx/backend/test/data/node/test_hannwindow/test_data_set_0/output_0.pb +0 -0
  347. onnx/backend/test/data/node/test_hannwindow_expanded/test_data_set_0/output_0.pb +0 -0
  348. onnx/backend/test/data/node/test_hannwindow_symmetric/test_data_set_0/output_0.pb +0 -0
  349. onnx/backend/test/data/node/test_hannwindow_symmetric_expanded/test_data_set_0/output_0.pb +0 -0
  350. onnx/backend/test/data/node/test_hardsigmoid/model.onnx +0 -0
  351. onnx/backend/test/data/node/test_hardsigmoid_default/model.onnx +0 -0
  352. onnx/backend/test/data/node/test_hardsigmoid_example/model.onnx +0 -0
  353. onnx/backend/test/data/node/test_hardswish/model.onnx +0 -0
  354. onnx/backend/test/data/node/test_hardswish_expanded/model.onnx +0 -0
  355. onnx/backend/test/data/node/test_image_decoder_decode_jpeg2k_rgb/test_data_set_0/input_0.pb +0 -0
  356. onnx/backend/test/data/node/test_instancenorm_epsilon/model.onnx +0 -0
  357. onnx/backend/test/data/node/test_instancenorm_example/model.onnx +0 -0
  358. onnx/backend/test/data/node/test_lppool_1d_default/model.onnx +0 -0
  359. onnx/backend/test/data/node/test_lppool_1d_default/test_data_set_0/output_0.pb +2 -2
  360. onnx/backend/test/data/node/test_lppool_2d_default/model.onnx +0 -0
  361. onnx/backend/test/data/node/test_lppool_2d_default/test_data_set_0/output_0.pb +0 -0
  362. onnx/backend/test/data/node/test_lppool_2d_dilations/model.onnx +0 -0
  363. onnx/backend/test/data/node/test_lppool_2d_pads/model.onnx +0 -0
  364. onnx/backend/test/data/node/test_lppool_2d_pads/test_data_set_0/output_0.pb +0 -0
  365. onnx/backend/test/data/node/test_lppool_2d_same_lower/model.onnx +0 -0
  366. onnx/backend/test/data/node/test_lppool_2d_same_lower/test_data_set_0/output_0.pb +0 -0
  367. onnx/backend/test/data/node/test_lppool_2d_same_upper/model.onnx +0 -0
  368. onnx/backend/test/data/node/test_lppool_2d_same_upper/test_data_set_0/output_0.pb +0 -0
  369. onnx/backend/test/data/node/test_lppool_2d_strides/model.onnx +0 -0
  370. onnx/backend/test/data/node/test_lppool_2d_strides/test_data_set_0/output_0.pb +0 -0
  371. onnx/backend/test/data/node/test_lppool_3d_default/model.onnx +0 -0
  372. onnx/backend/test/data/node/test_lppool_3d_default/test_data_set_0/output_0.pb +0 -0
  373. onnx/backend/test/data/node/test_lstm_batchwise/model.onnx +0 -0
  374. onnx/backend/test/data/node/test_lstm_defaults/model.onnx +0 -0
  375. onnx/backend/test/data/node/test_lstm_with_initial_bias/model.onnx +0 -0
  376. onnx/backend/test/data/node/test_lstm_with_peepholes/model.onnx +0 -0
  377. onnx/backend/test/data/node/test_maxpool_1d_default/model.onnx +0 -0
  378. onnx/backend/test/data/node/test_maxpool_2d_ceil/model.onnx +0 -0
  379. onnx/backend/test/data/node/test_maxpool_2d_ceil_output_size_reduce_by_one/model.onnx +0 -0
  380. onnx/backend/test/data/node/test_maxpool_2d_default/model.onnx +0 -0
  381. onnx/backend/test/data/node/test_maxpool_2d_dilations/model.onnx +0 -0
  382. onnx/backend/test/data/node/test_maxpool_2d_pads/model.onnx +0 -0
  383. onnx/backend/test/data/node/test_maxpool_2d_precomputed_pads/model.onnx +0 -0
  384. onnx/backend/test/data/node/test_maxpool_2d_precomputed_same_upper/model.onnx +0 -0
  385. onnx/backend/test/data/node/test_maxpool_2d_precomputed_strides/model.onnx +0 -0
  386. onnx/backend/test/data/node/test_maxpool_2d_same_lower/model.onnx +0 -0
  387. onnx/backend/test/data/node/test_maxpool_2d_same_upper/model.onnx +0 -0
  388. onnx/backend/test/data/node/test_maxpool_2d_strides/model.onnx +0 -0
  389. onnx/backend/test/data/node/test_maxpool_2d_uint8/model.onnx +0 -0
  390. onnx/backend/test/data/node/test_maxpool_3d_default/model.onnx +0 -0
  391. onnx/backend/test/data/node/test_maxpool_3d_dilations/model.onnx +0 -0
  392. onnx/backend/test/data/node/test_maxpool_3d_dilations_use_ref_impl/model.onnx +0 -0
  393. onnx/backend/test/data/node/test_maxpool_3d_dilations_use_ref_impl_large/model.onnx +0 -0
  394. onnx/backend/test/data/node/test_maxpool_with_argmax_2d_precomputed_pads/model.onnx +0 -0
  395. onnx/backend/test/data/node/test_maxpool_with_argmax_2d_precomputed_strides/model.onnx +0 -0
  396. onnx/backend/test/data/node/test_maxunpool_export_with_output_shape/model.onnx +0 -0
  397. onnx/backend/test/data/node/test_maxunpool_export_without_output_shape/model.onnx +0 -0
  398. onnx/backend/test/data/node/test_mish/model.onnx +0 -0
  399. onnx/backend/test/data/node/test_mish/test_data_set_0/output_0.pb +0 -0
  400. onnx/backend/test/data/node/test_mish_expanded/model.onnx +0 -0
  401. onnx/backend/test/data/node/test_mish_expanded/test_data_set_0/output_0.pb +0 -0
  402. onnx/backend/test/data/node/test_nllloss_NC/model.onnx +0 -0
  403. onnx/backend/test/data/node/test_nllloss_NC_expanded/model.onnx +0 -0
  404. onnx/backend/test/data/node/test_nllloss_NCd1/model.onnx +0 -0
  405. onnx/backend/test/data/node/test_nllloss_NCd1_expanded/model.onnx +0 -0
  406. onnx/backend/test/data/node/test_nllloss_NCd1_ii/model.onnx +0 -0
  407. onnx/backend/test/data/node/test_nllloss_NCd1_ii_expanded/model.onnx +0 -0
  408. onnx/backend/test/data/node/test_nllloss_NCd1_mean_weight_negative_ii/model.onnx +0 -0
  409. onnx/backend/test/data/node/test_nllloss_NCd1_mean_weight_negative_ii_expanded/model.onnx +0 -0
  410. onnx/backend/test/data/node/test_nllloss_NCd1_weight/model.onnx +0 -0
  411. onnx/backend/test/data/node/test_nllloss_NCd1_weight_expanded/model.onnx +0 -0
  412. onnx/backend/test/data/node/test_nllloss_NCd1_weight_ii/model.onnx +0 -0
  413. onnx/backend/test/data/node/test_nllloss_NCd1_weight_ii_expanded/model.onnx +0 -0
  414. onnx/backend/test/data/node/test_nllloss_NCd1d2/model.onnx +0 -0
  415. onnx/backend/test/data/node/test_nllloss_NCd1d2_expanded/model.onnx +0 -0
  416. onnx/backend/test/data/node/test_nllloss_NCd1d2_no_weight_reduction_mean_ii/model.onnx +0 -0
  417. onnx/backend/test/data/node/test_nllloss_NCd1d2_no_weight_reduction_mean_ii_expanded/model.onnx +0 -0
  418. onnx/backend/test/data/node/test_nllloss_NCd1d2_reduction_mean/model.onnx +0 -0
  419. onnx/backend/test/data/node/test_nllloss_NCd1d2_reduction_mean_expanded/model.onnx +0 -0
  420. onnx/backend/test/data/node/test_nllloss_NCd1d2_reduction_sum/model.onnx +0 -0
  421. onnx/backend/test/data/node/test_nllloss_NCd1d2_reduction_sum_expanded/model.onnx +0 -0
  422. onnx/backend/test/data/node/test_nllloss_NCd1d2_with_weight/model.onnx +0 -0
  423. onnx/backend/test/data/node/test_nllloss_NCd1d2_with_weight_expanded/model.onnx +0 -0
  424. onnx/backend/test/data/node/test_nllloss_NCd1d2_with_weight_reduction_mean/model.onnx +0 -0
  425. onnx/backend/test/data/node/test_nllloss_NCd1d2_with_weight_reduction_mean_expanded/model.onnx +0 -0
  426. onnx/backend/test/data/node/test_nllloss_NCd1d2_with_weight_reduction_sum/model.onnx +0 -0
  427. onnx/backend/test/data/node/test_nllloss_NCd1d2_with_weight_reduction_sum_expanded/model.onnx +0 -0
  428. onnx/backend/test/data/node/test_nllloss_NCd1d2_with_weight_reduction_sum_ii/model.onnx +0 -0
  429. onnx/backend/test/data/node/test_nllloss_NCd1d2_with_weight_reduction_sum_ii_expanded/model.onnx +0 -0
  430. onnx/backend/test/data/node/test_nllloss_NCd1d2d3_none_no_weight_negative_ii/model.onnx +0 -0
  431. onnx/backend/test/data/node/test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded/model.onnx +0 -0
  432. onnx/backend/test/data/node/test_nllloss_NCd1d2d3_sum_weight_high_ii/model.onnx +0 -0
  433. onnx/backend/test/data/node/test_nllloss_NCd1d2d3_sum_weight_high_ii_expanded/model.onnx +0 -0
  434. onnx/backend/test/data/node/test_nllloss_NCd1d2d3d4d5_mean_weight/model.onnx +0 -0
  435. onnx/backend/test/data/node/test_nllloss_NCd1d2d3d4d5_mean_weight_expanded/model.onnx +0 -0
  436. onnx/backend/test/data/node/test_nllloss_NCd1d2d3d4d5_none_no_weight/model.onnx +0 -0
  437. onnx/backend/test/data/node/test_nllloss_NCd1d2d3d4d5_none_no_weight_expanded/model.onnx +0 -0
  438. onnx/backend/test/data/node/test_quantizelinear_int4/test_data_set_0/output_0.pb +1 -1
  439. onnx/backend/test/data/node/test_reduce_log_sum_exp_do_not_keepdims_random/test_data_set_0/output_0.pb +1 -1
  440. onnx/backend/test/data/node/test_reduce_log_sum_exp_do_not_keepdims_random_expanded/test_data_set_0/output_0.pb +1 -1
  441. onnx/backend/test/data/node/test_reduce_log_sum_exp_keepdims_random/test_data_set_0/output_0.pb +1 -1
  442. onnx/backend/test/data/node/test_reduce_log_sum_exp_keepdims_random_expanded/test_data_set_0/output_0.pb +1 -1
  443. onnx/backend/test/data/node/test_reduce_log_sum_exp_negative_axes_keepdims_random/test_data_set_0/output_0.pb +1 -1
  444. onnx/backend/test/data/node/test_reduce_log_sum_exp_negative_axes_keepdims_random_expanded/test_data_set_0/output_0.pb +1 -1
  445. onnx/backend/test/data/node/test_reduce_max_empty_set/model.onnx +0 -0
  446. onnx/backend/test/data/node/test_reduce_max_empty_set/test_data_set_0/input_0.pb +0 -0
  447. onnx/backend/test/data/node/test_reduce_max_empty_set/test_data_set_0/input_1.pb +0 -0
  448. onnx/backend/test/data/node/test_reduce_max_empty_set/test_data_set_0/output_0.pb +0 -0
  449. onnx/backend/test/data/node/test_reduce_sum_empty_axes_input_noop/model.onnx +0 -0
  450. onnx/backend/test/data/node/test_reduce_sum_empty_axes_input_noop/test_data_set_0/input_0.pb +1 -0
  451. onnx/backend/test/data/node/test_reduce_sum_empty_axes_input_noop/test_data_set_0/input_1.pb +0 -0
  452. onnx/backend/test/data/node/test_reduce_sum_empty_axes_input_noop/test_data_set_0/output_0.pb +1 -0
  453. onnx/backend/test/data/node/test_reduce_sum_negative_axes_keepdims_random/model.onnx +0 -0
  454. onnx/backend/test/data/node/test_reduce_sum_negative_axes_keepdims_random/test_data_set_0/input_1.pb +0 -0
  455. onnx/backend/test/data/node/test_reduce_sum_negative_axes_keepdims_random/test_data_set_0/output_0.pb +1 -1
  456. onnx/backend/test/data/node/test_resize_tf_crop_and_resize/model.onnx +0 -0
  457. onnx/backend/test/data/node/test_resize_tf_crop_and_resize/test_data_set_0/input_1.pb +0 -0
  458. onnx/backend/test/data/node/test_resize_tf_crop_and_resize/test_data_set_0/output_0.pb +0 -0
  459. onnx/backend/test/data/node/test_resize_tf_crop_and_resize_extrapolation_value/model.onnx +0 -0
  460. onnx/backend/test/data/node/test_resize_tf_crop_and_resize_extrapolation_value/test_data_set_0/input_0.pb +0 -0
  461. onnx/backend/test/data/node/test_resize_tf_crop_and_resize_extrapolation_value/test_data_set_0/input_1.pb +0 -0
  462. onnx/backend/test/data/node/test_resize_tf_crop_and_resize_extrapolation_value/test_data_set_0/input_2.pb +0 -0
  463. onnx/backend/test/data/node/test_resize_tf_crop_and_resize_extrapolation_value/test_data_set_0/output_0.pb +0 -0
  464. onnx/backend/test/data/node/test_resize_upsample_sizes_nearest_not_larger/model.onnx +0 -0
  465. onnx/backend/test/data/node/test_resize_upsample_sizes_nearest_not_larger/test_data_set_0/output_0.pb +0 -0
  466. onnx/backend/test/data/node/test_resize_upsample_sizes_nearest_not_smaller/model.onnx +0 -0
  467. onnx/backend/test/data/node/test_resize_upsample_sizes_nearest_not_smaller/test_data_set_0/input_0.pb +0 -0
  468. onnx/backend/test/data/node/test_resize_upsample_sizes_nearest_not_smaller/test_data_set_0/input_1.pb +0 -0
  469. onnx/backend/test/data/node/test_resize_upsample_sizes_nearest_not_smaller/test_data_set_0/output_0.pb +0 -0
  470. onnx/backend/test/data/node/test_rnn_seq_length/model.onnx +0 -0
  471. onnx/backend/test/data/node/test_roialign_aligned_false/model.onnx +0 -0
  472. onnx/backend/test/data/node/test_roialign_aligned_true/model.onnx +0 -0
  473. onnx/backend/test/data/node/test_roialign_mode_max/model.onnx +0 -0
  474. onnx/backend/test/data/node/test_round/model.onnx +0 -0
  475. onnx/backend/test/data/node/test_selu/model.onnx +0 -0
  476. onnx/backend/test/data/node/test_selu_default/model.onnx +0 -0
  477. onnx/backend/test/data/node/test_selu_example/model.onnx +0 -0
  478. onnx/backend/test/data/node/test_simple_rnn_batchwise/model.onnx +0 -0
  479. onnx/backend/test/data/node/test_simple_rnn_defaults/model.onnx +0 -0
  480. onnx/backend/test/data/node/test_simple_rnn_with_initial_bias/model.onnx +0 -0
  481. onnx/backend/test/data/node/test_sin/model.onnx +0 -0
  482. onnx/backend/test/data/node/test_sin_example/model.onnx +0 -0
  483. onnx/backend/test/data/node/test_sinh/model.onnx +0 -0
  484. onnx/backend/test/data/node/test_sinh/test_data_set_0/output_0.pb +1 -1
  485. onnx/backend/test/data/node/test_sinh_example/model.onnx +0 -0
  486. onnx/backend/test/data/node/test_softplus/model.onnx +0 -0
  487. onnx/backend/test/data/node/test_softplus_example/model.onnx +0 -0
  488. onnx/backend/test/data/node/test_softsign/model.onnx +0 -0
  489. onnx/backend/test/data/node/test_softsign_example/model.onnx +0 -0
  490. onnx/backend/test/data/node/test_stft_with_window/test_data_set_0/input_2.pb +0 -0
  491. onnx/backend/test/data/node/test_stft_with_window/test_data_set_0/output_0.pb +0 -0
  492. onnx/backend/test/data/node/test_tan/model.onnx +0 -0
  493. onnx/backend/test/data/node/test_tan/test_data_set_0/output_0.pb +1 -1
  494. onnx/backend/test/data/node/test_tan_example/model.onnx +0 -0
  495. onnx/backend/test/data/node/test_thresholdedrelu/model.onnx +0 -0
  496. onnx/backend/test/data/node/test_thresholdedrelu_default/model.onnx +0 -0
  497. onnx/backend/test/data/node/test_thresholdedrelu_example/model.onnx +0 -0
  498. onnx/backend/test/data/node/test_training_dropout/model.onnx +0 -0
  499. onnx/backend/test/data/node/test_training_dropout_default/model.onnx +0 -0
  500. onnx/backend/test/data/node/test_training_dropout_default_mask/model.onnx +0 -0
  501. onnx/backend/test/data/node/test_training_dropout_mask/model.onnx +0 -0
  502. onnx/backend/test/data/node/test_training_dropout_zero_ratio/model.onnx +0 -0
  503. onnx/backend/test/data/node/test_training_dropout_zero_ratio_mask/model.onnx +0 -0
  504. onnx/backend/test/loader/__init__.py +11 -6
  505. onnx/backend/test/report/__init__.py +4 -3
  506. onnx/backend/test/report/base.py +1 -0
  507. onnx/backend/test/report/coverage.py +21 -20
  508. onnx/backend/test/runner/__init__.py +12 -8
  509. onnx/backend/test/runner/item.py +3 -2
  510. onnx/backend/test/stat_coverage.py +6 -5
  511. onnx/bin/checker.py +1 -0
  512. onnx/checker.cc +6 -1
  513. onnx/common/version.h +1 -1
  514. onnx/compose.py +66 -50
  515. onnx/cpp2py_export.cc +4 -0
  516. onnx/defs/__init__.py +2 -2
  517. onnx/defs/data_type_utils.cc +0 -1
  518. onnx/defs/gen_doc.py +9 -8
  519. onnx/defs/gen_shape_inference_information.py +1 -0
  520. onnx/defs/generator/defs.cc +32 -84
  521. onnx/defs/generator/old.cc +389 -0
  522. onnx/defs/math/defs.cc +308 -313
  523. onnx/defs/math/old.cc +989 -7
  524. onnx/defs/math/utils.cc +12 -1
  525. onnx/defs/math/utils.h +2 -0
  526. onnx/defs/nn/defs.cc +57 -75
  527. onnx/defs/nn/old.cc +1536 -2
  528. onnx/defs/object_detection/defs.cc +4 -7
  529. onnx/defs/object_detection/old.cc +117 -0
  530. onnx/defs/operator_sets.h +108 -1
  531. onnx/defs/parser.cc +10 -1
  532. onnx/defs/quantization/defs.cc +3 -2
  533. onnx/defs/quantization/old.cc +4 -1
  534. onnx/defs/rnn/defs.cc +10 -13
  535. onnx/defs/rnn/old.cc +517 -2
  536. onnx/defs/schema.cc +53 -59
  537. onnx/defs/schema.h +58 -2
  538. onnx/defs/shape_inference.h +67 -18
  539. onnx/defs/tensor/defs.cc +22 -20
  540. onnx/defs/tensor/old.cc +111 -0
  541. onnx/external_data_helper.py +27 -14
  542. onnx/gen_proto.py +3 -2
  543. onnx/helper.py +86 -61
  544. onnx/hub.py +30 -28
  545. onnx/inliner/inliner.cc +0 -1
  546. onnx/mapping.py +3 -2
  547. onnx/numpy_helper.py +159 -23
  548. onnx/onnx-ml.proto +1 -1
  549. onnx/onnx.in.proto +1 -1
  550. onnx/onnx.proto +1 -1
  551. onnx/onnx_cpp2py_export/defs.pyi +0 -2
  552. onnx/onnx_cpp2py_export/inliner.pyi +0 -4
  553. onnx/onnx_cpp2py_export/parser.pyi +0 -4
  554. onnx/onnx_cpp2py_export.cp311-win32.pyd +0 -0
  555. onnx/parser.py +1 -0
  556. onnx/printer.py +2 -3
  557. onnx/reference/__init__.py +1 -0
  558. onnx/reference/custom_element_types.py +73 -8
  559. onnx/reference/op_run.py +13 -58
  560. onnx/reference/ops/__init__.py +1 -0
  561. onnx/reference/ops/_helpers.py +6 -4
  562. onnx/reference/ops/_op.py +16 -5
  563. onnx/reference/ops/_op_common_indices.py +1 -1
  564. onnx/reference/ops/_op_common_pool.py +38 -29
  565. onnx/reference/ops/_op_common_random.py +1 -1
  566. onnx/reference/ops/_op_common_window.py +2 -2
  567. onnx/reference/ops/_op_list.py +9 -6
  568. onnx/reference/ops/aionnx_preview_training/__init__.py +1 -0
  569. onnx/reference/ops/aionnx_preview_training/_op_list.py +5 -7
  570. onnx/reference/ops/aionnx_preview_training/_op_run_training.py +1 -1
  571. onnx/reference/ops/aionnx_preview_training/op_adagrad.py +14 -5
  572. onnx/reference/ops/aionnx_preview_training/op_adam.py +2 -2
  573. onnx/reference/ops/aionnx_preview_training/op_momentum.py +14 -2
  574. onnx/reference/ops/aionnxml/__init__.py +1 -0
  575. onnx/reference/ops/aionnxml/_common_classifier.py +1 -0
  576. onnx/reference/ops/aionnxml/_op_list.py +5 -6
  577. onnx/reference/ops/aionnxml/_op_run_aionnxml.py +1 -1
  578. onnx/reference/ops/aionnxml/op_array_feature_extractor.py +1 -1
  579. onnx/reference/ops/aionnxml/op_binarizer.py +1 -1
  580. onnx/reference/ops/aionnxml/op_dict_vectorizer.py +2 -2
  581. onnx/reference/ops/aionnxml/op_feature_vectorizer.py +1 -1
  582. onnx/reference/ops/aionnxml/op_imputer.py +3 -3
  583. onnx/reference/ops/aionnxml/op_label_encoder.py +1 -1
  584. onnx/reference/ops/aionnxml/op_linear_classifier.py +2 -2
  585. onnx/reference/ops/aionnxml/op_linear_regressor.py +1 -1
  586. onnx/reference/ops/aionnxml/op_normalizer.py +1 -1
  587. onnx/reference/ops/aionnxml/op_one_hot_encoder.py +1 -1
  588. onnx/reference/ops/aionnxml/op_scaler.py +1 -1
  589. onnx/reference/ops/aionnxml/op_svm_classifier.py +10 -7
  590. onnx/reference/ops/aionnxml/op_svm_helper.py +2 -2
  591. onnx/reference/ops/aionnxml/op_svm_regressor.py +1 -1
  592. onnx/reference/ops/aionnxml/op_tree_ensemble.py +3 -3
  593. onnx/reference/ops/aionnxml/op_tree_ensemble_classifier.py +1 -1
  594. onnx/reference/ops/aionnxml/op_tree_ensemble_helper.py +2 -2
  595. onnx/reference/ops/aionnxml/op_tree_ensemble_regressor.py +5 -3
  596. onnx/reference/ops/experimental/__init__.py +1 -0
  597. onnx/reference/ops/experimental/_op_list.py +6 -12
  598. onnx/reference/ops/experimental/_op_run_experimental.py +1 -1
  599. onnx/reference/ops/experimental/op_im2col.py +1 -1
  600. onnx/reference/ops/op_abs.py +1 -1
  601. onnx/reference/ops/op_acos.py +1 -1
  602. onnx/reference/ops/op_acosh.py +1 -1
  603. onnx/reference/ops/op_add.py +1 -1
  604. onnx/reference/ops/op_affine_grid.py +1 -1
  605. onnx/reference/ops/op_and.py +1 -1
  606. onnx/reference/ops/op_argmax.py +1 -1
  607. onnx/reference/ops/op_argmin.py +1 -1
  608. onnx/reference/ops/op_asin.py +1 -1
  609. onnx/reference/ops/op_asinh.py +1 -1
  610. onnx/reference/ops/op_atan.py +1 -1
  611. onnx/reference/ops/op_atanh.py +1 -1
  612. onnx/reference/ops/op_attribute_has_value.py +15 -15
  613. onnx/reference/ops/op_average_pool.py +1 -1
  614. onnx/reference/ops/op_batch_normalization.py +13 -2
  615. onnx/reference/ops/op_bernoulli.py +1 -1
  616. onnx/reference/ops/op_bitshift.py +1 -1
  617. onnx/reference/ops/op_bitwise_and.py +1 -1
  618. onnx/reference/ops/op_bitwise_not.py +1 -1
  619. onnx/reference/ops/op_bitwise_or.py +1 -1
  620. onnx/reference/ops/op_bitwise_xor.py +1 -1
  621. onnx/reference/ops/op_blackman_window.py +1 -1
  622. onnx/reference/ops/op_cast.py +11 -10
  623. onnx/reference/ops/op_cast_like.py +1 -1
  624. onnx/reference/ops/op_ceil.py +1 -1
  625. onnx/reference/ops/op_celu.py +1 -1
  626. onnx/reference/ops/op_center_crop_pad.py +1 -1
  627. onnx/reference/ops/op_clip.py +1 -1
  628. onnx/reference/ops/op_col2im.py +10 -4
  629. onnx/reference/ops/op_compress.py +1 -1
  630. onnx/reference/ops/op_concat.py +1 -1
  631. onnx/reference/ops/op_concat_from_sequence.py +3 -3
  632. onnx/reference/ops/op_constant.py +2 -2
  633. onnx/reference/ops/op_constant_of_shape.py +1 -1
  634. onnx/reference/ops/op_conv.py +22 -17
  635. onnx/reference/ops/op_conv_integer.py +1 -1
  636. onnx/reference/ops/op_conv_transpose.py +37 -6
  637. onnx/reference/ops/op_cos.py +1 -1
  638. onnx/reference/ops/op_cosh.py +1 -1
  639. onnx/reference/ops/op_cum_sum.py +1 -1
  640. onnx/reference/ops/op_deform_conv.py +1 -1
  641. onnx/reference/ops/op_depth_to_space.py +1 -1
  642. onnx/reference/ops/op_dequantize_linear.py +7 -9
  643. onnx/reference/ops/op_det.py +1 -1
  644. onnx/reference/ops/op_dft.py +16 -2
  645. onnx/reference/ops/op_div.py +1 -1
  646. onnx/reference/ops/op_dropout.py +9 -8
  647. onnx/reference/ops/op_dynamic_quantize_linear.py +1 -1
  648. onnx/reference/ops/op_einsum.py +1 -1
  649. onnx/reference/ops/op_elu.py +1 -1
  650. onnx/reference/ops/op_equal.py +1 -1
  651. onnx/reference/ops/op_erf.py +1 -1
  652. onnx/reference/ops/op_exp.py +1 -1
  653. onnx/reference/ops/op_expand.py +1 -1
  654. onnx/reference/ops/op_eyelike.py +2 -2
  655. onnx/reference/ops/op_flatten.py +1 -1
  656. onnx/reference/ops/op_floor.py +1 -1
  657. onnx/reference/ops/op_gather.py +1 -1
  658. onnx/reference/ops/op_gather_elements.py +3 -3
  659. onnx/reference/ops/op_gathernd.py +2 -4
  660. onnx/reference/ops/op_gemm.py +12 -2
  661. onnx/reference/ops/op_global_average_pool.py +1 -1
  662. onnx/reference/ops/op_global_max_pool.py +1 -1
  663. onnx/reference/ops/op_greater.py +1 -1
  664. onnx/reference/ops/op_greater_or_equal.py +1 -1
  665. onnx/reference/ops/op_grid_sample.py +2 -3
  666. onnx/reference/ops/op_gru.py +7 -7
  667. onnx/reference/ops/op_hamming_window.py +1 -1
  668. onnx/reference/ops/op_hann_window.py +1 -1
  669. onnx/reference/ops/op_hard_sigmoid.py +1 -1
  670. onnx/reference/ops/op_hardmax.py +5 -2
  671. onnx/reference/ops/op_identity.py +3 -3
  672. onnx/reference/ops/op_if.py +2 -2
  673. onnx/reference/ops/op_instance_normalization.py +1 -1
  674. onnx/reference/ops/op_isinf.py +1 -1
  675. onnx/reference/ops/op_isnan.py +1 -1
  676. onnx/reference/ops/op_layer_normalization.py +2 -4
  677. onnx/reference/ops/op_leaky_relu.py +1 -1
  678. onnx/reference/ops/op_less.py +1 -1
  679. onnx/reference/ops/op_less_or_equal.py +1 -1
  680. onnx/reference/ops/op_log.py +1 -1
  681. onnx/reference/ops/op_log_softmax.py +1 -1
  682. onnx/reference/ops/op_loop.py +4 -2
  683. onnx/reference/ops/op_lp_normalization.py +1 -1
  684. onnx/reference/ops/op_lp_pool.py +4 -2
  685. onnx/reference/ops/op_lrn.py +1 -1
  686. onnx/reference/ops/op_lstm.py +9 -11
  687. onnx/reference/ops/op_matmul.py +1 -1
  688. onnx/reference/ops/op_matmul_integer.py +1 -1
  689. onnx/reference/ops/op_max.py +1 -1
  690. onnx/reference/ops/op_max_pool.py +8 -8
  691. onnx/reference/ops/op_max_unpool.py +5 -3
  692. onnx/reference/ops/op_mean.py +1 -1
  693. onnx/reference/ops/op_mel_weight_matrix.py +1 -1
  694. onnx/reference/ops/op_min.py +1 -1
  695. onnx/reference/ops/op_mod.py +1 -1
  696. onnx/reference/ops/op_mul.py +1 -1
  697. onnx/reference/ops/op_neg.py +1 -1
  698. onnx/reference/ops/op_negative_log_likelihood_loss.py +4 -2
  699. onnx/reference/ops/op_non_max_suppression.py +10 -11
  700. onnx/reference/ops/op_non_zero.py +1 -1
  701. onnx/reference/ops/op_not.py +1 -1
  702. onnx/reference/ops/op_one_hot.py +1 -1
  703. onnx/reference/ops/op_optional.py +1 -1
  704. onnx/reference/ops/op_optional_get_element.py +1 -1
  705. onnx/reference/ops/op_optional_has_element.py +1 -1
  706. onnx/reference/ops/op_or.py +1 -1
  707. onnx/reference/ops/op_pad.py +1 -1
  708. onnx/reference/ops/op_pool_common.py +7 -6
  709. onnx/reference/ops/op_pow.py +1 -1
  710. onnx/reference/ops/op_prelu.py +3 -3
  711. onnx/reference/ops/op_qlinear_conv.py +1 -1
  712. onnx/reference/ops/op_qlinear_matmul.py +1 -1
  713. onnx/reference/ops/op_quantize_linear.py +15 -9
  714. onnx/reference/ops/op_random_normal.py +1 -1
  715. onnx/reference/ops/op_random_normal_like.py +1 -1
  716. onnx/reference/ops/op_random_uniform.py +1 -1
  717. onnx/reference/ops/op_random_uniform_like.py +1 -1
  718. onnx/reference/ops/op_range.py +1 -1
  719. onnx/reference/ops/op_reciprocal.py +1 -1
  720. onnx/reference/ops/op_reduce_l1.py +1 -1
  721. onnx/reference/ops/op_reduce_l2.py +1 -1
  722. onnx/reference/ops/op_reduce_log_sum.py +1 -1
  723. onnx/reference/ops/op_reduce_log_sum_exp.py +1 -1
  724. onnx/reference/ops/op_reduce_max.py +1 -1
  725. onnx/reference/ops/op_reduce_mean.py +2 -2
  726. onnx/reference/ops/op_reduce_min.py +1 -1
  727. onnx/reference/ops/op_reduce_prod.py +1 -1
  728. onnx/reference/ops/op_reduce_sum.py +2 -2
  729. onnx/reference/ops/op_reduce_sum_square.py +1 -1
  730. onnx/reference/ops/op_regex_full_match.py +1 -1
  731. onnx/reference/ops/op_relu.py +1 -1
  732. onnx/reference/ops/op_reshape.py +1 -1
  733. onnx/reference/ops/op_reverse_sequence.py +1 -1
  734. onnx/reference/ops/op_rnn.py +10 -8
  735. onnx/reference/ops/op_roi_align.py +5 -5
  736. onnx/reference/ops/op_round.py +1 -1
  737. onnx/reference/ops/op_scan.py +8 -8
  738. onnx/reference/ops/op_scatter_elements.py +19 -50
  739. onnx/reference/ops/op_scatternd.py +1 -1
  740. onnx/reference/ops/op_selu.py +1 -1
  741. onnx/reference/ops/op_sequence_at.py +1 -1
  742. onnx/reference/ops/op_sequence_construct.py +1 -1
  743. onnx/reference/ops/op_sequence_empty.py +2 -2
  744. onnx/reference/ops/op_sequence_erase.py +1 -1
  745. onnx/reference/ops/op_sequence_insert.py +6 -6
  746. onnx/reference/ops/op_sequence_length.py +1 -1
  747. onnx/reference/ops/op_sequence_map.py +1 -1
  748. onnx/reference/ops/op_shape.py +2 -6
  749. onnx/reference/ops/op_shrink.py +1 -1
  750. onnx/reference/ops/op_sigmoid.py +1 -1
  751. onnx/reference/ops/op_sign.py +1 -1
  752. onnx/reference/ops/op_sin.py +1 -1
  753. onnx/reference/ops/op_sinh.py +1 -1
  754. onnx/reference/ops/op_size.py +1 -1
  755. onnx/reference/ops/op_slice.py +3 -5
  756. onnx/reference/ops/op_softmax.py +1 -1
  757. onnx/reference/ops/op_softmax_cross_entropy_loss.py +1 -1
  758. onnx/reference/ops/op_softplus.py +1 -1
  759. onnx/reference/ops/op_softsign.py +1 -1
  760. onnx/reference/ops/op_space_to_depth.py +1 -1
  761. onnx/reference/ops/op_split.py +1 -1
  762. onnx/reference/ops/op_split_to_sequence.py +5 -7
  763. onnx/reference/ops/op_sqrt.py +1 -1
  764. onnx/reference/ops/op_squeeze.py +1 -1
  765. onnx/reference/ops/op_stft.py +3 -2
  766. onnx/reference/ops/op_string_concat.py +1 -1
  767. onnx/reference/ops/op_string_normalizer.py +8 -8
  768. onnx/reference/ops/op_string_split.py +2 -4
  769. onnx/reference/ops/op_sub.py +1 -1
  770. onnx/reference/ops/op_sum.py +1 -1
  771. onnx/reference/ops/op_tan.py +1 -1
  772. onnx/reference/ops/op_tanh.py +1 -1
  773. onnx/reference/ops/op_tfidf_vectorizer.py +11 -12
  774. onnx/reference/ops/op_thresholded_relu.py +1 -1
  775. onnx/reference/ops/op_tile.py +1 -1
  776. onnx/reference/ops/op_topk.py +7 -2
  777. onnx/reference/ops/op_transpose.py +1 -1
  778. onnx/reference/ops/op_trilu.py +1 -1
  779. onnx/reference/ops/op_unique.py +3 -1
  780. onnx/reference/ops/op_unsqueeze.py +2 -2
  781. onnx/reference/ops/op_upsample.py +1 -1
  782. onnx/reference/ops/op_where.py +1 -1
  783. onnx/reference/ops/op_xor.py +1 -1
  784. onnx/reference/ops_optimized/__init__.py +1 -0
  785. onnx/reference/ops_optimized/op_conv_optimized.py +1 -1
  786. onnx/reference/reference_evaluator.py +27 -13
  787. onnx/serialization.py +1 -1
  788. onnx/shape_inference/implementation.cc +15 -1
  789. onnx/shape_inference/implementation.h +15 -1
  790. onnx/shape_inference.py +1 -1
  791. onnx/subbyte.py +6 -6
  792. onnx/test/basic_test.py +1 -0
  793. onnx/test/checker_test.py +37 -2
  794. onnx/test/compose_test.py +12 -11
  795. onnx/test/cpp/schema_registration_test.cc +3 -3
  796. onnx/test/cpp/shape_inference_test.cc +38 -2
  797. onnx/test/elu_test.py +2 -0
  798. onnx/test/function_inference_test.py +2 -0
  799. onnx/test/function_test.py +1 -0
  800. onnx/test/helper_test.py +77 -16
  801. onnx/test/hub_test.py +1 -1
  802. onnx/test/inference_function_test.py +25 -8
  803. onnx/test/inliner_test.py +2 -0
  804. onnx/test/model_container_refeval_test.py +2 -1
  805. onnx/test/model_container_test.py +1 -0
  806. onnx/test/model_inference_test.py +2 -0
  807. onnx/test/numpy_helper_test.py +56 -1
  808. onnx/test/parser_test.py +48 -2
  809. onnx/test/printer_test.py +2 -0
  810. onnx/test/reference_evaluator_ml_test.py +2 -3
  811. onnx/test/reference_evaluator_model_test.py +2 -0
  812. onnx/test/reference_evaluator_test.py +173 -19
  813. onnx/test/relu_test.py +2 -0
  814. onnx/test/schema_test.py +4 -2
  815. onnx/test/serialization_test.py +2 -0
  816. onnx/test/shape_inference_test.py +349 -19
  817. onnx/test/symbolic_shape_test.py +3 -3
  818. onnx/test/test_backend_onnxruntime.py +272 -1
  819. onnx/test/test_backend_reference.py +24 -3
  820. onnx/test/test_backend_test.py +6 -5
  821. onnx/test/test_external_data.py +91 -2
  822. onnx/test/test_with_ort.py +1 -0
  823. onnx/test/tools_test.py +15 -14
  824. onnx/test/training_tool_test.py +1 -0
  825. onnx/test/utils_test.py +1 -0
  826. onnx/test/version_converter/automatic_downgrade_test.py +2 -0
  827. onnx/test/version_converter/automatic_upgrade_test.py +2 -0
  828. onnx/test/version_converter_test.py +26 -7
  829. onnx/test/version_utils.py +8 -0
  830. onnx/tools/net_drawer.py +6 -5
  831. onnx/tools/replace_constants.py +11 -11
  832. onnx/tools/update_model_dims.py +7 -6
  833. onnx/utils.py +41 -21
  834. onnx/version.py +2 -2
  835. onnx/version_converter/adapters/split_17_18.h +1 -1
  836. onnx/version_converter/convert.h +107 -2
  837. onnx/version_converter.py +3 -2
  838. {onnx-1.16.2.dist-info → onnx-1.17.0.dist-info}/METADATA +9 -12
  839. {onnx-1.16.2.dist-info → onnx-1.17.0.dist-info}/RECORD +843 -817
  840. {onnx-1.16.2.dist-info → onnx-1.17.0.dist-info}/WHEEL +1 -1
  841. {onnx-1.16.2.dist-info → onnx-1.17.0.dist-info}/LICENSE +0 -0
  842. {onnx-1.16.2.dist-info → onnx-1.17.0.dist-info}/entry_points.txt +0 -0
  843. {onnx-1.16.2.dist-info → onnx-1.17.0.dist-info}/top_level.txt +0 -0
@@ -126,7 +126,7 @@ ONNX_OPERATOR_SET_SCHEMA(
126
126
  }
127
127
  }));
128
128
 
129
- static const char* EyeLike_ver9_doc = R"DOC(
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
- 9,
141
+ 22,
142
142
  OpSchema()
143
- .SetDoc(EyeLike_ver9_doc)
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
- {"tensor(float16)",
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
- {"tensor(float16)",
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* RandomUniform_ver1_doc = R"DOC(
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
- 1,
194
+ 22,
217
195
  OpSchema()
218
- .SetDoc(RandomUniform_ver1_doc)
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* RandomNormal_ver1_doc = R"DOC(
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
- 1,
229
+ 22,
255
230
  OpSchema()
256
- .SetDoc(RandomNormal_ver1_doc)
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* RandomUniformLike_ver1_doc = R"DOC(
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
- 1,
264
+ 22,
293
265
  OpSchema()
294
- .SetDoc(RandomUniformLike_ver1_doc)
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::all_tensor_types(),
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* RandomNormalLike_ver1_doc = R"DOC(
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
- 1,
310
+ 22,
342
311
  OpSchema()
343
- .SetDoc(RandomNormalLike_ver1_doc)
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::all_tensor_types(),
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* Multinomial_ver7_doc = R"DOC(
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
- 7,
351
+ 22,
386
352
  OpSchema()
387
- .SetDoc(Multinomial_ver7_doc)
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* Bernoulli_ver15_doc = R"DOC(
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
- 15,
539
+ 22,
577
540
  OpSchema()
578
- .SetDoc(Bernoulli_ver15_doc)
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
- {"tensor(float16)",
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)
@@ -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.