Supported ONNX operators#

OnnxAbs

OnnxComMicrosoftQGemm_1

OnnxMaxUnpool_9

OnnxAbs_1

OnnxComMicrosoftQLinearAdd

OnnxMax_1

OnnxAbs_13

OnnxComMicrosoftQLinearAdd_1

OnnxMax_12

OnnxAbs_6

OnnxComMicrosoftQLinearAveragePool

OnnxMax_13

OnnxAcos

OnnxComMicrosoftQLinearAveragePool_1

OnnxMax_6

OnnxAcos_7

OnnxComMicrosoftQLinearConcat

OnnxMax_8

OnnxAcosh

OnnxComMicrosoftQLinearConcat_1

OnnxMean

OnnxAcosh_9

OnnxComMicrosoftQLinearConv

OnnxMeanVarianceNormalization

OnnxAdd

OnnxComMicrosoftQLinearConv_1

OnnxMeanVarianceNormalization_13

OnnxAdd_1

OnnxComMicrosoftQLinearGlobalAveragePool

OnnxMeanVarianceNormalization_9

OnnxAdd_13

OnnxComMicrosoftQLinearGlobalAveragePool_1

OnnxMean_1

OnnxAdd_14

OnnxComMicrosoftQLinearLeakyRelu

OnnxMean_13

OnnxAdd_6

OnnxComMicrosoftQLinearLeakyRelu_1

OnnxMean_6

OnnxAdd_7

OnnxComMicrosoftQLinearMul

OnnxMean_8

OnnxAiOnnxMlArrayFeatureExtractor

OnnxComMicrosoftQLinearMul_1

OnnxMelWeightMatrix

OnnxAiOnnxMlArrayFeatureExtractor_1

OnnxComMicrosoftQLinearReduceMean

OnnxMelWeightMatrix_17

OnnxAiOnnxMlBinarizer

OnnxComMicrosoftQLinearReduceMean_1

OnnxMin

OnnxAiOnnxMlBinarizer_1

OnnxComMicrosoftQLinearSigmoid

OnnxMin_1

OnnxAiOnnxMlCastMap

OnnxComMicrosoftQLinearSigmoid_1

OnnxMin_12

OnnxAiOnnxMlCastMap_1

OnnxComMicrosoftQuantizeLinear

OnnxMin_13

OnnxAiOnnxMlCategoryMapper

OnnxComMicrosoftQuantizeLinear_1

OnnxMin_6

OnnxAiOnnxMlCategoryMapper_1

OnnxComMicrosoftRange

OnnxMin_8

OnnxAiOnnxMlDictVectorizer

OnnxComMicrosoftRange_1

OnnxMish

OnnxAiOnnxMlDictVectorizer_1

OnnxComMicrosoftRecordEvent

OnnxMish_18

OnnxAiOnnxMlFeatureVectorizer

OnnxComMicrosoftRecordEvent_1

OnnxMod

OnnxAiOnnxMlFeatureVectorizer_1

OnnxComMicrosoftRecv

OnnxMod_10

OnnxAiOnnxMlImputer

OnnxComMicrosoftRecv_1

OnnxMod_13

OnnxAiOnnxMlImputer_1

OnnxComMicrosoftReduceAllL2

OnnxMul

OnnxAiOnnxMlLabelEncoder

OnnxComMicrosoftReduceAllL2_1

OnnxMul_1

OnnxAiOnnxMlLabelEncoder_1

OnnxComMicrosoftReduceSumInteger

OnnxMul_13

OnnxAiOnnxMlLabelEncoder_2

OnnxComMicrosoftReduceSumInteger_1

OnnxMul_14

OnnxAiOnnxMlLinearClassifier

OnnxComMicrosoftReduceSumTraining

OnnxMul_6

OnnxAiOnnxMlLinearClassifier_1

OnnxComMicrosoftReduceSumTraining_1

OnnxMul_7

OnnxAiOnnxMlLinearRegressor

OnnxComMicrosoftReluGrad

OnnxMultinomial

OnnxAiOnnxMlLinearRegressor_1

OnnxComMicrosoftReluGrad_1

OnnxMultinomial_7

OnnxAiOnnxMlNormalizer

OnnxComMicrosoftRfft

OnnxNeg

OnnxAiOnnxMlNormalizer_1

OnnxComMicrosoftRfft_1

OnnxNeg_1

OnnxAiOnnxMlOneHotEncoder

OnnxComMicrosoftSGDOptimizer

OnnxNeg_13

OnnxAiOnnxMlOneHotEncoder_1

OnnxComMicrosoftSGDOptimizer_1

OnnxNeg_6

OnnxAiOnnxMlSVMClassifier

OnnxComMicrosoftSampleOp

OnnxNegativeLogLikelihoodLoss

OnnxAiOnnxMlSVMClassifier_1

OnnxComMicrosoftSampleOp_1

OnnxNegativeLogLikelihoodLoss_12

OnnxAiOnnxMlSVMRegressor

OnnxComMicrosoftScale

OnnxNegativeLogLikelihoodLoss_13

OnnxAiOnnxMlSVMRegressor_1

OnnxComMicrosoftScale_1

OnnxNonMaxSuppression

OnnxAiOnnxMlScaler

OnnxComMicrosoftSend

OnnxNonMaxSuppression_10

OnnxAiOnnxMlScaler_1

OnnxComMicrosoftSend_1

OnnxNonMaxSuppression_11

OnnxAiOnnxMlTreeEnsembleClassifier

OnnxComMicrosoftSigmoidGrad

OnnxNonZero

OnnxAiOnnxMlTreeEnsembleClassifier_1

OnnxComMicrosoftSigmoidGrad_1

OnnxNonZero_13

OnnxAiOnnxMlTreeEnsembleClassifier_3

OnnxComMicrosoftSimplifiedLayerNormalizationGrad

OnnxNonZero_9

OnnxAiOnnxMlTreeEnsembleRegressor

OnnxComMicrosoftSimplifiedLayerNormalizationGrad_1

OnnxNot

OnnxAiOnnxMlTreeEnsembleRegressor_1

OnnxComMicrosoftSkipLayerNormalization

OnnxNot_1

OnnxAiOnnxMlTreeEnsembleRegressor_3

OnnxComMicrosoftSkipLayerNormalization_1

OnnxOneHot

OnnxAiOnnxMlZipMap

OnnxComMicrosoftSliceGrad

OnnxOneHot_11

OnnxAiOnnxMlZipMap_1

OnnxComMicrosoftSliceGrad_1

OnnxOneHot_9

OnnxAiOnnxPreviewTrainingAdagrad

OnnxComMicrosoftSnpe

OnnxOptional

OnnxAiOnnxPreviewTrainingAdagrad_1

OnnxComMicrosoftSnpe_1

OnnxOptionalGetElement

OnnxAiOnnxPreviewTrainingAdam

OnnxComMicrosoftSoftmaxCrossEntropy

OnnxOptionalGetElement_15

OnnxAiOnnxPreviewTrainingAdam_1

OnnxComMicrosoftSoftmaxCrossEntropyGrad

OnnxOptionalGetElement_18

OnnxAiOnnxPreviewTrainingGradient

OnnxComMicrosoftSoftmaxCrossEntropyGrad_1

OnnxOptionalHasElement

OnnxAiOnnxPreviewTrainingGradient_1

OnnxComMicrosoftSoftmaxCrossEntropyLossGrad

OnnxOptionalHasElement_15

OnnxAiOnnxPreviewTrainingMomentum

OnnxComMicrosoftSoftmaxCrossEntropyLossGrad_1

OnnxOptionalHasElement_18

OnnxAiOnnxPreviewTrainingMomentum_1

OnnxComMicrosoftSoftmaxCrossEntropyLossInternal

OnnxOptional_15

OnnxAnd

OnnxComMicrosoftSoftmaxCrossEntropyLossInternalGrad

OnnxOr

OnnxAnd_1

OnnxComMicrosoftSoftmaxCrossEntropyLossInternalGrad_1

OnnxOr_1

OnnxAnd_7

OnnxComMicrosoftSoftmaxCrossEntropyLossInternal_1

OnnxOr_7

OnnxArgMax

OnnxComMicrosoftSoftmaxCrossEntropy_1

OnnxOrgPytorchAtenATen

OnnxArgMax_1

OnnxComMicrosoftSoftmaxGrad

OnnxOrgPytorchAtenATen_1

OnnxArgMax_11

OnnxComMicrosoftSoftmaxGrad_1

OnnxPRelu

OnnxArgMax_12

OnnxComMicrosoftSoftmaxGrad_13

OnnxPRelu_1

OnnxArgMax_13

OnnxComMicrosoftSoftmaxGrad_13_1

OnnxPRelu_16

OnnxArgMin

OnnxComMicrosoftSparseToDenseMatMul

OnnxPRelu_6

OnnxArgMin_1

OnnxComMicrosoftSparseToDenseMatMul_1

OnnxPRelu_7

OnnxArgMin_11

OnnxComMicrosoftSplitTraining

OnnxPRelu_9

OnnxArgMin_12

OnnxComMicrosoftSplitTraining_1

OnnxPad

OnnxArgMin_13

OnnxComMicrosoftSummaryHistogram

OnnxPad_1

OnnxAsin

OnnxComMicrosoftSummaryHistogram_1

OnnxPad_11

OnnxAsin_7

OnnxComMicrosoftSummaryMerge

OnnxPad_13

OnnxAsinh

OnnxComMicrosoftSummaryMerge_1

OnnxPad_18

OnnxAsinh_9

OnnxComMicrosoftSummaryScalar

OnnxPad_2

OnnxAtan

OnnxComMicrosoftSummaryScalar_1

OnnxPow

OnnxAtan_7

OnnxComMicrosoftSummaryText

OnnxPow_1

OnnxAtanh

OnnxComMicrosoftSummaryText_1

OnnxPow_12

OnnxAtanh_9

OnnxComMicrosoftTanhGrad

OnnxPow_13

OnnxAveragePool

OnnxComMicrosoftTanhGrad_1

OnnxPow_15

OnnxAveragePool_1

OnnxComMicrosoftTokenizer

OnnxPow_7

OnnxAveragePool_10

OnnxComMicrosoftTokenizer_1

OnnxQLinearConv

OnnxAveragePool_11

OnnxComMicrosoftTorchEmbedding

OnnxQLinearConv_10

OnnxAveragePool_7

OnnxComMicrosoftTorchEmbedding_1

OnnxQLinearMatMul

OnnxBatchNormalization

OnnxComMicrosoftTransposeMatMul

OnnxQLinearMatMul_10

OnnxBatchNormalization_1

OnnxComMicrosoftTransposeMatMul_1

OnnxQuantizeLinear

OnnxBatchNormalization_14

OnnxComMicrosoftTrilu

OnnxQuantizeLinear_10

OnnxBatchNormalization_15

OnnxComMicrosoftTrilu_1

OnnxQuantizeLinear_13

OnnxBatchNormalization_6

OnnxComMicrosoftUnique

OnnxRNN

OnnxBatchNormalization_7

OnnxComMicrosoftUnique_1

OnnxRNN_1

OnnxBatchNormalization_9

OnnxComMicrosoftView

OnnxRNN_14

OnnxBernoulli

OnnxComMicrosoftView_1

OnnxRNN_7

OnnxBernoulli_15

OnnxComMicrosoftWaitEvent

OnnxRandomNormal

OnnxBitShift

OnnxComMicrosoftWaitEvent_1

OnnxRandomNormalLike

OnnxBitShift_11

OnnxComMicrosoftWordConvEmbedding

OnnxRandomNormalLike_1

OnnxBitwiseAnd

OnnxComMicrosoftWordConvEmbedding_1

OnnxRandomNormal_1

OnnxBitwiseAnd_18

OnnxComMicrosoftYieldOp

OnnxRandomUniform

OnnxBitwiseNot

OnnxComMicrosoftYieldOp_1

OnnxRandomUniformLike

OnnxBitwiseNot_18

OnnxComMicrosoftZeroGradient

OnnxRandomUniformLike_1

OnnxBitwiseOr

OnnxComMicrosoftZeroGradient_1

OnnxRandomUniform_1

OnnxBitwiseOr_18

OnnxComMsInternalNhwcConv

OnnxRange

OnnxBitwiseXor

OnnxComMsInternalNhwcConv_11

OnnxRange_11

OnnxBitwiseXor_18

OnnxComMsInternalNhwcMaxPool

OnnxReciprocal

OnnxBlackmanWindow

OnnxComMsInternalNhwcMaxPool_11

OnnxReciprocal_1

OnnxBlackmanWindow_17

OnnxCompress

OnnxReciprocal_13

OnnxCast

OnnxCompress_11

OnnxReciprocal_6

OnnxCastLike

OnnxCompress_9

OnnxReduceL1

OnnxCastLike_15

OnnxConcat

OnnxReduceL1_1

OnnxCast_1

OnnxConcatFromSequence

OnnxReduceL1_11

OnnxCast_13

OnnxConcatFromSequence_11

OnnxReduceL1_13

OnnxCast_6

OnnxConcat_1

OnnxReduceL1_18

OnnxCast_9

OnnxConcat_11

OnnxReduceL2

OnnxCeil

OnnxConcat_13

OnnxReduceL2_1

OnnxCeil_1

OnnxConcat_4

OnnxReduceL2_11

OnnxCeil_13

OnnxConstant

OnnxReduceL2_13

OnnxCeil_6

OnnxConstantOfShape

OnnxReduceL2_18

OnnxCelu

OnnxConstantOfShape_9

OnnxReduceLogSum

OnnxCelu_12

OnnxConstant_1

OnnxReduceLogSumExp

OnnxCenterCropPad

OnnxConstant_11

OnnxReduceLogSumExp_1

OnnxCenterCropPad_18

OnnxConstant_12

OnnxReduceLogSumExp_11

OnnxClip

OnnxConstant_13

OnnxReduceLogSumExp_13

OnnxClip_1

OnnxConstant_9

OnnxReduceLogSumExp_18

OnnxClip_11

OnnxConv

OnnxReduceLogSum_1

OnnxClip_12

OnnxConvInteger

OnnxReduceLogSum_11

OnnxClip_13

OnnxConvInteger_10

OnnxReduceLogSum_13

OnnxClip_6

OnnxConvTranspose

OnnxReduceLogSum_18

OnnxCol2Im

OnnxConvTranspose_1

OnnxReduceMax

OnnxCol2Im_18

OnnxConvTranspose_11

OnnxReduceMax_1

OnnxComMicrosoftAdamOptimizer

OnnxConv_1

OnnxReduceMax_11

OnnxComMicrosoftAdamOptimizer_1

OnnxConv_11

OnnxReduceMax_12

OnnxComMicrosoftAdamWOptimizer

OnnxCos

OnnxReduceMax_13

OnnxComMicrosoftAdamWOptimizer_1

OnnxCos_7

OnnxReduceMax_18

OnnxComMicrosoftAdasumAllReduce

OnnxCosh

OnnxReduceMean

OnnxComMicrosoftAdasumAllReduce_1

OnnxCosh_9

OnnxReduceMean_1

OnnxComMicrosoftAll

OnnxCumSum

OnnxReduceMean_11

OnnxComMicrosoftAll_1

OnnxCumSum_11

OnnxReduceMean_13

OnnxComMicrosoftAttention

OnnxCumSum_14

OnnxReduceMean_18

OnnxComMicrosoftAttention_1

OnnxDFT

OnnxReduceMin

OnnxComMicrosoftAttnLSTM

OnnxDFT_17

OnnxReduceMin_1

OnnxComMicrosoftAttnLSTM_1

OnnxDepthToSpace

OnnxReduceMin_11

OnnxComMicrosoftBatchNormInternal

OnnxDepthToSpace_1

OnnxReduceMin_12

OnnxComMicrosoftBatchNormInternal_1

OnnxDepthToSpace_11

OnnxReduceMin_13

OnnxComMicrosoftBatchNormalizationGrad

OnnxDepthToSpace_13

OnnxReduceMin_18

OnnxComMicrosoftBatchNormalizationGrad_1

OnnxDequantizeLinear

OnnxReduceProd

OnnxComMicrosoftBeamSearch

OnnxDequantizeLinear_10

OnnxReduceProd_1

OnnxComMicrosoftBeamSearch_1

OnnxDequantizeLinear_13

OnnxReduceProd_11

OnnxComMicrosoftBiasDropout

OnnxDet

OnnxReduceProd_13

OnnxComMicrosoftBiasDropout_1

OnnxDet_11

OnnxReduceProd_18

OnnxComMicrosoftBiasFastGeluGrad_dX

OnnxDiv

OnnxReduceSum

OnnxComMicrosoftBiasFastGeluGrad_dX_1

OnnxDiv_1

OnnxReduceSumSquare

OnnxComMicrosoftBiasGelu

OnnxDiv_13

OnnxReduceSumSquare_1

OnnxComMicrosoftBiasGeluGrad_dX

OnnxDiv_14

OnnxReduceSumSquare_11

OnnxComMicrosoftBiasGeluGrad_dX_1

OnnxDiv_6

OnnxReduceSumSquare_13

OnnxComMicrosoftBiasGelu_1

OnnxDiv_7

OnnxReduceSumSquare_18

OnnxComMicrosoftBiasSoftmax

OnnxDropout

OnnxReduceSum_1

OnnxComMicrosoftBiasSoftmax_1

OnnxDropout_1

OnnxReduceSum_11

OnnxComMicrosoftBifurcationDetector

OnnxDropout_10

OnnxReduceSum_13

OnnxComMicrosoftBifurcationDetector_1

OnnxDropout_12

OnnxRelu

OnnxComMicrosoftBitmaskBiasDropout

OnnxDropout_13

OnnxRelu_1

OnnxComMicrosoftBitmaskBiasDropout_1

OnnxDropout_6

OnnxRelu_13

OnnxComMicrosoftBitmaskDropout

OnnxDropout_7

OnnxRelu_14

OnnxComMicrosoftBitmaskDropoutGrad

OnnxDynamicQuantizeLinear

OnnxRelu_6

OnnxComMicrosoftBitmaskDropoutGrad_1

OnnxDynamicQuantizeLinear_11

OnnxReshape

OnnxComMicrosoftBitmaskDropout_1

OnnxEinsum

OnnxReshape_1

OnnxComMicrosoftBroadcastGradientArgs

OnnxEinsum_12

OnnxReshape_13

OnnxComMicrosoftBroadcastGradientArgs_1

OnnxElu

OnnxReshape_14

OnnxComMicrosoftCDist

OnnxElu_1

OnnxReshape_5

OnnxComMicrosoftCDist_1

OnnxElu_6

OnnxResize

OnnxComMicrosoftComplexMul

OnnxEqual

OnnxResize_10

OnnxComMicrosoftComplexMulConj

OnnxEqual_1

OnnxResize_11

OnnxComMicrosoftComplexMulConj_1

OnnxEqual_11

OnnxResize_13

OnnxComMicrosoftComplexMul_1

OnnxEqual_13

OnnxResize_18

OnnxComMicrosoftConcatTraining

OnnxEqual_7

OnnxReverseSequence

OnnxComMicrosoftConcatTraining_1

OnnxErf

OnnxReverseSequence_10

OnnxComMicrosoftConvGrad

OnnxErf_13

OnnxRoiAlign

OnnxComMicrosoftConvGrad_1

OnnxErf_9

OnnxRoiAlign_10

OnnxComMicrosoftConvTransposeWithDynamicPads

OnnxExp

OnnxRoiAlign_16

OnnxComMicrosoftConvTransposeWithDynamicPads_1

OnnxExp_1

OnnxRound

OnnxComMicrosoftCropAndResize

OnnxExp_13

OnnxRound_11

OnnxComMicrosoftCropAndResize_1

OnnxExp_6

OnnxSTFT

OnnxComMicrosoftDecoderAttention

OnnxExpand

OnnxSTFT_17

OnnxComMicrosoftDecoderAttention_1

OnnxExpand_13

OnnxScan

OnnxComMicrosoftDequantizeLinear

OnnxExpand_8

OnnxScan_11

OnnxComMicrosoftDequantizeLinear_1

OnnxEyeLike

OnnxScan_16

OnnxComMicrosoftDivGrad

OnnxEyeLike_9

OnnxScan_8

OnnxComMicrosoftDivGrad_1

OnnxFlatten

OnnxScan_9

OnnxComMicrosoftDropoutGrad

OnnxFlatten_1

OnnxScatter

OnnxComMicrosoftDropoutGrad_1

OnnxFlatten_11

OnnxScatterElements

OnnxComMicrosoftDynamicQuantizeLSTM

OnnxFlatten_13

OnnxScatterElements_11

OnnxComMicrosoftDynamicQuantizeLSTM_1

OnnxFlatten_9

OnnxScatterElements_13

OnnxComMicrosoftDynamicQuantizeMatMul

OnnxFloor

OnnxScatterElements_16

OnnxComMicrosoftDynamicQuantizeMatMul_1

OnnxFloor_1

OnnxScatterElements_18

OnnxComMicrosoftEmbedLayerNormalization

OnnxFloor_13

OnnxScatterND

OnnxComMicrosoftEmbedLayerNormalization_1

OnnxFloor_6

OnnxScatterND_11

OnnxComMicrosoftExpandDims

OnnxGRU

OnnxScatterND_13

OnnxComMicrosoftExpandDims_1

OnnxGRU_1

OnnxScatterND_16

OnnxComMicrosoftFastGelu

OnnxGRU_14

OnnxScatterND_18

OnnxComMicrosoftFastGeluGrad

OnnxGRU_3

OnnxScatter_11

OnnxComMicrosoftFastGeluGrad_1

OnnxGRU_7

OnnxScatter_9

OnnxComMicrosoftFastGelu_1

OnnxGather

OnnxSelu

OnnxComMicrosoftFusedConv

OnnxGatherElements

OnnxSelu_1

OnnxComMicrosoftFusedConv_1

OnnxGatherElements_11

OnnxSelu_6

OnnxComMicrosoftFusedGemm

OnnxGatherElements_13

OnnxSequenceAt

OnnxComMicrosoftFusedGemm_1

OnnxGatherND

OnnxSequenceAt_11

OnnxComMicrosoftFusedMatMul

OnnxGatherND_11

OnnxSequenceConstruct

OnnxComMicrosoftFusedMatMul_1

OnnxGatherND_12

OnnxSequenceConstruct_11

OnnxComMicrosoftGatherElementsGrad

OnnxGatherND_13

OnnxSequenceEmpty

OnnxComMicrosoftGatherElementsGrad_1

OnnxGather_1

OnnxSequenceEmpty_11

OnnxComMicrosoftGatherGrad

OnnxGather_11

OnnxSequenceErase

OnnxComMicrosoftGatherGrad_1

OnnxGather_13

OnnxSequenceErase_11

OnnxComMicrosoftGatherND

OnnxGemm

OnnxSequenceInsert

OnnxComMicrosoftGatherNDGrad

OnnxGemm_1

OnnxSequenceInsert_11

OnnxComMicrosoftGatherNDGrad_1

OnnxGemm_11

OnnxSequenceLength

OnnxComMicrosoftGatherND_1

OnnxGemm_13

OnnxSequenceLength_11

OnnxComMicrosoftGelu

OnnxGemm_6

OnnxSequenceMap

OnnxComMicrosoftGeluGrad

OnnxGemm_7

OnnxSequenceMap_17

OnnxComMicrosoftGeluGrad_1

OnnxGemm_9

OnnxShape

OnnxComMicrosoftGelu_1

OnnxGlobalAveragePool

OnnxShape_1

OnnxComMicrosoftGistBinarizeDecoder

OnnxGlobalAveragePool_1

OnnxShape_13

OnnxComMicrosoftGistBinarizeDecoder_1

OnnxGlobalLpPool

OnnxShape_15

OnnxComMicrosoftGistBinarizeEncoder

OnnxGlobalLpPool_1

OnnxShrink

OnnxComMicrosoftGistBinarizeEncoder_1

OnnxGlobalLpPool_2

OnnxShrink_9

OnnxComMicrosoftGistPack16Decoder

OnnxGlobalMaxPool

OnnxSigmoid

OnnxComMicrosoftGistPack16Decoder_1

OnnxGlobalMaxPool_1

OnnxSigmoid_1

OnnxComMicrosoftGistPack16Encoder

OnnxGreater

OnnxSigmoid_13

OnnxComMicrosoftGistPack16Encoder_1

OnnxGreaterOrEqual

OnnxSigmoid_6

OnnxComMicrosoftGistPack1Decoder

OnnxGreaterOrEqual_12

OnnxSign

OnnxComMicrosoftGistPack1Decoder_1

OnnxGreaterOrEqual_16

OnnxSign_13

OnnxComMicrosoftGistPack1Encoder

OnnxGreater_1

OnnxSign_9

OnnxComMicrosoftGistPack1Encoder_1

OnnxGreater_13

OnnxSin

OnnxComMicrosoftGistPack8Decoder

OnnxGreater_7

OnnxSin_7

OnnxComMicrosoftGistPack8Decoder_1

OnnxGreater_9

OnnxSinh

OnnxComMicrosoftGistPack8Encoder

OnnxGridSample

OnnxSinh_9

OnnxComMicrosoftGistPack8Encoder_1

OnnxGridSample_16

OnnxSize

OnnxComMicrosoftGistPackMsfp15Decoder

OnnxGroupNormalization

OnnxSize_1

OnnxComMicrosoftGistPackMsfp15Decoder_1

OnnxGroupNormalization_18

OnnxSize_13

OnnxComMicrosoftGistPackMsfp15Encoder

OnnxHammingWindow

OnnxSlice

OnnxComMicrosoftGistPackMsfp15Encoder_1

OnnxHammingWindow_17

OnnxSlice_1

OnnxComMicrosoftGridSample

OnnxHannWindow

OnnxSlice_10

OnnxComMicrosoftGridSample_1

OnnxHannWindow_17

OnnxSlice_11

OnnxComMicrosoftGroup

OnnxHardSigmoid

OnnxSlice_13

OnnxComMicrosoftGroup_1

OnnxHardSigmoid_1

OnnxSoftmax

OnnxComMicrosoftInPlaceAccumulator

OnnxHardSigmoid_6

OnnxSoftmaxCrossEntropyLoss

OnnxComMicrosoftInPlaceAccumulator_1

OnnxHardSwish

OnnxSoftmaxCrossEntropyLoss_12

OnnxComMicrosoftInverse

OnnxHardSwish_14

OnnxSoftmaxCrossEntropyLoss_13

OnnxComMicrosoftInverse_1

OnnxHardmax

OnnxSoftmax_1

OnnxComMicrosoftInvertibleLayerNormalizationGrad

OnnxHardmax_1

OnnxSoftmax_11

OnnxComMicrosoftInvertibleLayerNormalizationGrad_1

OnnxHardmax_11

OnnxSoftmax_13

OnnxComMicrosoftIrfft

OnnxHardmax_13

OnnxSoftplus

OnnxComMicrosoftIrfft_1

OnnxIdentity

OnnxSoftplus_1

OnnxComMicrosoftIsAllFinite

OnnxIdentity_1

OnnxSoftsign

OnnxComMicrosoftIsAllFinite_1

OnnxIdentity_13

OnnxSoftsign_1

OnnxComMicrosoftIsFinite

OnnxIdentity_14

OnnxSpaceToDepth

OnnxComMicrosoftIsFinite_1

OnnxIdentity_16

OnnxSpaceToDepth_1

OnnxComMicrosoftLambOptimizer

OnnxIf

OnnxSpaceToDepth_13

OnnxComMicrosoftLambOptimizer_1

OnnxIf_1

OnnxSplit

OnnxComMicrosoftLayerNormalizationGrad

OnnxIf_11

OnnxSplitToSequence

OnnxComMicrosoftLayerNormalizationGrad_1

OnnxIf_13

OnnxSplitToSequence_11

OnnxComMicrosoftLogSoftmaxGrad

OnnxIf_16

OnnxSplit_1

OnnxComMicrosoftLogSoftmaxGrad_1

OnnxInstanceNormalization

OnnxSplit_11

OnnxComMicrosoftLogSoftmaxGrad_13

OnnxInstanceNormalization_1

OnnxSplit_13

OnnxComMicrosoftLogSoftmaxGrad_13_1

OnnxInstanceNormalization_6

OnnxSplit_18

OnnxComMicrosoftLongformerAttention

OnnxIsInf

OnnxSplit_2

OnnxComMicrosoftLongformerAttention_1

OnnxIsInf_10

OnnxSqrt

OnnxComMicrosoftMatMulInteger16

OnnxIsNaN

OnnxSqrt_1

OnnxComMicrosoftMatMulInteger16_1

OnnxIsNaN_13

OnnxSqrt_13

OnnxComMicrosoftMatMulIntegerToFloat

OnnxIsNaN_9

OnnxSqrt_6

OnnxComMicrosoftMatMulIntegerToFloat_1

OnnxLRN

OnnxSqueeze

OnnxComMicrosoftMaxpoolWithMask

OnnxLRN_1

OnnxSqueeze_1

OnnxComMicrosoftMaxpoolWithMask_1

OnnxLRN_13

OnnxSqueeze_11

OnnxComMicrosoftMegatronF

OnnxLSTM

OnnxSqueeze_13

OnnxComMicrosoftMegatronF_1

OnnxLSTM_1

OnnxStringNormalizer

OnnxComMicrosoftMegatronG

OnnxLSTM_14

OnnxStringNormalizer_10

OnnxComMicrosoftMegatronG_1

OnnxLSTM_7

OnnxSub

OnnxComMicrosoftMixedPrecisionScale

OnnxLayerNormalization

OnnxSub_1

OnnxComMicrosoftMixedPrecisionScale_1

OnnxLayerNormalization_17

OnnxSub_13

OnnxComMicrosoftMulInteger

OnnxLeakyRelu

OnnxSub_14

OnnxComMicrosoftMulInteger_1

OnnxLeakyRelu_1

OnnxSub_6

OnnxComMicrosoftMurmurHash3

OnnxLeakyRelu_16

OnnxSub_7

OnnxComMicrosoftMurmurHash3_1

OnnxLeakyRelu_6

OnnxSum

OnnxComMicrosoftNGramRepeatBlock

OnnxLess

OnnxSum_1

OnnxComMicrosoftNGramRepeatBlock_1

OnnxLessOrEqual

OnnxSum_13

OnnxComMicrosoftNcclAllGather

OnnxLessOrEqual_12

OnnxSum_6

OnnxComMicrosoftNcclAllGather_1

OnnxLessOrEqual_16

OnnxSum_8

OnnxComMicrosoftNcclAllReduce

OnnxLess_1

OnnxTan

OnnxComMicrosoftNcclAllReduce_1

OnnxLess_13

OnnxTan_7

OnnxComMicrosoftNcclReduceScatter

OnnxLess_7

OnnxTanh

OnnxComMicrosoftNcclReduceScatter_1

OnnxLess_9

OnnxTanh_1

OnnxComMicrosoftNchwcAveragePool

OnnxLog

OnnxTanh_13

OnnxComMicrosoftNchwcAveragePool_1

OnnxLogSoftmax

OnnxTanh_6

OnnxComMicrosoftNchwcConv

OnnxLogSoftmax_1

OnnxTfIdfVectorizer

OnnxComMicrosoftNchwcConv_1

OnnxLogSoftmax_11

OnnxTfIdfVectorizer_9

OnnxComMicrosoftNchwcGlobalAveragePool

OnnxLogSoftmax_13

OnnxThresholdedRelu

OnnxComMicrosoftNchwcGlobalAveragePool_1

OnnxLog_1

OnnxThresholdedRelu_10

OnnxComMicrosoftNchwcGlobalMaxPool

OnnxLog_13

OnnxTile

OnnxComMicrosoftNchwcGlobalMaxPool_1

OnnxLog_6

OnnxTile_1

OnnxComMicrosoftNchwcMaxPool

OnnxLoop

OnnxTile_13

OnnxComMicrosoftNchwcMaxPool_1

OnnxLoop_1

OnnxTile_6

OnnxComMicrosoftNchwcReorderInput

OnnxLoop_11

OnnxTopK

OnnxComMicrosoftNchwcReorderInput_1

OnnxLoop_13

OnnxTopK_1

OnnxComMicrosoftNchwcReorderOutput

OnnxLoop_16

OnnxTopK_10

OnnxComMicrosoftNchwcReorderOutput_1

OnnxLpNormalization

OnnxTopK_11

OnnxComMicrosoftNchwcUpsample

OnnxLpNormalization_1

OnnxTranspose

OnnxComMicrosoftNchwcUpsample_1

OnnxLpPool

OnnxTranspose_1

OnnxComMicrosoftNegativeLogLikelihoodLossInternal

OnnxLpPool_1

OnnxTranspose_13

OnnxComMicrosoftNegativeLogLikelihoodLossInternal2

OnnxLpPool_11

OnnxTrilu

OnnxComMicrosoftNegativeLogLikelihoodLossInternal2_1

OnnxLpPool_18

OnnxTrilu_14

OnnxComMicrosoftNegativeLogLikelihoodLossInternal_1

OnnxLpPool_2

OnnxUnique

OnnxComMicrosoftNhwcConv

OnnxMatMul

OnnxUnique_11

OnnxComMicrosoftNhwcConv_1

OnnxMatMulInteger

OnnxUnsqueeze

OnnxComMicrosoftNhwcMaxPool

OnnxMatMulInteger_10

OnnxUnsqueeze_1

OnnxComMicrosoftNhwcMaxPool_1

OnnxMatMul_1

OnnxUnsqueeze_11

OnnxComMicrosoftPad

OnnxMatMul_13

OnnxUnsqueeze_13

OnnxComMicrosoftPad_1

OnnxMatMul_9

OnnxUpsample

OnnxComMicrosoftPassThrough

OnnxMax

OnnxUpsample_10

OnnxComMicrosoftPassThrough_1

OnnxMaxPool

OnnxUpsample_7

OnnxComMicrosoftPythonOp

OnnxMaxPool_1

OnnxUpsample_9

OnnxComMicrosoftPythonOpGrad

OnnxMaxPool_10

OnnxWhere

OnnxComMicrosoftPythonOpGrad_1

OnnxMaxPool_11

OnnxWhere_16

OnnxComMicrosoftPythonOp_1

OnnxMaxPool_12

OnnxWhere_9

OnnxComMicrosoftQAttention

OnnxMaxPool_8

OnnxXor

OnnxComMicrosoftQAttention_1

OnnxMaxRoiPool

OnnxXor_1

OnnxComMicrosoftQEmbedLayerNormalization

OnnxMaxRoiPool_1

OnnxXor_7

OnnxComMicrosoftQEmbedLayerNormalization_1

OnnxMaxUnpool

OnnxComMicrosoftQGemm

OnnxMaxUnpool_11

OnnxAbs#

class mlprodict.npy.xop_auto_import_.OnnxAbs(*args, **kwargs)#

Version

  • name: Abs (GitHub)

  • domain: main

  • since_version: 13

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 13.

Summary

Absolute takes one input data (Tensor<T>) and produces one output data (Tensor<T>) where the absolute is, y = abs(x), is applied to the tensor elementwise.

Inputs

  • X (heterogeneous) - T: Input tensor

Outputs

  • Y (heterogeneous) - T: Output tensor

Type Constraints

  • T in ( tensor(bfloat16), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) ): Constrain input and output types to all numeric tensors.

OnnxAbs_1#

class mlprodict.npy.xop_auto_import_.OnnxAbs_1(*args, **kwargs)#

Version

  • name: Abs (GitHub)

  • domain: main

  • since_version: 1

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: False

This version of the operator has been available since version 1.

Summary

Absolute takes one input data (Tensor<T>) and produces one output data (Tensor<T>) where the absolute is, y = abs(x), is applied to the tensor elementwise.

Attributes

  • consumed_inputs: legacy optimization attribute.

Inputs

  • X (heterogeneous) - T: Input tensor

Outputs

  • Y (heterogeneous) - T: Output tensor

Type Constraints

  • T in ( tensor(double), tensor(float), tensor(float16) ): Constrain input and output types to float tensors.

OnnxAbs_13#

class mlprodict.npy.xop_auto_import_.OnnxAbs_13(*args, **kwargs)#

Version

  • name: Abs (GitHub)

  • domain: main

  • since_version: 13

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 13.

Summary

Absolute takes one input data (Tensor<T>) and produces one output data (Tensor<T>) where the absolute is, y = abs(x), is applied to the tensor elementwise.

Inputs

  • X (heterogeneous) - T: Input tensor

Outputs

  • Y (heterogeneous) - T: Output tensor

Type Constraints

  • T in ( tensor(bfloat16), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) ): Constrain input and output types to all numeric tensors.

OnnxAbs_6#

class mlprodict.npy.xop_auto_import_.OnnxAbs_6(*args, **kwargs)#

Version

  • name: Abs (GitHub)

  • domain: main

  • since_version: 6

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 6.

Summary

Absolute takes one input data (Tensor<T>) and produces one output data (Tensor<T>) where the absolute is, y = abs(x), is applied to the tensor elementwise.

Inputs

  • X (heterogeneous) - T: Input tensor

Outputs

  • Y (heterogeneous) - T: Output tensor

Type Constraints

  • T in ( tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) ): Constrain input and output types to all numeric tensors.

OnnxAcos#

class mlprodict.npy.xop_auto_import_.OnnxAcos(*args, **kwargs)#

Version

  • name: Acos (GitHub)

  • domain: main

  • since_version: 7

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 7.

Summary

Calculates the arccosine (inverse of cosine) of the given input tensor, element-wise.

Inputs

  • input (heterogeneous) - T: Input tensor

Outputs

  • output (heterogeneous) - T: The arccosine of the input tensor computed element-wise

Type Constraints

  • T in ( tensor(double), tensor(float), tensor(float16) ): Constrain input and output types to float tensors.

OnnxAcos_7#

class mlprodict.npy.xop_auto_import_.OnnxAcos_7(*args, **kwargs)#

Version

  • name: Acos (GitHub)

  • domain: main

  • since_version: 7

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 7.

Summary

Calculates the arccosine (inverse of cosine) of the given input tensor, element-wise.

Inputs

  • input (heterogeneous) - T: Input tensor

Outputs

  • output (heterogeneous) - T: The arccosine of the input tensor computed element-wise

Type Constraints

  • T in ( tensor(double), tensor(float), tensor(float16) ): Constrain input and output types to float tensors.

OnnxAcosh#

class mlprodict.npy.xop_auto_import_.OnnxAcosh(*args, **kwargs)#

Version

  • name: Acosh (GitHub)

  • domain: main

  • since_version: 9

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 9.

Summary

Calculates the hyperbolic arccosine of the given input tensor element-wise.

Inputs

  • input (heterogeneous) - T: Input tensor

Outputs

  • output (heterogeneous) - T: The hyperbolic arccosine values of the input tensor computed element-wise

Type Constraints

  • T in ( tensor(double), tensor(float), tensor(float16) ): Constrain input and output types to float tensors.

OnnxAcosh_9#

class mlprodict.npy.xop_auto_import_.OnnxAcosh_9(*args, **kwargs)#

Version

  • name: Acosh (GitHub)

  • domain: main

  • since_version: 9

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 9.

Summary

Calculates the hyperbolic arccosine of the given input tensor element-wise.

Inputs

  • input (heterogeneous) - T: Input tensor

Outputs

  • output (heterogeneous) - T: The hyperbolic arccosine values of the input tensor computed element-wise

Type Constraints

  • T in ( tensor(double), tensor(float), tensor(float16) ): Constrain input and output types to float tensors.

OnnxAdd#

class mlprodict.npy.xop_auto_import_.OnnxAdd(*args, **kwargs)#

Version

  • name: Add (GitHub)

  • domain: main

  • since_version: 14

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 14.

Summary

Performs element-wise binary addition (with Numpy-style broadcasting support).

This operator supports multidirectional (i.e., Numpy-style) broadcasting; for more details please check Broadcasting in ONNX.

(Opset 14 change): Extend supported types to include uint8, int8, uint16, and int16.

Inputs

  • A (heterogeneous) - T: First operand.

  • B (heterogeneous) - T: Second operand.

Outputs

  • C (heterogeneous) - T: Result, has same element type as two inputs

Type Constraints

  • T in ( tensor(bfloat16), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) ): Constrain input and output types to all numeric tensors.

OnnxAdd_1#

class mlprodict.npy.xop_auto_import_.OnnxAdd_1(*args, **kwargs)#

Version

  • name: Add (GitHub)

  • domain: main

  • since_version: 1

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: False

This version of the operator has been available since version 1.

Summary

Performs element-wise binary addition (with limited broadcast support).

If necessary the right-hand-side argument will be broadcasted to match the shape of left-hand-side argument. When broadcasting is specified, the second tensor can either be of element size 1 (including a scalar tensor and any tensor with rank equal to or smaller than the first tensor), or having its shape as a contiguous subset of the first tensor’s shape. The starting of the mutually equal shape is specified by the argument “axis”, and if it is not set, suffix matching is assumed. 1-dim expansion doesn’t work yet.

For example, the following tensor shapes are supported (with broadcast=1):

shape(A) = (2, 3, 4, 5), shape(B) = (,), i.e. B is a scalar tensor shape(A) = (2, 3, 4, 5), shape(B) = (1, 1), i.e. B is an 1-element tensor shape(A) = (2, 3, 4, 5), shape(B) = (5,) shape(A) = (2, 3, 4, 5), shape(B) = (4, 5) shape(A) = (2, 3, 4, 5), shape(B) = (3, 4), with axis=1 shape(A) = (2, 3, 4, 5), shape(B) = (2), with axis=0

Attribute broadcast=1 needs to be passed to enable broadcasting.

Attributes

  • axis: If set, defines the broadcast dimensions. See doc for details.

  • broadcast: Pass 1 to enable broadcasting Default value is 0.

  • consumed_inputs: legacy optimization attribute.

Inputs

  • A (heterogeneous) - T: First operand, should share the type with the second operand.

  • B (heterogeneous) - T: Second operand. With broadcasting can be of smaller size than A. If broadcasting is disabled it should be of the same size.

Outputs

  • C (heterogeneous) - T: Result, has same dimensions and type as A

Type Constraints

  • T in ( tensor(double), tensor(float), tensor(float16) ): Constrain input and output types to float tensors.

OnnxAdd_13#

class mlprodict.npy.xop_auto_import_.OnnxAdd_13(*args, **kwargs)#

Version

  • name: Add (GitHub)

  • domain: main

  • since_version: 13

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 13.

Summary

Performs element-wise binary addition (with Numpy-style broadcasting support).

This operator supports multidirectional (i.e., Numpy-style) broadcasting; for more details please check Broadcasting in ONNX.

Inputs

  • A (heterogeneous) - T: First operand.

  • B (heterogeneous) - T: Second operand.

Outputs

  • C (heterogeneous) - T: Result, has same element type as two inputs

Type Constraints

  • T in ( tensor(bfloat16), tensor(double), tensor(float), tensor(float16), tensor(int32), tensor(int64), tensor(uint32), tensor(uint64) ): Constrain input and output types to high-precision numeric tensors.

OnnxAdd_14#

class mlprodict.npy.xop_auto_import_.OnnxAdd_14(*args, **kwargs)#

Version

  • name: Add (GitHub)

  • domain: main

  • since_version: 14

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 14.

Summary

Performs element-wise binary addition (with Numpy-style broadcasting support).

This operator supports multidirectional (i.e., Numpy-style) broadcasting; for more details please check Broadcasting in ONNX.

(Opset 14 change): Extend supported types to include uint8, int8, uint16, and int16.

Inputs

  • A (heterogeneous) - T: First operand.

  • B (heterogeneous) - T: Second operand.

Outputs

  • C (heterogeneous) - T: Result, has same element type as two inputs

Type Constraints

  • T in ( tensor(bfloat16), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) ): Constrain input and output types to all numeric tensors.

OnnxAdd_6#

class mlprodict.npy.xop_auto_import_.OnnxAdd_6(*args, **kwargs)#

Version

  • name: Add (GitHub)

  • domain: main

  • since_version: 6

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 6.

Summary

Performs element-wise binary addition (with limited broadcast support).

If necessary the right-hand-side argument will be broadcasted to match the shape of left-hand-side argument. When broadcasting is specified, the second tensor can either be of element size 1 (including a scalar tensor and any tensor with rank equal to or smaller than the first tensor), or having its shape as a contiguous subset of the first tensor’s shape. The starting of the mutually equal shape is specified by the argument “axis”, and if it is not set, suffix matching is assumed. 1-dim expansion doesn’t work yet.

For example, the following tensor shapes are supported (with broadcast=1):

shape(A) = (2, 3, 4, 5), shape(B) = (,), i.e. B is a scalar tensor shape(A) = (2, 3, 4, 5), shape(B) = (1, 1), i.e. B is an 1-element tensor shape(A) = (2, 3, 4, 5), shape(B) = (5,) shape(A) = (2, 3, 4, 5), shape(B) = (4, 5) shape(A) = (2, 3, 4, 5), shape(B) = (3, 4), with axis=1 shape(A) = (2, 3, 4, 5), shape(B) = (2), with axis=0

Attribute broadcast=1 needs to be passed to enable broadcasting.

Attributes

  • axis: If set, defines the broadcast dimensions. See doc for details.

  • broadcast: Pass 1 to enable broadcasting Default value is 0.

Inputs

  • A (heterogeneous) - T: First operand, should share the type with the second operand.

  • B (heterogeneous) - T: Second operand. With broadcasting can be of smaller size than A. If broadcasting is disabled it should be of the same size.

Outputs

  • C (heterogeneous) - T: Result, has same dimensions and type as A

Type Constraints

  • T in ( tensor(double), tensor(float), tensor(float16), tensor(int32), tensor(int64), tensor(uint32), tensor(uint64) ): Constrain input and output types to high-precision numeric tensors.

OnnxAdd_7#

class mlprodict.npy.xop_auto_import_.OnnxAdd_7(*args, **kwargs)#

Version

  • name: Add (GitHub)

  • domain: main

  • since_version: 7

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 7.

Summary

Performs element-wise binary addition (with Numpy-style broadcasting support).

This operator supports multidirectional (i.e., Numpy-style) broadcasting; for more details please check Broadcasting in ONNX.

Inputs

  • A (heterogeneous) - T: First operand.

  • B (heterogeneous) - T: Second operand.

Outputs

  • C (heterogeneous) - T: Result, has same element type as two inputs

Type Constraints

  • T in ( tensor(double), tensor(float), tensor(float16), tensor(int32), tensor(int64), tensor(uint32), tensor(uint64) ): Constrain input and output types to high-precision numeric tensors.

OnnxAiOnnxMlArrayFeatureExtractor#

class mlprodict.npy.xop_auto_import_.OnnxAiOnnxMlArrayFeatureExtractor(*args, **kwargs)#

Version

This version of the operator has been available since version 1 of domain ai.onnx.ml.

Summary

Select elements of the input tensor based on the indices passed.

The indices are applied to the last axes of the tensor.

Inputs

  • X (heterogeneous) - T: Data to be selected

  • Y (heterogeneous) - tensor(int64): The indices, based on 0 as the first index of any dimension.

Outputs

  • Z (heterogeneous) - T: Selected output data as an array

Type Constraints

  • T in ( tensor(double), tensor(float), tensor(int32), tensor(int64), tensor(string) ): The input must be a tensor of a numeric type or string. The output will be of the same tensor type.

OnnxAiOnnxMlArrayFeatureExtractor_1#

class mlprodict.npy.xop_auto_import_.OnnxAiOnnxMlArrayFeatureExtractor_1(*args, **kwargs)#

Version

This version of the operator has been available since version 1 of domain ai.onnx.ml.

Summary

Select elements of the input tensor based on the indices passed.

The indices are applied to the last axes of the tensor.

Inputs

  • X (heterogeneous) - T: Data to be selected

  • Y (heterogeneous) - tensor(int64): The indices, based on 0 as the first index of any dimension.

Outputs

  • Z (heterogeneous) - T: Selected output data as an array

Type Constraints

  • T in ( tensor(double), tensor(float), tensor(int32), tensor(int64), tensor(string) ): The input must be a tensor of a numeric type or string. The output will be of the same tensor type.

OnnxAiOnnxMlBinarizer#

class mlprodict.npy.xop_auto_import_.OnnxAiOnnxMlBinarizer(*args, **kwargs)#

Version

  • name: Binarizer (GitHub)

  • domain: ai.onnx.ml

  • since_version: 1

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: False

This version of the operator has been available since version 1 of domain ai.onnx.ml.

Summary

Maps the values of the input tensor to either 0 or 1, element-wise, based on the outcome of a comparison against a threshold value.

Attributes

  • threshold: Values greater than this are mapped to 1, others to 0. Default value is 0.0.

Inputs

  • X (heterogeneous) - T: Data to be binarized

Outputs

  • Y (heterogeneous) - T: Binarized output data

Type Constraints

  • T in ( tensor(double), tensor(float), tensor(int32), tensor(int64) ): The input must be a tensor of a numeric type. The output will be of the same tensor type.

OnnxAiOnnxMlBinarizer_1#

class mlprodict.npy.xop_auto_import_.OnnxAiOnnxMlBinarizer_1(*args, **kwargs)#

Version

  • name: Binarizer (GitHub)

  • domain: ai.onnx.ml

  • since_version: 1

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: False

This version of the operator has been available since version 1 of domain ai.onnx.ml.

Summary

Maps the values of the input tensor to either 0 or 1, element-wise, based on the outcome of a comparison against a threshold value.

Attributes

  • threshold: Values greater than this are mapped to 1, others to 0. Default value is 0.0.

Inputs

  • X (heterogeneous) - T: Data to be binarized

Outputs

  • Y (heterogeneous) - T: Binarized output data

Type Constraints

  • T in ( tensor(double), tensor(float), tensor(int32), tensor(int64) ): The input must be a tensor of a numeric type. The output will be of the same tensor type.

OnnxAiOnnxMlCastMap#

class mlprodict.npy.xop_auto_import_.OnnxAiOnnxMlCastMap(*args, **kwargs)#

Version

  • name: CastMap (GitHub)

  • domain: ai.onnx.ml

  • since_version: 1

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 1 of domain ai.onnx.ml.

Summary

Converts a map to a tensor. The map key must be an int64 and the values will be ordered in ascending order based on this key. The operator supports dense packing or sparse packing. If using sparse packing, the key cannot exceed the max_map-1 value.

Attributes

  • cast_to: A string indicating the desired element type of the output tensor, one of ‘TO_FLOAT’, ‘TO_STRING’, ‘TO_INT64’. Default value is 'TO_FLOAT'.

  • map_form: Indicates whether to only output as many values as are in the input (dense), or position the input based on using the key of the map as the index of the output (sparse).<br>One of ‘DENSE’, ‘SPARSE’. Default value is 'DENSE'.

  • max_map: If the value of map_form is ‘SPARSE,’ this attribute indicates the total length of the output tensor. Default value is 1.

Inputs

  • X (heterogeneous) - T1: The input map that is to be cast to a tensor

Outputs

  • Y (heterogeneous) - T2: A tensor representing the same data as the input map, ordered by their keys

Type Constraints

  • T1 in ( map(int64, float), map(int64, string) ): The input must be an integer map to either string or float.

  • T2 in ( tensor(float), tensor(int64), tensor(string) ): The output is a 1-D tensor of string, float, or integer.

OnnxAiOnnxMlCastMap_1#

class mlprodict.npy.xop_auto_import_.OnnxAiOnnxMlCastMap_1(*args, **kwargs)#

Version

  • name: CastMap (GitHub)

  • domain: ai.onnx.ml

  • since_version: 1

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 1 of domain ai.onnx.ml.

Summary

Converts a map to a tensor. The map key must be an int64 and the values will be ordered in ascending order based on this key. The operator supports dense packing or sparse packing. If using sparse packing, the key cannot exceed the max_map-1 value.

Attributes

  • cast_to: A string indicating the desired element type of the output tensor, one of ‘TO_FLOAT’, ‘TO_STRING’, ‘TO_INT64’. Default value is 'TO_FLOAT'.

  • map_form: Indicates whether to only output as many values as are in the input (dense), or position the input based on using the key of the map as the index of the output (sparse).<br>One of ‘DENSE’, ‘SPARSE’. Default value is 'DENSE'.

  • max_map: If the value of map_form is ‘SPARSE,’ this attribute indicates the total length of the output tensor. Default value is 1.

Inputs

  • X (heterogeneous) - T1: The input map that is to be cast to a tensor

Outputs

  • Y (heterogeneous) - T2: A tensor representing the same data as the input map, ordered by their keys

Type Constraints

  • T1 in ( map(int64, float), map(int64, string) ): The input must be an integer map to either string or float.

  • T2 in ( tensor(float), tensor(int64), tensor(string) ): The output is a 1-D tensor of string, float, or integer.

OnnxAiOnnxMlCategoryMapper#

class mlprodict.npy.xop_auto_import_.OnnxAiOnnxMlCategoryMapper(*args, **kwargs)#

Version

  • name: CategoryMapper (GitHub)

  • domain: ai.onnx.ml

  • since_version: 1

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 1 of domain ai.onnx.ml.

Summary

Converts strings to integers and vice versa.

Two sequences of equal length are used to map between integers and strings, with strings and integers at the same index detailing the mapping.

Each operator converts either integers to strings or strings to integers, depending on which default value attribute is provided. Only one default value attribute should be defined.

If the string default value is set, it will convert integers to strings. If the int default value is set, it will convert strings to integers.

Attributes

  • cats_int64s: The integers of the map. This sequence must be the same length as the ‘cats_strings’ sequence.

  • cats_strings: The strings of the map. This sequence must be the same length as the ‘cats_int64s’ sequence

  • default_int64: An integer to use when an input string value is not found in the map.<br>One and only one of the ‘default_*’ attributes must be defined. Default value is -1.

  • default_string: A string to use when an input integer value is not found in the map.<br>One and only one of the ‘default_*’ attributes must be defined. Default value is '_Unused'.

Inputs

  • X (heterogeneous) - T1: Input data

Outputs

  • Y (heterogeneous) - T2: Output data. If strings are input, the output values are integers, and vice versa.

Type Constraints

  • T1 in ( tensor(int64), tensor(string) ): The input must be a tensor of strings or integers, either [N,C] or [C].

  • T2 in ( tensor(int64), tensor(string) ): The output is a tensor of strings or integers. Its shape will be the same as the input shape.

OnnxAiOnnxMlCategoryMapper_1#

class mlprodict.npy.xop_auto_import_.OnnxAiOnnxMlCategoryMapper_1(*args, **kwargs)#

Version

  • name: CategoryMapper (GitHub)

  • domain: ai.onnx.ml

  • since_version: 1

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 1 of domain ai.onnx.ml.

Summary

Converts strings to integers and vice versa.

Two sequences of equal length are used to map between integers and strings, with strings and integers at the same index detailing the mapping.

Each operator converts either integers to strings or strings to integers, depending on which default value attribute is provided. Only one default value attribute should be defined.

If the string default value is set, it will convert integers to strings. If the int default value is set, it will convert strings to integers.

Attributes

  • cats_int64s: The integers of the map. This sequence must be the same length as the ‘cats_strings’ sequence.

  • cats_strings: The strings of the map. This sequence must be the same length as the ‘cats_int64s’ sequence

  • default_int64: An integer to use when an input string value is not found in the map.<br>One and only one of the ‘default_*’ attributes must be defined. Default value is -1.

  • default_string: A string to use when an input integer value is not found in the map.<br>One and only one of the ‘default_*’ attributes must be defined. Default value is '_Unused'.

Inputs

  • X (heterogeneous) - T1: Input data

Outputs

  • Y (heterogeneous) - T2: Output data. If strings are input, the output values are integers, and vice versa.

Type Constraints

  • T1 in ( tensor(int64), tensor(string) ): The input must be a tensor of strings or integers, either [N,C] or [C].

  • T2 in ( tensor(int64), tensor(string) ): The output is a tensor of strings or integers. Its shape will be the same as the input shape.

OnnxAiOnnxMlDictVectorizer#

class mlprodict.npy.xop_auto_import_.OnnxAiOnnxMlDictVectorizer(*args, **kwargs)#

Version

  • name: DictVectorizer (GitHub)

  • domain: ai.onnx.ml

  • since_version: 1

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 1 of domain ai.onnx.ml.

Summary

Uses an index mapping to convert a dictionary to an array.

Given a dictionary, each key is looked up in the vocabulary attribute corresponding to the key type. The index into the vocabulary array at which the key is found is then used to index the output 1-D tensor ‘Y’ and insert into it the value found in the dictionary ‘X’.

The key type of the input map must correspond to the element type of the defined vocabulary attribute. Therefore, the output array will be equal in length to the index mapping vector parameter. All keys in the input dictionary must be present in the index mapping vector. For each item in the input dictionary, insert its value in the output array. Any keys not present in the input dictionary, will be zero in the output array.

For example: if the string_vocabulary parameter is set to ["a", "c", "b", "z"], then an input of {"a": 4, "c": 8} will produce an output of [4, 8, 0, 0].

Attributes

  • int64_vocabulary: An integer vocabulary array.<br>One and only one of the vocabularies must be defined.

  • string_vocabulary: A string vocabulary array.<br>One and only one of the vocabularies must be defined.

Inputs

  • X (heterogeneous) - T1: A dictionary.

Outputs

  • Y (heterogeneous) - T2: A 1-D tensor holding values from the input dictionary.

Type Constraints

  • T1 in ( map(int64, double), map(int64, float), map(int64, string), map(string, double), map(string, float), map(string, int64) ): The input must be a map from strings or integers to either strings or a numeric type. The key and value types cannot be the same.

  • T2 in ( tensor(double), tensor(float), tensor(int64), tensor(string) ): The output will be a tensor of the value type of the input map. It’s shape will be [1,C], where C is the length of the input dictionary.

OnnxAiOnnxMlDictVectorizer_1#

class mlprodict.npy.xop_auto_import_.OnnxAiOnnxMlDictVectorizer_1(*args, **kwargs)#

Version

  • name: DictVectorizer (GitHub)

  • domain: ai.onnx.ml

  • since_version: 1

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 1 of domain ai.onnx.ml.

Summary

Uses an index mapping to convert a dictionary to an array.

Given a dictionary, each key is looked up in the vocabulary attribute corresponding to the key type. The index into the vocabulary array at which the key is found is then used to index the output 1-D tensor ‘Y’ and insert into it the value found in the dictionary ‘X’.

The key type of the input map must correspond to the element type of the defined vocabulary attribute. Therefore, the output array will be equal in length to the index mapping vector parameter. All keys in the input dictionary must be present in the index mapping vector. For each item in the input dictionary, insert its value in the output array. Any keys not present in the input dictionary, will be zero in the output array.

For example: if the string_vocabulary parameter is set to ["a", "c", "b", "z"], then an input of {"a": 4, "c": 8} will produce an output of [4, 8, 0, 0].

Attributes

  • int64_vocabulary: An integer vocabulary array.<br>One and only one of the vocabularies must be defined.

  • string_vocabulary: A string vocabulary array.<br>One and only one of the vocabularies must be defined.

Inputs

  • X (heterogeneous) - T1: A dictionary.

Outputs

  • Y (heterogeneous) - T2: A 1-D tensor holding values from the input dictionary.

Type Constraints

  • T1 in ( map(int64, double), map(int64, float), map(int64, string), map(string, double), map(string, float), map(string, int64) ): The input must be a map from strings or integers to either strings or a numeric type. The key and value types cannot be the same.

  • T2 in ( tensor(double), tensor(float), tensor(int64), tensor(string) ): The output will be a tensor of the value type of the input map. It’s shape will be [1,C], where C is the length of the input dictionary.

OnnxAiOnnxMlFeatureVectorizer#

class mlprodict.npy.xop_auto_import_.OnnxAiOnnxMlFeatureVectorizer(*args, **kwargs)#

Version

  • name: FeatureVectorizer (GitHub)

  • domain: ai.onnx.ml

  • since_version: 1

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: False

This version of the operator has been available since version 1 of domain ai.onnx.ml.

Summary

Concatenates input tensors into one continuous output.

All input shapes are 2-D and are concatenated along the second dimention. 1-D tensors are treated as [1,C]. Inputs are copied to the output maintaining the order of the input arguments.

All inputs must be integers or floats, while the output will be all floating point values.

Attributes

  • inputdimensions: The size of each input in the input list

Inputs

Between 1 and 2147483647 inputs.

  • X (variadic, heterogeneous) - T1: An ordered collection of tensors, all with the same element type.

Outputs

  • Y (heterogeneous) - tensor(float): The output array, elements ordered as the inputs.

Type Constraints

  • T1 in ( tensor(double), tensor(float), tensor(int32), tensor(int64) ): The input type must be a tensor of a numeric type.

OnnxAiOnnxMlFeatureVectorizer_1#

class mlprodict.npy.xop_auto_import_.OnnxAiOnnxMlFeatureVectorizer_1(*args, **kwargs)#

Version

  • name: FeatureVectorizer (GitHub)

  • domain: ai.onnx.ml

  • since_version: 1

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: False

This version of the operator has been available since version 1 of domain ai.onnx.ml.

Summary

Concatenates input tensors into one continuous output.

All input shapes are 2-D and are concatenated along the second dimention. 1-D tensors are treated as [1,C]. Inputs are copied to the output maintaining the order of the input arguments.

All inputs must be integers or floats, while the output will be all floating point values.

Attributes

  • inputdimensions: The size of each input in the input list

Inputs

Between 1 and 2147483647 inputs.

  • X (variadic, heterogeneous) - T1: An ordered collection of tensors, all with the same element type.

Outputs

  • Y (heterogeneous) - tensor(float): The output array, elements ordered as the inputs.

Type Constraints

  • T1 in ( tensor(double), tensor(float), tensor(int32), tensor(int64) ): The input type must be a tensor of a numeric type.

OnnxAiOnnxMlImputer#

class mlprodict.npy.xop_auto_import_.OnnxAiOnnxMlImputer(*args, **kwargs)#

Version

  • name: Imputer (GitHub)

  • domain: ai.onnx.ml

  • since_version: 1

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: False

This version of the operator has been available since version 1 of domain ai.onnx.ml.

Summary

Replaces inputs that equal one value with another, leaving all other elements alone.

This operator is typically used to replace missing values in situations where they have a canonical representation, such as -1, 0, NaN, or some extreme value.

One and only one of imputed_value_floats or imputed_value_int64s should be defined – floats if the input tensor holds floats, integers if the input tensor holds integers. The imputed values must all fit within the width of the tensor element type. One and only one of the replaced_value_float or replaced_value_int64 should be defined, which one depends on whether floats or integers are being processed.

The imputed_value attribute length can be 1 element, or it can have one element per input feature. In other words, if the input tensor has the shape [*,F], then the length of the attribute array may be 1 or F. If it is 1, then it is broadcast along the last dimension and applied to each feature.

Attributes

  • imputed_value_floats: Value(s) to change to

  • imputed_value_int64s: Value(s) to change to.

  • replaced_value_float: A value that needs replacing. Default value is 0.0.

  • replaced_value_int64: A value that needs replacing. Default value is 0.

Inputs

  • X (heterogeneous) - T: Data to be processed.

Outputs

  • Y (heterogeneous) - T: Imputed output data

Type Constraints

  • T in ( tensor(double), tensor(float), tensor(int32), tensor(int64) ): The input type must be a tensor of a numeric type, either [N,C] or [C]. The output type will be of the same tensor type and shape.

OnnxAiOnnxMlImputer_1#

class mlprodict.npy.xop_auto_import_.OnnxAiOnnxMlImputer_1(*args, **kwargs)#

Version

  • name: Imputer (GitHub)

  • domain: ai.onnx.ml

  • since_version: 1

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: False

This version of the operator has been available since version 1 of domain ai.onnx.ml.

Summary

Replaces inputs that equal one value with another, leaving all other elements alone.

This operator is typically used to replace missing values in situations where they have a canonical representation, such as -1, 0, NaN, or some extreme value.

One and only one of imputed_value_floats or imputed_value_int64s should be defined – floats if the input tensor holds floats, integers if the input tensor holds integers. The imputed values must all fit within the width of the tensor element type. One and only one of the replaced_value_float or replaced_value_int64 should be defined, which one depends on whether floats or integers are being processed.

The imputed_value attribute length can be 1 element, or it can have one element per input feature. In other words, if the input tensor has the shape [*,F], then the length of the attribute array may be 1 or F. If it is 1, then it is broadcast along the last dimension and applied to each feature.

Attributes

  • imputed_value_floats: Value(s) to change to

  • imputed_value_int64s: Value(s) to change to.

  • replaced_value_float: A value that needs replacing. Default value is 0.0.

  • replaced_value_int64: A value that needs replacing. Default value is 0.

Inputs

  • X (heterogeneous) - T: Data to be processed.

Outputs

  • Y (heterogeneous) - T: Imputed output data

Type Constraints

  • T in ( tensor(double), tensor(float), tensor(int32), tensor(int64) ): The input type must be a tensor of a numeric type, either [N,C] or [C]. The output type will be of the same tensor type and shape.

OnnxAiOnnxMlLabelEncoder#

class mlprodict.npy.xop_auto_import_.OnnxAiOnnxMlLabelEncoder(*args, **kwargs)#

Version

  • name: LabelEncoder (GitHub)

  • domain: ai.onnx.ml

  • since_version: 2

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 2 of domain ai.onnx.ml.

Summary

Maps each element in the input tensor to another value.

The mapping is determined by the two parallel attributes, ‘keys_*’ and ‘values_*’ attribute. The i-th value in the specified ‘keys_*’ attribute would be mapped to the i-th value in the specified ‘values_*’ attribute. It implies that input’s element type and the element type of the specified ‘keys_*’ should be identical while the output type is identical to the specified ‘values_*’ attribute. If an input element can not be found in the specified ‘keys_*’ attribute, the ‘default_*’ that matches the specified ‘values_*’ attribute may be used as its output value.

Let’s consider an example which maps a string tensor to an integer tensor. Assume and ‘keys_strings’ is [“Amy”, “Sally”], ‘values_int64s’ is [5, 6], and ‘default_int64’ is ‘-1’. The input [“Dori”, “Amy”, “Amy”, “Sally”, “Sally”] would be mapped to [-1, 5, 5, 6, 6].

Since this operator is an one-to-one mapping, its input and output shapes are the same. Notice that only one of ‘keys_*’/’values_*’ can be set.

For key look-up, bit-wise comparison is used so even a float NaN can be mapped to a value in ‘values_*’ attribute.

Attributes

  • default_float: A float. Default value is -0.0.

  • default_int64: An integer. Default value is -1.

  • default_string: A string. Default value is '_Unused'.

  • keys_floats: A list of floats.

  • keys_int64s: A list of ints.

  • keys_strings: A list of strings. One and only one of ‘keys_*’s should be set.

  • values_floats: A list of floats.

  • values_int64s: A list of ints.

  • values_strings: A list of strings. One and only one of ‘value_*’s should be set.

Inputs

  • X (heterogeneous) - T1: Input data. It can be either tensor or scalar.

Outputs

  • Y (heterogeneous) - T2: Output data.

Type Constraints

  • T1 in ( tensor(float), tensor(int64), tensor(string) ): The input type is a tensor of any shape.

  • T2 in ( tensor(float), tensor(int64), tensor(string) ): Output type is determined by the specified ‘values_*’ attribute.

OnnxAiOnnxMlLabelEncoder_1#

class mlprodict.npy.xop_auto_import_.OnnxAiOnnxMlLabelEncoder_1(*args, **kwargs)#

Version

  • name: LabelEncoder (GitHub)

  • domain: ai.onnx.ml

  • since_version: 1

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 1 of domain ai.onnx.ml.

Summary

Converts strings to integers and vice versa.

If the string default value is set, it will convert integers to strings. If the int default value is set, it will convert strings to integers.

Each operator converts either integers to strings or strings to integers, depending on which default value attribute is provided. Only one default value attribute should be defined.

When converting from integers to strings, the string is fetched from the ‘classes_strings’ list, by simple indexing.

When converting from strings to integers, the string is looked up in the list and the index at which it is found is used as the converted value.

Attributes

  • classes_strings: A list of labels.

  • default_int64: An integer to use when an input string value is not found in the map.<br>One and only one of the ‘default_*’ attributes must be defined. Default value is -1.

  • default_string: A string to use when an input integer value is not found in the map.<br>One and only one of the ‘default_*’ attributes must be defined. Default value is '_Unused'.

Inputs

  • X (heterogeneous) - T1: Input data.

Outputs

  • Y (heterogeneous) - T2: Output data. If strings are input, the output values are integers, and vice versa.

Type Constraints

  • T1 in ( tensor(int64), tensor(string) ): The input type must be a tensor of integers or strings, of any shape.

  • T2 in ( tensor(int64), tensor(string) ): The output type will be a tensor of strings or integers, and will have the same shape as the input.

OnnxAiOnnxMlLabelEncoder_2#

class mlprodict.npy.xop_auto_import_.OnnxAiOnnxMlLabelEncoder_2(*args, **kwargs)#

Version

  • name: LabelEncoder (GitHub)

  • domain: ai.onnx.ml

  • since_version: 2

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 2 of domain ai.onnx.ml.

Summary

Maps each element in the input tensor to another value.

The mapping is determined by the two parallel attributes, ‘keys_*’ and ‘values_*’ attribute. The i-th value in the specified ‘keys_*’ attribute would be mapped to the i-th value in the specified ‘values_*’ attribute. It implies that input’s element type and the element type of the specified ‘keys_*’ should be identical while the output type is identical to the specified ‘values_*’ attribute. If an input element can not be found in the specified ‘keys_*’ attribute, the ‘default_*’ that matches the specified ‘values_*’ attribute may be used as its output value.

Let’s consider an example which maps a string tensor to an integer tensor. Assume and ‘keys_strings’ is [“Amy”, “Sally”], ‘values_int64s’ is [5, 6], and ‘default_int64’ is ‘-1’. The input [“Dori”, “Amy”, “Amy”, “Sally”, “Sally”] would be mapped to [-1, 5, 5, 6, 6].

Since this operator is an one-to-one mapping, its input and output shapes are the same. Notice that only one of ‘keys_*’/’values_*’ can be set.

For key look-up, bit-wise comparison is used so even a float NaN can be mapped to a value in ‘values_*’ attribute.

Attributes

  • default_float: A float. Default value is -0.0.

  • default_int64: An integer. Default value is -1.

  • default_string: A string. Default value is '_Unused'.

  • keys_floats: A list of floats.

  • keys_int64s: A list of ints.

  • keys_strings: A list of strings. One and only one of ‘keys_*’s should be set.

  • values_floats: A list of floats.

  • values_int64s: A list of ints.

  • values_strings: A list of strings. One and only one of ‘value_*’s should be set.

Inputs

  • X (heterogeneous) - T1: Input data. It can be either tensor or scalar.

Outputs

  • Y (heterogeneous) - T2: Output data.

Type Constraints

  • T1 in ( tensor(float), tensor(int64), tensor(string) ): The input type is a tensor of any shape.

  • T2 in ( tensor(float), tensor(int64), tensor(string) ): Output type is determined by the specified ‘values_*’ attribute.

OnnxAiOnnxMlLinearClassifier#

class mlprodict.npy.xop_auto_import_.OnnxAiOnnxMlLinearClassifier(*args, **kwargs)#

Version

  • name: LinearClassifier (GitHub)

  • domain: ai.onnx.ml

  • since_version: 1

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 1 of domain ai.onnx.ml.

Summary

Linear classifier

Attributes

  • classlabels_ints: Class labels when using integer labels. One and only one ‘classlabels’ attribute must be defined.

  • classlabels_strings: Class labels when using string labels. One and only one ‘classlabels’ attribute must be defined.

  • coefficients (required): A collection of weights of the model(s).

  • intercepts: A collection of intercepts.

  • multi_class: Indicates whether to do OvR or multinomial (0=OvR is the default). Default value is 0.

  • post_transform: Indicates the transform to apply to the scores vector.<br>One of ‘NONE,’ ‘SOFTMAX,’ ‘LOGISTIC,’ ‘SOFTMAX_ZERO,’ or ‘PROBIT’ Default value is 'NONE'.

Inputs

  • X (heterogeneous) - T1: Data to be classified.

Outputs

  • Y (heterogeneous) - T2: Classification outputs (one class per example).

  • Z (heterogeneous) - tensor(float): Classification scores ([N,E] - one score for each class and example

Type Constraints

  • T1 in ( tensor(double), tensor(float), tensor(int32), tensor(int64) ): The input must be a tensor of a numeric type, and of shape [N,C] or [C]. In the latter case, it will be treated as [1,C]

  • T2 in ( tensor(int64), tensor(string) ): The output will be a tensor of strings or integers.

OnnxAiOnnxMlLinearClassifier_1#

class mlprodict.npy.xop_auto_import_.OnnxAiOnnxMlLinearClassifier_1(*args, **kwargs)#

Version

  • name: LinearClassifier (GitHub)

  • domain: ai.onnx.ml

  • since_version: 1

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 1 of domain ai.onnx.ml.

Summary

Linear classifier

Attributes

  • classlabels_ints: Class labels when using integer labels. One and only one ‘classlabels’ attribute must be defined.

  • classlabels_strings: Class labels when using string labels. One and only one ‘classlabels’ attribute must be defined.

  • coefficients (required): A collection of weights of the model(s).

  • intercepts: A collection of intercepts.

  • multi_class: Indicates whether to do OvR or multinomial (0=OvR is the default). Default value is 0.

  • post_transform: Indicates the transform to apply to the scores vector.<br>One of ‘NONE,’ ‘SOFTMAX,’ ‘LOGISTIC,’ ‘SOFTMAX_ZERO,’ or ‘PROBIT’ Default value is 'NONE'.

Inputs

  • X (heterogeneous) - T1: Data to be classified.

Outputs

  • Y (heterogeneous) - T2: Classification outputs (one class per example).

  • Z (heterogeneous) - tensor(float): Classification scores ([N,E] - one score for each class and example

Type Constraints

  • T1 in ( tensor(double), tensor(float), tensor(int32), tensor(int64) ): The input must be a tensor of a numeric type, and of shape [N,C] or [C]. In the latter case, it will be treated as [1,C]

  • T2 in ( tensor(int64), tensor(string) ): The output will be a tensor of strings or integers.

OnnxAiOnnxMlLinearRegressor#

class mlprodict.npy.xop_auto_import_.OnnxAiOnnxMlLinearRegressor(*args, **kwargs)#

Version

  • name: LinearRegressor (GitHub)

  • domain: ai.onnx.ml

  • since_version: 1

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: False

This version of the operator has been available since version 1 of domain ai.onnx.ml.

Summary

Generalized linear regression evaluation.

If targets is set to 1 (default) then univariate regression is performed.

If targets is set to M then M sets of coefficients must be passed in as a sequence and M results will be output for each input n in N.

The coefficients array is of length n, and the coefficients for each target are contiguous. Intercepts are optional but if provided must match the number of targets.

Attributes

  • coefficients: Weights of the model(s).

  • intercepts: Weights of the intercepts, if used.

  • post_transform: Indicates the transform to apply to the regression output vector.<br>One of ‘NONE,’ ‘SOFTMAX,’ ‘LOGISTIC,’ ‘SOFTMAX_ZERO,’ or ‘PROBIT’ Default value is 'NONE'.

  • targets: The total number of regression targets, 1 if not defined. Default value is 1.

Inputs

  • X (heterogeneous) - T: Data to be regressed.

Outputs

  • Y (heterogeneous) - tensor(float): Regression outputs (one per target, per example).

Type Constraints

  • T in ( tensor(double), tensor(float), tensor(int32), tensor(int64) ): The input must be a tensor of a numeric type.

OnnxAiOnnxMlLinearRegressor_1#

class mlprodict.npy.xop_auto_import_.OnnxAiOnnxMlLinearRegressor_1(*args, **kwargs)#

Version

  • name: LinearRegressor (GitHub)

  • domain: ai.onnx.ml

  • since_version: 1

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: False

This version of the operator has been available since version 1 of domain ai.onnx.ml.

Summary

Generalized linear regression evaluation.

If targets is set to 1 (default) then univariate regression is performed.

If targets is set to M then M sets of coefficients must be passed in as a sequence and M results will be output for each input n in N.

The coefficients array is of length n, and the coefficients for each target are contiguous. Intercepts are optional but if provided must match the number of targets.

Attributes

  • coefficients: Weights of the model(s).

  • intercepts: Weights of the intercepts, if used.

  • post_transform: Indicates the transform to apply to the regression output vector.<br>One of ‘NONE,’ ‘SOFTMAX,’ ‘LOGISTIC,’ ‘SOFTMAX_ZERO,’ or ‘PROBIT’ Default value is 'NONE'.

  • targets: The total number of regression targets, 1 if not defined. Default value is 1.

Inputs

  • X (heterogeneous) - T: Data to be regressed.

Outputs

  • Y (heterogeneous) - tensor(float): Regression outputs (one per target, per example).

Type Constraints

  • T in ( tensor(double), tensor(float), tensor(int32), tensor(int64) ): The input must be a tensor of a numeric type.

OnnxAiOnnxMlNormalizer#

class mlprodict.npy.xop_auto_import_.OnnxAiOnnxMlNormalizer(*args, **kwargs)#

Version

  • name: Normalizer (GitHub)

  • domain: ai.onnx.ml

  • since_version: 1

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: False

This version of the operator has been available since version 1 of domain ai.onnx.ml.

Summary

Normalize the input. There are three normalization modes, which have the corresponding formulas, defined using element-wise infix operators ‘/’ and ‘^’ and tensor-wide functions ‘max’ and ‘sum’:

Max: Y = X / max(X)

L1: Y = X / sum(X)

L2: Y = sqrt(X^2 / sum(X^2)}

In all modes, if the divisor is zero, Y == X.

For batches, that is, [N,C] tensors, normalization is done along the C axis. In other words, each row of the batch is normalized independently.

Attributes

  • norm: One of ‘MAX,’ ‘L1,’ ‘L2’ Default value is 'MAX'.

Inputs

  • X (heterogeneous) - T: Data to be encoded, a tensor of shape [N,C] or [C]

Outputs

  • Y (heterogeneous) - tensor(float): Encoded output data

Type Constraints

  • T in ( tensor(double), tensor(float), tensor(int32), tensor(int64) ): The input must be a tensor of a numeric type.

OnnxAiOnnxMlNormalizer_1#

class mlprodict.npy.xop_auto_import_.OnnxAiOnnxMlNormalizer_1(*args, **kwargs)#

Version

  • name: Normalizer (GitHub)

  • domain: ai.onnx.ml

  • since_version: 1

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: False

This version of the operator has been available since version 1 of domain ai.onnx.ml.

Summary

Normalize the input. There are three normalization modes, which have the corresponding formulas, defined using element-wise infix operators ‘/’ and ‘^’ and tensor-wide functions ‘max’ and ‘sum’:

Max: Y = X / max(X)

L1: Y = X / sum(X)

L2: Y = sqrt(X^2 / sum(X^2)}

In all modes, if the divisor is zero, Y == X.

For batches, that is, [N,C] tensors, normalization is done along the C axis. In other words, each row of the batch is normalized independently.

Attributes

  • norm: One of ‘MAX,’ ‘L1,’ ‘L2’ Default value is 'MAX'.

Inputs

  • X (heterogeneous) - T: Data to be encoded, a tensor of shape [N,C] or [C]

Outputs

  • Y (heterogeneous) - tensor(float): Encoded output data

Type Constraints

  • T in ( tensor(double), tensor(float), tensor(int32), tensor(int64) ): The input must be a tensor of a numeric type.

OnnxAiOnnxMlOneHotEncoder#

class mlprodict.npy.xop_auto_import_.OnnxAiOnnxMlOneHotEncoder(*args, **kwargs)#

Version

  • name: OneHotEncoder (GitHub)

  • domain: ai.onnx.ml

  • since_version: 1

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: False

This version of the operator has been available since version 1 of domain ai.onnx.ml.

Summary

Replace each input element with an array of ones and zeros, where a single one is placed at the index of the category that was passed in. The total category count will determine the size of the extra dimension of the output array Y.

For example, if we pass a tensor with a single value of 4, and a category count of 8, the output will be a tensor with [0,0,0,0,1,0,0,0].

This operator assumes every input feature is from the same set of categories.

If the input is a tensor of float, int32, or double, the data will be cast to integers and the cats_int64s category list will be used for the lookups.

Attributes

  • cats_int64s: List of categories, ints.<br>One and only one of the ‘cats_*’ attributes must be defined.

  • cats_strings: List of categories, strings.<br>One and only one of the ‘cats_*’ attributes must be defined.

  • zeros: If true and category is not present, will return all zeros; if false and a category if not found, the operator will fail. Default value is 1.

Inputs

  • X (heterogeneous) - T: Data to be encoded.

Outputs

  • Y (heterogeneous) - tensor(float): Encoded output data, having one more dimension than X.

Type Constraints

  • T in ( tensor(double), tensor(float), tensor(int32), tensor(int64), tensor(string) ): The input must be a tensor of a numeric type.

OnnxAiOnnxMlOneHotEncoder_1#

class mlprodict.npy.xop_auto_import_.OnnxAiOnnxMlOneHotEncoder_1(*args, **kwargs)#

Version

  • name: OneHotEncoder (GitHub)

  • domain: ai.onnx.ml

  • since_version: 1

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: False

This version of the operator has been available since version 1 of domain ai.onnx.ml.

Summary

Replace each input element with an array of ones and zeros, where a single one is placed at the index of the category that was passed in. The total category count will determine the size of the extra dimension of the output array Y.

For example, if we pass a tensor with a single value of 4, and a category count of 8, the output will be a tensor with [0,0,0,0,1,0,0,0].

This operator assumes every input feature is from the same set of categories.

If the input is a tensor of float, int32, or double, the data will be cast to integers and the cats_int64s category list will be used for the lookups.

Attributes

  • cats_int64s: List of categories, ints.<br>One and only one of the ‘cats_*’ attributes must be defined.

  • cats_strings: List of categories, strings.<br>One and only one of the ‘cats_*’ attributes must be defined.

  • zeros: If true and category is not present, will return all zeros; if false and a category if not found, the operator will fail. Default value is 1.

Inputs

  • X (heterogeneous) - T: Data to be encoded.

Outputs

  • Y (heterogeneous) - tensor(float): Encoded output data, having one more dimension than X.

Type Constraints

  • T in ( tensor(double), tensor(float), tensor(int32), tensor(int64), tensor(string) ): The input must be a tensor of a numeric type.

OnnxAiOnnxMlSVMClassifier#

class mlprodict.npy.xop_auto_import_.OnnxAiOnnxMlSVMClassifier(*args, **kwargs)#

Version

  • name: SVMClassifier (GitHub)

  • domain: ai.onnx.ml

  • since_version: 1

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 1 of domain ai.onnx.ml.

Summary

Support Vector Machine classifier

Attributes

  • classlabels_ints: Class labels if using integer labels.<br>One and only one of the ‘classlabels_*’ attributes must be defined.

  • classlabels_strings: Class labels if using string labels.<br>One and only one of the ‘classlabels_*’ attributes must be defined.

  • coefficients:

  • kernel_params: List of 3 elements containing gamma, coef0, and degree, in that order. Zero if unused for the kernel.

  • kernel_type: The kernel type, one of ‘LINEAR,’ ‘POLY,’ ‘RBF,’ ‘SIGMOID’. Default value is 'LINEAR'.

  • post_transform: Indicates the transform to apply to the score. <br>One of ‘NONE,’ ‘SOFTMAX,’ ‘LOGISTIC,’ ‘SOFTMAX_ZERO,’ or ‘PROBIT’ Default value is 'NONE'.

  • prob_a: First set of probability coefficients.

  • prob_b: Second set of probability coefficients. This array must be same size as prob_a.<br>If these are provided then output Z are probability estimates, otherwise they are raw scores.

  • rho:

  • support_vectors:

  • vectors_per_class:

Inputs

  • X (heterogeneous) - T1: Data to be classified.

Outputs

  • Y (heterogeneous) - T2: Classification outputs (one class per example).

  • Z (heterogeneous) - tensor(float): Class scores (one per class per example), if prob_a and prob_b are provided they are probabilities for each class, otherwise they are raw scores.

Type Constraints

  • T1 in ( tensor(double), tensor(float), tensor(int32), tensor(int64) ): The input must be a tensor of a numeric type, either [C] or [N,C].

  • T2 in ( tensor(int64), tensor(string) ): The output type will be a tensor of strings or integers, depending on which of the classlabels_* attributes is used. Its size will match the bactch size of the input.

OnnxAiOnnxMlSVMClassifier_1#

class mlprodict.npy.xop_auto_import_.OnnxAiOnnxMlSVMClassifier_1(*args, **kwargs)#

Version

  • name: SVMClassifier (GitHub)

  • domain: ai.onnx.ml

  • since_version: 1

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 1 of domain ai.onnx.ml.

Summary

Support Vector Machine classifier

Attributes

  • classlabels_ints: Class labels if using integer labels.<br>One and only one of the ‘classlabels_*’ attributes must be defined.

  • classlabels_strings: Class labels if using string labels.<br>One and only one of the ‘classlabels_*’ attributes must be defined.

  • coefficients:

  • kernel_params: List of 3 elements containing gamma, coef0, and degree, in that order. Zero if unused for the kernel.

  • kernel_type: The kernel type, one of ‘LINEAR,’ ‘POLY,’ ‘RBF,’ ‘SIGMOID’. Default value is 'LINEAR'.

  • post_transform: Indicates the transform to apply to the score. <br>One of ‘NONE,’ ‘SOFTMAX,’ ‘LOGISTIC,’ ‘SOFTMAX_ZERO,’ or ‘PROBIT’ Default value is 'NONE'.

  • prob_a: First set of probability coefficients.

  • prob_b: Second set of probability coefficients. This array must be same size as prob_a.<br>If these are provided then output Z are probability estimates, otherwise they are raw scores.

  • rho:

  • support_vectors:

  • vectors_per_class:

Inputs

  • X (heterogeneous) - T1: Data to be classified.

Outputs

  • Y (heterogeneous) - T2: Classification outputs (one class per example).

  • Z (heterogeneous) - tensor(float): Class scores (one per class per example), if prob_a and prob_b are provided they are probabilities for each class, otherwise they are raw scores.

Type Constraints

  • T1 in ( tensor(double), tensor(float), tensor(int32), tensor(int64) ): The input must be a tensor of a numeric type, either [C] or [N,C].

  • T2 in ( tensor(int64), tensor(string) ): The output type will be a tensor of strings or integers, depending on which of the classlabels_* attributes is used. Its size will match the bactch size of the input.

OnnxAiOnnxMlSVMRegressor#

class mlprodict.npy.xop_auto_import_.OnnxAiOnnxMlSVMRegressor(*args, **kwargs)#

Version

  • name: SVMRegressor (GitHub)

  • domain: ai.onnx.ml

  • since_version: 1

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: False

This version of the operator has been available since version 1 of domain ai.onnx.ml.

Summary

Support Vector Machine regression prediction and one-class SVM anomaly detection.

Attributes

  • coefficients: Support vector coefficients.

  • kernel_params: List of 3 elements containing gamma, coef0, and degree, in that order. Zero if unused for the kernel.

  • kernel_type: The kernel type, one of ‘LINEAR,’ ‘POLY,’ ‘RBF,’ ‘SIGMOID’. Default value is 'LINEAR'.

  • n_supports: The number of support vectors. Default value is 0.

  • one_class: Flag indicating whether the regression is a one-class SVM or not. Default value is 0.

  • post_transform: Indicates the transform to apply to the score. <br>One of ‘NONE,’ ‘SOFTMAX,’ ‘LOGISTIC,’ ‘SOFTMAX_ZERO,’ or ‘PROBIT.’ Default value is 'NONE'.

  • rho:

  • support_vectors: Chosen support vectors

Inputs

  • X (heterogeneous) - T: Data to be regressed.

Outputs

  • Y (heterogeneous) - tensor(float): Regression outputs (one score per target per example).

Type Constraints

  • T in ( tensor(double), tensor(float), tensor(int32), tensor(int64) ): The input type must be a tensor of a numeric type, either [C] or [N,C].

OnnxAiOnnxMlSVMRegressor_1#

class mlprodict.npy.xop_auto_import_.OnnxAiOnnxMlSVMRegressor_1(*args, **kwargs)#

Version

  • name: SVMRegressor (GitHub)

  • domain: ai.onnx.ml

  • since_version: 1

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: False

This version of the operator has been available since version 1 of domain ai.onnx.ml.

Summary

Support Vector Machine regression prediction and one-class SVM anomaly detection.

Attributes

  • coefficients: Support vector coefficients.

  • kernel_params: List of 3 elements containing gamma, coef0, and degree, in that order. Zero if unused for the kernel.

  • kernel_type: The kernel type, one of ‘LINEAR,’ ‘POLY,’ ‘RBF,’ ‘SIGMOID’. Default value is 'LINEAR'.

  • n_supports: The number of support vectors. Default value is 0.

  • one_class: Flag indicating whether the regression is a one-class SVM or not. Default value is 0.

  • post_transform: Indicates the transform to apply to the score. <br>One of ‘NONE,’ ‘SOFTMAX,’ ‘LOGISTIC,’ ‘SOFTMAX_ZERO,’ or ‘PROBIT.’ Default value is 'NONE'.

  • rho:

  • support_vectors: Chosen support vectors

Inputs

  • X (heterogeneous) - T: Data to be regressed.

Outputs

  • Y (heterogeneous) - tensor(float): Regression outputs (one score per target per example).

Type Constraints

  • T in ( tensor(double), tensor(float), tensor(int32), tensor(int64) ): The input type must be a tensor of a numeric type, either [C] or [N,C].

OnnxAiOnnxMlScaler#

class mlprodict.npy.xop_auto_import_.OnnxAiOnnxMlScaler(*args, **kwargs)#

Version

  • name: Scaler (GitHub)

  • domain: ai.onnx.ml

  • since_version: 1

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: False

This version of the operator has been available since version 1 of domain ai.onnx.ml.

Summary

Rescale input data, for example to standardize features by removing the mean and scaling to unit variance.

Attributes

  • offset: First, offset by this.<br>Can be length of features in an [N,F] tensor or length 1, in which case it applies to all features, regardless of dimension count.

  • scale: Second, multiply by this.<br>Can be length of features in an [N,F] tensor or length 1, in which case it applies to all features, regardless of dimension count.<br>Must be same length as ‘offset’

Inputs

  • X (heterogeneous) - T: Data to be scaled.

Outputs

  • Y (heterogeneous) - tensor(float): Scaled output data.

Type Constraints

  • T in ( tensor(double), tensor(float), tensor(int32), tensor(int64) ): The input must be a tensor of a numeric type.

OnnxAiOnnxMlScaler_1#

class mlprodict.npy.xop_auto_import_.OnnxAiOnnxMlScaler_1(*args, **kwargs)#

Version

  • name: Scaler (GitHub)

  • domain: ai.onnx.ml

  • since_version: 1

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: False

This version of the operator has been available since version 1 of domain ai.onnx.ml.

Summary

Rescale input data, for example to standardize features by removing the mean and scaling to unit variance.

Attributes

  • offset: First, offset by this.<br>Can be length of features in an [N,F] tensor or length 1, in which case it applies to all features, regardless of dimension count.

  • scale: Second, multiply by this.<br>Can be length of features in an [N,F] tensor or length 1, in which case it applies to all features, regardless of dimension count.<br>Must be same length as ‘offset’

Inputs

  • X (heterogeneous) - T: Data to be scaled.

Outputs

  • Y (heterogeneous) - tensor(float): Scaled output data.

Type Constraints

  • T in ( tensor(double), tensor(float), tensor(int32), tensor(int64) ): The input must be a tensor of a numeric type.

OnnxAiOnnxMlTreeEnsembleClassifier#

class mlprodict.npy.xop_auto_import_.OnnxAiOnnxMlTreeEnsembleClassifier(*args, **kwargs)#

Version

This version of the operator has been available since version 3 of domain ai.onnx.ml.

Summary

Tree Ensemble classifier. Returns the top class for each of N inputs.

The attributes named ‘nodes_X’ form a sequence of tuples, associated by index into the sequences, which must all be of equal length. These tuples define the nodes.

Similarly, all fields prefixed with ‘class_’ are tuples of votes at the leaves. A leaf may have multiple votes, where each vote is weighted by the associated class_weights index.

One and only one of classlabels_strings or classlabels_int64s will be defined. The class_ids are indices into this list. All fields ending with <i>_as_tensor</i> can be used instead of the same parameter without the suffix if the element type is double and not float.

Attributes

  • base_values: Base values for classification, added to final class score; the size must be the same as the classes or can be left unassigned (assumed 0)

  • base_values_as_tensor: Base values for classification, added to final class score; the size must be the same as the classes or can be left unassigned (assumed 0)

  • class_ids: The index of the class list that each weight is for.

  • class_nodeids: node id that this weight is for.

  • class_treeids: The id of the tree that this node is in.

  • class_weights: The weight for the class in class_id.

  • class_weights_as_tensor: The weight for the class in class_id.

  • classlabels_int64s: Class labels if using integer labels.<br>One and only one of the ‘classlabels_*’ attributes must be defined.

  • classlabels_strings: Class labels if using string labels.<br>One and only one of the ‘classlabels_*’ attributes must be defined.

  • nodes_falsenodeids: Child node if expression is false.

  • nodes_featureids: Feature id for each node.

  • nodes_hitrates: Popularity of each node, used for performance and may be omitted.

  • nodes_hitrates_as_tensor: Popularity of each node, used for performance and may be omitted.

  • nodes_missing_value_tracks_true: For each node, define what to do in the presence of a missing value: if a value is missing (NaN), use the ‘true’ or ‘false’ branch based on the value in this array.<br>This attribute may be left undefined, and the defalt value is false (0) for all nodes.

  • nodes_modes: The node kind, that is, the comparison to make at the node. There is no comparison to make at a leaf node.<br>One of ‘BRANCH_LEQ’, ‘BRANCH_LT’, ‘BRANCH_GTE’, ‘BRANCH_GT’, ‘BRANCH_EQ’, ‘BRANCH_NEQ’, ‘LEAF’

  • nodes_nodeids: Node id for each node. Ids may restart at zero for each tree, but it not required to.

  • nodes_treeids: Tree id for each node.

  • nodes_truenodeids: Child node if expression is true.

  • nodes_values: Thresholds to do the splitting on for each node.

  • nodes_values_as_tensor: Thresholds to do the splitting on for each node.

  • post_transform: Indicates the transform to apply to the score. <br> One of ‘NONE,’ ‘SOFTMAX,’ ‘LOGISTIC,’ ‘SOFTMAX_ZERO,’ or ‘PROBIT.’ Default value is 'NONE'.

Inputs

  • X (heterogeneous) - T1: Input of shape [N,F]

Outputs

  • Y (heterogeneous) - T2: N, Top class for each point

  • Z (heterogeneous) - tensor(float): The class score for each class, for each point, a tensor of shape [N,E].

Type Constraints

  • T1 in ( tensor(double), tensor(float), tensor(int32), tensor(int64) ): The input type must be a tensor of a numeric type.

  • T2 in ( tensor(int64), tensor(string) ): The output type will be a tensor of strings or integers, depending on which of the classlabels_* attributes is used.

OnnxAiOnnxMlTreeEnsembleClassifier_1#

class mlprodict.npy.xop_auto_import_.OnnxAiOnnxMlTreeEnsembleClassifier_1(*args, **kwargs)#

Version

This version of the operator has been available since version 1 of domain ai.onnx.ml.

Summary

Tree Ensemble classifier. Returns the top class for each of N inputs.

The attributes named ‘nodes_X’ form a sequence of tuples, associated by index into the sequences, which must all be of equal length. These tuples define the nodes.

Similarly, all fields prefixed with ‘class_’ are tuples of votes at the leaves. A leaf may have multiple votes, where each vote is weighted by the associated class_weights index.

One and only one of classlabels_strings or classlabels_int64s will be defined. The class_ids are indices into this list.

Attributes

  • base_values: Base values for classification, added to final class score; the size must be the same as the classes or can be left unassigned (assumed 0)

  • class_ids: The index of the class list that each weight is for.

  • class_nodeids: node id that this weight is for.

  • class_treeids: The id of the tree that this node is in.

  • class_weights: The weight for the class in class_id.

  • classlabels_int64s: Class labels if using integer labels.<br>One and only one of the ‘classlabels_*’ attributes must be defined.

  • classlabels_strings: Class labels if using string labels.<br>One and only one of the ‘classlabels_*’ attributes must be defined.

  • nodes_falsenodeids: Child node if expression is false.

  • nodes_featureids: Feature id for each node.

  • nodes_hitrates: Popularity of each node, used for performance and may be omitted.

  • nodes_missing_value_tracks_true: For each node, define what to do in the presence of a missing value: if a value is missing (NaN), use the ‘true’ or ‘false’ branch based on the value in this array.<br>This attribute may be left undefined, and the defalt value is false (0) for all nodes.

  • nodes_modes: The node kind, that is, the comparison to make at the node. There is no comparison to make at a leaf node.<br>One of ‘BRANCH_LEQ’, ‘BRANCH_LT’, ‘BRANCH_GTE’, ‘BRANCH_GT’, ‘BRANCH_EQ’, ‘BRANCH_NEQ’, ‘LEAF’

  • nodes_nodeids: Node id for each node. Ids may restart at zero for each tree, but it not required to.

  • nodes_treeids: Tree id for each node.

  • nodes_truenodeids: Child node if expression is true.

  • nodes_values: Thresholds to do the splitting on for each node.

  • post_transform: Indicates the transform to apply to the score. <br> One of ‘NONE,’ ‘SOFTMAX,’ ‘LOGISTIC,’ ‘SOFTMAX_ZERO,’ or ‘PROBIT.’ Default value is 'NONE'.

Inputs

  • X (heterogeneous) - T1: Input of shape [N,F]

Outputs

  • Y (heterogeneous) - T2: N, Top class for each point

  • Z (heterogeneous) - tensor(float): The class score for each class, for each point, a tensor of shape [N,E].

Type Constraints

  • T1 in ( tensor(double), tensor(float), tensor(int32), tensor(int64) ): The input type must be a tensor of a numeric type.

  • T2 in ( tensor(int64), tensor(string) ): The output type will be a tensor of strings or integers, depending on which of the classlabels_* attributes is used.

OnnxAiOnnxMlTreeEnsembleClassifier_3#

class mlprodict.npy.xop_auto_import_.OnnxAiOnnxMlTreeEnsembleClassifier_3(*args, **kwargs)#

Version

This version of the operator has been available since version 3 of domain ai.onnx.ml.

Summary

Tree Ensemble classifier. Returns the top class for each of N inputs.

The attributes named ‘nodes_X’ form a sequence of tuples, associated by index into the sequences, which must all be of equal length. These tuples define the nodes.

Similarly, all fields prefixed with ‘class_’ are tuples of votes at the leaves. A leaf may have multiple votes, where each vote is weighted by the associated class_weights index.

One and only one of classlabels_strings or classlabels_int64s will be defined. The class_ids are indices into this list. All fields ending with <i>_as_tensor</i> can be used instead of the same parameter without the suffix if the element type is double and not float.

Attributes

  • base_values: Base values for classification, added to final class score; the size must be the same as the classes or can be left unassigned (assumed 0)

  • base_values_as_tensor: Base values for classification, added to final class score; the size must be the same as the classes or can be left unassigned (assumed 0)

  • class_ids: The index of the class list that each weight is for.

  • class_nodeids: node id that this weight is for.

  • class_treeids: The id of the tree that this node is in.

  • class_weights: The weight for the class in class_id.

  • class_weights_as_tensor: The weight for the class in class_id.

  • classlabels_int64s: Class labels if using integer labels.<br>One and only one of the ‘classlabels_*’ attributes must be defined.

  • classlabels_strings: Class labels if using string labels.<br>One and only one of the ‘classlabels_*’ attributes must be defined.

  • nodes_falsenodeids: Child node if expression is false.

  • nodes_featureids: Feature id for each node.

  • nodes_hitrates: Popularity of each node, used for performance and may be omitted.

  • nodes_hitrates_as_tensor: Popularity of each node, used for performance and may be omitted.

  • nodes_missing_value_tracks_true: For each node, define what to do in the presence of a missing value: if a value is missing (NaN), use the ‘true’ or ‘false’ branch based on the value in this array.<br>This attribute may be left undefined, and the defalt value is false (0) for all nodes.

  • nodes_modes: The node kind, that is, the comparison to make at the node. There is no comparison to make at a leaf node.<br>One of ‘BRANCH_LEQ’, ‘BRANCH_LT’, ‘BRANCH_GTE’, ‘BRANCH_GT’, ‘BRANCH_EQ’, ‘BRANCH_NEQ’, ‘LEAF’

  • nodes_nodeids: Node id for each node. Ids may restart at zero for each tree, but it not required to.

  • nodes_treeids: Tree id for each node.

  • nodes_truenodeids: Child node if expression is true.

  • nodes_values: Thresholds to do the splitting on for each node.

  • nodes_values_as_tensor: Thresholds to do the splitting on for each node.

  • post_transform: Indicates the transform to apply to the score. <br> One of ‘NONE,’ ‘SOFTMAX,’ ‘LOGISTIC,’ ‘SOFTMAX_ZERO,’ or ‘PROBIT.’ Default value is 'NONE'.

Inputs

  • X (heterogeneous) - T1: Input of shape [N,F]

Outputs

  • Y (heterogeneous) - T2: N, Top class for each point

  • Z (heterogeneous) - tensor(float): The class score for each class, for each point, a tensor of shape [N,E].

Type Constraints

  • T1 in ( tensor(double), tensor(float), tensor(int32), tensor(int64) ): The input type must be a tensor of a numeric type.

  • T2 in ( tensor(int64), tensor(string) ): The output type will be a tensor of strings or integers, depending on which of the classlabels_* attributes is used.

OnnxAiOnnxMlTreeEnsembleRegressor#

class mlprodict.npy.xop_auto_import_.OnnxAiOnnxMlTreeEnsembleRegressor(*args, **kwargs)#

Version

This version of the operator has been available since version 3 of domain ai.onnx.ml.

Summary

Tree Ensemble regressor. Returns the regressed values for each input in N.

All args with nodes_ are fields of a tuple of tree nodes, and it is assumed they are the same length, and an index i will decode the tuple across these inputs. Each node id can appear only once for each tree id.

All fields prefixed with target_ are tuples of votes at the leaves.

A leaf may have multiple votes, where each vote is weighted by the associated target_weights index.

All fields ending with <i>_as_tensor</i> can be used instead of the same parameter without the suffix if the element type is double and not float. All trees must have their node ids start at 0 and increment by 1.

Mode enum is BRANCH_LEQ, BRANCH_LT, BRANCH_GTE, BRANCH_GT, BRANCH_EQ, BRANCH_NEQ, LEAF

Attributes

  • aggregate_function: Defines how to aggregate leaf values within a target. <br>One of ‘AVERAGE,’ ‘SUM,’ ‘MIN,’ ‘MAX.’ Default value is 'SUM'.

  • base_values: Base values for classification, added to final class score; the size must be the same as the classes or can be left unassigned (assumed 0)

  • base_values_as_tensor: Base values for classification, added to final class score; the size must be the same as the classes or can be left unassigned (assumed 0)

  • n_targets: The total number of targets.

  • nodes_falsenodeids: Child node if expression is false

  • nodes_featureids: Feature id for each node.

  • nodes_hitrates: Popularity of each node, used for performance and may be omitted.

  • nodes_hitrates_as_tensor: Popularity of each node, used for performance and may be omitted.

  • nodes_missing_value_tracks_true: For each node, define what to do in the presence of a NaN: use the ‘true’ (if the attribute value is 1) or ‘false’ (if the attribute value is 0) branch based on the value in this array.<br>This attribute may be left undefined and the defalt value is false (0) for all nodes.

  • nodes_modes: The node kind, that is, the comparison to make at the node. There is no comparison to make at a leaf node.<br>One of ‘BRANCH_LEQ’, ‘BRANCH_LT’, ‘BRANCH_GTE’, ‘BRANCH_GT’, ‘BRANCH_EQ’, ‘BRANCH_NEQ’, ‘LEAF’

  • nodes_nodeids: Node id for each node. Node ids must restart at zero for each tree and increase sequentially.

  • nodes_treeids: Tree id for each node.

  • nodes_truenodeids: Child node if expression is true

  • nodes_values: Thresholds to do the splitting on for each node.

  • nodes_values_as_tensor: Thresholds to do the splitting on for each node.

  • post_transform: Indicates the transform to apply to the score. <br>One of ‘NONE,’ ‘SOFTMAX,’ ‘LOGISTIC,’ ‘SOFTMAX_ZERO,’ or ‘PROBIT’ Default value is 'NONE'.

  • target_ids: The index of the target that each weight is for

  • target_nodeids: The node id of each weight

  • target_treeids: The id of the tree that each node is in.

  • target_weights: The weight for each target

  • target_weights_as_tensor: The weight for each target

Inputs

  • X (heterogeneous) - T: Input of shape [N,F]

Outputs

  • Y (heterogeneous) - tensor(float): N classes

Type Constraints

  • T in ( tensor(double), tensor(float), tensor(int32), tensor(int64) ): The input type must be a tensor of a numeric type.

OnnxAiOnnxMlTreeEnsembleRegressor_1#

class mlprodict.npy.xop_auto_import_.OnnxAiOnnxMlTreeEnsembleRegressor_1(*args, **kwargs)#

Version

This version of the operator has been available since version 1 of domain ai.onnx.ml.

Summary

Tree Ensemble regressor. Returns the regressed values for each input in N.

All args with nodes_ are fields of a tuple of tree nodes, and it is assumed they are the same length, and an index i will decode the tuple across these inputs. Each node id can appear only once for each tree id.

All fields prefixed with target_ are tuples of votes at the leaves.

A leaf may have multiple votes, where each vote is weighted by the associated target_weights index.

All trees must have their node ids start at 0 and increment by 1.

Mode enum is BRANCH_LEQ, BRANCH_LT, BRANCH_GTE, BRANCH_GT, BRANCH_EQ, BRANCH_NEQ, LEAF

Attributes

  • aggregate_function: Defines how to aggregate leaf values within a target. <br>One of ‘AVERAGE,’ ‘SUM,’ ‘MIN,’ ‘MAX.’ Default value is 'SUM'.

  • base_values: Base values for classification, added to final class score; the size must be the same as the classes or can be left unassigned (assumed 0)

  • n_targets: The total number of targets.

  • nodes_falsenodeids: Child node if expression is false

  • nodes_featureids: Feature id for each node.

  • nodes_hitrates: Popularity of each node, used for performance and may be omitted.

  • nodes_missing_value_tracks_true: For each node, define what to do in the presence of a NaN: use the ‘true’ (if the attribute value is 1) or ‘false’ (if the attribute value is 0) branch based on the value in this array.<br>This attribute may be left undefined and the defalt value is false (0) for all nodes.

  • nodes_modes: The node kind, that is, the comparison to make at the node. There is no comparison to make at a leaf node.<br>One of ‘BRANCH_LEQ’, ‘BRANCH_LT’, ‘BRANCH_GTE’, ‘BRANCH_GT’, ‘BRANCH_EQ’, ‘BRANCH_NEQ’, ‘LEAF’

  • nodes_nodeids: Node id for each node. Node ids must restart at zero for each tree and increase sequentially.

  • nodes_treeids: Tree id for each node.

  • nodes_truenodeids: Child node if expression is true

  • nodes_values: Thresholds to do the splitting on for each node.

  • post_transform: Indicates the transform to apply to the score. <br>One of ‘NONE,’ ‘SOFTMAX,’ ‘LOGISTIC,’ ‘SOFTMAX_ZERO,’ or ‘PROBIT’ Default value is 'NONE'.

  • target_ids: The index of the target that each weight is for

  • target_nodeids: The node id of each weight

  • target_treeids: The id of the tree that each node is in.

  • target_weights: The weight for each target

Inputs

  • X (heterogeneous) - T: Input of shape [N,F]

Outputs

  • Y (heterogeneous) - tensor(float): N classes

Type Constraints

  • T in ( tensor(double), tensor(float), tensor(int32), tensor(int64) ): The input type must be a tensor of a numeric type.

OnnxAiOnnxMlTreeEnsembleRegressor_3#

class mlprodict.npy.xop_auto_import_.OnnxAiOnnxMlTreeEnsembleRegressor_3(*args, **kwargs)#

Version

This version of the operator has been available since version 3 of domain ai.onnx.ml.

Summary

Tree Ensemble regressor. Returns the regressed values for each input in N.

All args with nodes_ are fields of a tuple of tree nodes, and it is assumed they are the same length, and an index i will decode the tuple across these inputs. Each node id can appear only once for each tree id.

All fields prefixed with target_ are tuples of votes at the leaves.

A leaf may have multiple votes, where each vote is weighted by the associated target_weights index.

All fields ending with <i>_as_tensor</i> can be used instead of the same parameter without the suffix if the element type is double and not float. All trees must have their node ids start at 0 and increment by 1.

Mode enum is BRANCH_LEQ, BRANCH_LT, BRANCH_GTE, BRANCH_GT, BRANCH_EQ, BRANCH_NEQ, LEAF

Attributes

  • aggregate_function: Defines how to aggregate leaf values within a target. <br>One of ‘AVERAGE,’ ‘SUM,’ ‘MIN,’ ‘MAX.’ Default value is 'SUM'.

  • base_values: Base values for classification, added to final class score; the size must be the same as the classes or can be left unassigned (assumed 0)

  • base_values_as_tensor: Base values for classification, added to final class score; the size must be the same as the classes or can be left unassigned (assumed 0)

  • n_targets: The total number of targets.

  • nodes_falsenodeids: Child node if expression is false

  • nodes_featureids: Feature id for each node.

  • nodes_hitrates: Popularity of each node, used for performance and may be omitted.

  • nodes_hitrates_as_tensor: Popularity of each node, used for performance and may be omitted.

  • nodes_missing_value_tracks_true: For each node, define what to do in the presence of a NaN: use the ‘true’ (if the attribute value is 1) or ‘false’ (if the attribute value is 0) branch based on the value in this array.<br>This attribute may be left undefined and the defalt value is false (0) for all nodes.

  • nodes_modes: The node kind, that is, the comparison to make at the node. There is no comparison to make at a leaf node.<br>One of ‘BRANCH_LEQ’, ‘BRANCH_LT’, ‘BRANCH_GTE’, ‘BRANCH_GT’, ‘BRANCH_EQ’, ‘BRANCH_NEQ’, ‘LEAF’

  • nodes_nodeids: Node id for each node. Node ids must restart at zero for each tree and increase sequentially.

  • nodes_treeids: Tree id for each node.

  • nodes_truenodeids: Child node if expression is true

  • nodes_values: Thresholds to do the splitting on for each node.

  • nodes_values_as_tensor: Thresholds to do the splitting on for each node.

  • post_transform: Indicates the transform to apply to the score. <br>One of ‘NONE,’ ‘SOFTMAX,’ ‘LOGISTIC,’ ‘SOFTMAX_ZERO,’ or ‘PROBIT’ Default value is 'NONE'.

  • target_ids: The index of the target that each weight is for

  • target_nodeids: The node id of each weight

  • target_treeids: The id of the tree that each node is in.

  • target_weights: The weight for each target

  • target_weights_as_tensor: The weight for each target

Inputs

  • X (heterogeneous) - T: Input of shape [N,F]

Outputs

  • Y (heterogeneous) - tensor(float): N classes

Type Constraints

  • T in ( tensor(double), tensor(float), tensor(int32), tensor(int64) ): The input type must be a tensor of a numeric type.

OnnxAiOnnxMlZipMap#

class mlprodict.npy.xop_auto_import_.OnnxAiOnnxMlZipMap(*args, **kwargs)#

Version

  • name: ZipMap (GitHub)

  • domain: ai.onnx.ml

  • since_version: 1

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 1 of domain ai.onnx.ml.

Summary

Creates a map from the input and the attributes.

The values are provided by the input tensor, while the keys are specified by the attributes. Must provide keys in either classlabels_strings or classlabels_int64s (but not both).

The columns of the tensor correspond one-by-one to the keys specified by the attributes. There must be as many columns as keys.

Attributes

  • classlabels_int64s: The keys when using int keys.<br>One and only one of the ‘classlabels_*’ attributes must be defined.

  • classlabels_strings: The keys when using string keys.<br>One and only one of the ‘classlabels_*’ attributes must be defined.

Inputs

  • X (heterogeneous) - tensor(float): The input values

Outputs

  • Z (heterogeneous) - T: The output map

Type Constraints

  • T in ( seq(map(int64, float)), seq(map(string, float)) ): The output will be a sequence of string or integer maps to float.

OnnxAiOnnxMlZipMap_1#

class mlprodict.npy.xop_auto_import_.OnnxAiOnnxMlZipMap_1(*args, **kwargs)#

Version

  • name: ZipMap (GitHub)

  • domain: ai.onnx.ml

  • since_version: 1

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 1 of domain ai.onnx.ml.

Summary

Creates a map from the input and the attributes.

The values are provided by the input tensor, while the keys are specified by the attributes. Must provide keys in either classlabels_strings or classlabels_int64s (but not both).

The columns of the tensor correspond one-by-one to the keys specified by the attributes. There must be as many columns as keys.

Attributes

  • classlabels_int64s: The keys when using int keys.<br>One and only one of the ‘classlabels_*’ attributes must be defined.

  • classlabels_strings: The keys when using string keys.<br>One and only one of the ‘classlabels_*’ attributes must be defined.

Inputs

  • X (heterogeneous) - tensor(float): The input values

Outputs

  • Z (heterogeneous) - T: The output map

Type Constraints

  • T in ( seq(map(int64, float)), seq(map(string, float)) ): The output will be a sequence of string or integer maps to float.

OnnxAiOnnxPreviewTrainingAdagrad#

class mlprodict.npy.xop_auto_import_.OnnxAiOnnxPreviewTrainingAdagrad(*args, **kwargs)#

Version

  • name: Adagrad (GitHub)

  • domain: ai.onnx.preview.training

  • since_version: 1

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 1 of domain ai.onnx.preview.training.

Summary

Compute one iteration of ADAGRAD, a stochastic gradient based optimization algorithm. This operator can conduct the optimization of multiple tensor variables.

Let’s define the behavior of this operator. As you can imagine, ADAGRAD requires some parameters:

  • The initial learning-rate “R”.

  • The update count “T”. That is, the number of training iterations conducted.

  • A L2-norm regularization coefficient “norm_coefficient”.

  • A learning-rate decay factor “decay_factor”.

  • A small constant “epsilon” to avoid dividing-by-zero.

At each ADAGRAD iteration, the optimized tensors are moved along a direction computed based on their estimated gradient and accumulated squared gradient. Assume that only a single tensor “X” is updated by this operator. We need the value of “X”, its gradient “G”, and its accumulated squared gradient “H”. Therefore, variables in this operator’s input list are sequentially “R”, “T”, “X”, “G”, and “H”. Other parameters are given as attributes because they are usually constants. Also, the corresponding output tensors are the new value of “X” (called “X_new”), and then the new accumulated squared gradient (called “H_new”). Those outputs are computed from the given inputs following the pseudo code below.

Let “+”, “-”, “*”, and “/” are all element-wise arithmetic operations with numpy-style broadcasting support. The pseudo code to compute those outputs is:

// Compute a scalar learning-rate factor. At the first update of X, T is generally // 0 (0-based update index) or 1 (1-based update index). r = R / (1 + T * decay_factor);

// Add gradient of 0.5 * norm_coefficient * ||X||_2^2, where ||X||_2 is the 2-norm. G_regularized = norm_coefficient * X + G;

// Compute new accumulated squared gradient. H_new = H + G_regularized * G_regularized;

// Compute the adaptive part of per-coordinate learning rate. Note that Sqrt(…) // computes element-wise square-root. H_adaptive = Sqrt(H_new) + epsilon

// Compute the new value of “X”. X_new = X - r * G_regularized / H_adaptive;

If one assign this operators to optimize multiple inputs, for example, “X_1” and “X_2”, the same pseudo code may be extended to handle all tensors jointly. More specifically, we can view “X” as a concatenation of “X_1” and “X_2” (of course, their gradient and accumulate gradient should be concatenated too) and then just reuse the entire pseudo code.

Note that ADAGRAD was first proposed in http://jmlr.org/papers/volume12/duchi11a/duchi11a.pdf. In that reference paper, this operator is a special case of the Figure 1’s composite mirror descent update.

Attributes

  • decay_factor: The decay factor of learning rate after one update.The effective learning rate is computed by r = R / (1 + T * decay_factor). Default to 0 so that increasing update counts doesn’t reduce the learning rate. Default value is 0.0.

  • epsilon: Small scalar to avoid dividing by zero. Default value is 9.999999974752427e-07.

  • norm_coefficient: Regularization coefficient in 0.5 * norm_coefficient * ||X||_2^2. Default to 0, which means no regularization. Default value is 0.0.

Inputs

Between 3 and 2147483647 inputs.

  • R (heterogeneous) - T1: The initial learning rate.

  • T (heterogeneous) - T2: The update count of “X”. It should be a scalar.

  • inputs (variadic) - T3: The current values of optimized tensors, followed by their respective gradients, followed by their respective accumulated squared gradients.For example, if two tensor “X_1” and “X_2” are optimized, The input list would be [“X_1”, “X_2”, gradient of “X_1”, gradient of “X_2”, accumulated squared gradient of “X_1”, accumulated squared gradient of “X_2”].

Outputs

Between 1 and 2147483647 outputs.

  • outputs (variadic) - T3: Updated values of optimized tensors, followed by their updated values of accumulated squared gradients. For example, if two tensor “X_1” and “X_2” are optimized, the output list would be [new value of “X_1,” new value of “X_2” new accumulated squared gradient of “X_1”, new accumulated squared gradient of “X_2”].

Type Constraints

  • T1 in ( tensor(double), tensor(float) ): Constrain input types to float scalars.

  • T2 in ( tensor(int64) ): Constrain input types to 64-bit integer scalars.

  • T3 in ( tensor(double), tensor(float) ): Constrain input and output types to float tensors.

OnnxAiOnnxPreviewTrainingAdagrad_1#

class mlprodict.npy.xop_auto_import_.OnnxAiOnnxPreviewTrainingAdagrad_1(*args, **kwargs)#

Version

  • name: Adagrad (GitHub)

  • domain: ai.onnx.preview.training

  • since_version: 1

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 1 of domain ai.onnx.preview.training.

Summary

Compute one iteration of ADAGRAD, a stochastic gradient based optimization algorithm. This operator can conduct the optimization of multiple tensor variables.

Let’s define the behavior of this operator. As you can imagine, ADAGRAD requires some parameters:

  • The initial learning-rate “R”.

  • The update count “T”. That is, the number of training iterations conducted.

  • A L2-norm regularization coefficient “norm_coefficient”.

  • A learning-rate decay factor “decay_factor”.

  • A small constant “epsilon” to avoid dividing-by-zero.

At each ADAGRAD iteration, the optimized tensors are moved along a direction computed based on their estimated gradient and accumulated squared gradient. Assume that only a single tensor “X” is updated by this operator. We need the value of “X”, its gradient “G”, and its accumulated squared gradient “H”. Therefore, variables in this operator’s input list are sequentially “R”, “T”, “X”, “G”, and “H”. Other parameters are given as attributes because they are usually constants. Also, the corresponding output tensors are the new value of “X” (called “X_new”), and then the new accumulated squared gradient (called “H_new”). Those outputs are computed from the given inputs following the pseudo code below.

Let “+”, “-”, “*”, and “/” are all element-wise arithmetic operations with numpy-style broadcasting support. The pseudo code to compute those outputs is:

// Compute a scalar learning-rate factor. At the first update of X, T is generally // 0 (0-based update index) or 1 (1-based update index). r = R / (1 + T * decay_factor);

// Add gradient of 0.5 * norm_coefficient * ||X||_2^2, where ||X||_2 is the 2-norm. G_regularized = norm_coefficient * X + G;

// Compute new accumulated squared gradient. H_new = H + G_regularized * G_regularized;

// Compute the adaptive part of per-coordinate learning rate. Note that Sqrt(…) // computes element-wise square-root. H_adaptive = Sqrt(H_new) + epsilon

// Compute the new value of “X”. X_new = X - r * G_regularized / H_adaptive;

If one assign this operators to optimize multiple inputs, for example, “X_1” and “X_2”, the same pseudo code may be extended to handle all tensors jointly. More specifically, we can view “X” as a concatenation of “X_1” and “X_2” (of course, their gradient and accumulate gradient should be concatenated too) and then just reuse the entire pseudo code.

Note that ADAGRAD was first proposed in http://jmlr.org/papers/volume12/duchi11a/duchi11a.pdf. In that reference paper, this operator is a special case of the Figure 1’s composite mirror descent update.

Attributes

  • decay_factor: The decay factor of learning rate after one update.The effective learning rate is computed by r = R / (1 + T * decay_factor). Default to 0 so that increasing update counts doesn’t reduce the learning rate. Default value is 0.0.

  • epsilon: Small scalar to avoid dividing by zero. Default value is 9.999999974752427e-07.

  • norm_coefficient: Regularization coefficient in 0.5 * norm_coefficient * ||X||_2^2. Default to 0, which means no regularization. Default value is 0.0.

Inputs

Between 3 and 2147483647 inputs.

  • R (heterogeneous) - T1: The initial learning rate.

  • T (heterogeneous) - T2: The update count of “X”. It should be a scalar.

  • inputs (variadic) - T3: The current values of optimized tensors, followed by their respective gradients, followed by their respective accumulated squared gradients.For example, if two tensor “X_1” and “X_2” are optimized, The input list would be [“X_1”, “X_2”, gradient of “X_1”, gradient of “X_2”, accumulated squared gradient of “X_1”, accumulated squared gradient of “X_2”].

Outputs

Between 1 and 2147483647 outputs.

  • outputs (variadic) - T3: Updated values of optimized tensors, followed by their updated values of accumulated squared gradients. For example, if two tensor “X_1” and “X_2” are optimized, the output list would be [new value of “X_1,” new value of “X_2” new accumulated squared gradient of “X_1”, new accumulated squared gradient of “X_2”].

Type Constraints

  • T1 in ( tensor(double), tensor(float) ): Constrain input types to float scalars.

  • T2 in ( tensor(int64) ): Constrain input types to 64-bit integer scalars.

  • T3 in ( tensor(double), tensor(float) ): Constrain input and output types to float tensors.

OnnxAiOnnxPreviewTrainingAdam#

class mlprodict.npy.xop_auto_import_.OnnxAiOnnxPreviewTrainingAdam(*args, **kwargs)#

Version

  • name: Adam (GitHub)

  • domain: ai.onnx.preview.training

  • since_version: 1

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 1 of domain ai.onnx.preview.training.

Summary

Compute one iteration of Adam, a stochastic gradient based optimization algorithm. This operator can conduct the optimization of multiple tensor variables.

Let’s define the behavior of this operator. First of all, Adam requires some parameters:

  • The learning-rate “R”.

  • The update count “T”. That is, the number of training iterations conducted.

  • A L2-norm regularization coefficient “norm_coefficient”.

  • A small constant “epsilon” to avoid dividing-by-zero.

  • Two coefficients, “alpha” and “beta”.

At each Adam iteration, the optimized tensors are moved along a direction computed based on their exponentially-averaged historical gradient and exponentially-averaged historical squared gradient. Assume that only a tensor “X” is being optimized. The rest of required information is

  • the value of “X”,

  • “X“‘s gradient (denoted by “G”),

  • “X“‘s exponentially-averaged historical gradient (denoted by “V”), and

  • “X“‘s exponentially-averaged historical squared gradient (denoted by “H”).

Some of those parameters are passed into this operator as input tensors and others are stored as this operator’s attributes. Specifically, this operator’s input tensor list is [“R”, “T”, “X”, “G”, “V”, “H”]. That is, “R” is the first input, “T” is the second input, and so on. Other parameters are given as attributes because they are constants. Moreover, the corresponding output tensors are

  • the new value of “X” (called “X_new”),

  • the new exponentially-averaged historical gradient (denoted by “V_new”), and

  • the new exponentially-averaged historical squared gradient (denoted by “H_new”).

Those outputs are computed following the pseudo code below.

Let “+”, “-”, “*”, and “/” are all element-wise arithmetic operations with numpy-style broadcasting support. The pseudo code to compute those outputs is:

// Add gradient of 0.5 * norm_coefficient * ||X||_2^2, where ||X||_2 is the 2-norm. G_regularized = norm_coefficient * X + G

// Update exponentially-averaged historical gradient. V_new = alpha * V + (1 - alpha) * G_regularized

// Update exponentially-averaged historical squared gradient. H_new = beta * H + (1 - beta) * G_regularized * G_regularized

// Compute the element-wise square-root of H_new. V_new will be element-wisely // divided by H_sqrt for a better update direction. H_sqrt = Sqrt(H_new) + epsilon

// Compute learning-rate. Note that “alpha**T”/”beta**T” is alpha’s/beta’s T-th power. R_adjusted = T > 0 ? R * Sqrt(1 - beta**T) / (1 - alpha**T) : R

// Compute new value of “X”. X_new = X - R_adjusted * V_new / H_sqrt

// Post-update regularization. X_final = (1 - norm_coefficient_post) * X_new

If there are multiple inputs to be optimized, the pseudo code will be applied independently to each of them.

Attributes

  • alpha: Coefficient of previously accumulated gradient in running average. Default to 0.9. Default value is 0.8999999761581421.

  • beta: Coefficient of previously accumulated squared-gradient in running average. Default to 0.999. Default value is 0.9990000128746033.

  • epsilon: Small scalar to avoid dividing by zero. Default value is 9.999999974752427e-07.

  • norm_coefficient: Regularization coefficient of 0.5 * norm_coefficient * ||X||_2^2. Default to 0, which means no regularization. Default value is 0.0.

  • norm_coefficient_post: Regularization coefficient of 0.5 * norm_coefficient * ||X||_2^2. Default to 0, which means no regularization. Default value is 0.0.

Inputs

Between 3 and 2147483647 inputs.

  • R (heterogeneous) - T1: The initial learning rate.

  • T (heterogeneous) - T2: The update count of “X”. It should be a scalar.

  • inputs (variadic) - T3: The tensors to be optimized, followed by their respective gradients, followed by their respective accumulated gradients (aka momentum), followed by their respective accumulated squared gradients. For example, to optimize tensors “X_1” and “X_2,”, the input list would be [“X_1”, “X_2”, gradient of “X_1”, gradient of “X_2”, accumulated gradient of “X_1”, accumulated gradient of “X_2”, accumulated squared gradient of “X_1”, accumulated squared gradient of “X_2”].

Outputs

Between 1 and 2147483647 outputs.

  • outputs (variadic) - T3: New values of optimized tensors, followed by their respective new accumulated gradients, followed by their respective new accumulated squared gradients. For example, if two tensors “X_1” and “X_2” are optimized, the outputs list would be [new value of “X_1”, new value of “X_2”, new accumulated gradient of “X_1”, new accumulated gradient of “X_2”, new accumulated squared gradient of “X_1”, new accumulated squared gradient of “X_2”].

Type Constraints

  • T1 in ( tensor(double), tensor(float) ): Constrain input types to float scalars.

  • T2 in ( tensor(int64) ): Constrain input types to 64-bit integer scalars.

  • T3 in ( tensor(double), tensor(float) ): Constrain input and output types to float tensors.

OnnxAiOnnxPreviewTrainingAdam_1#

class mlprodict.npy.xop_auto_import_.OnnxAiOnnxPreviewTrainingAdam_1(*args, **kwargs)#

Version

  • name: Adam (GitHub)

  • domain: ai.onnx.preview.training

  • since_version: 1

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 1 of domain ai.onnx.preview.training.

Summary

Compute one iteration of Adam, a stochastic gradient based optimization algorithm. This operator can conduct the optimization of multiple tensor variables.

Let’s define the behavior of this operator. First of all, Adam requires some parameters:

  • The learning-rate “R”.

  • The update count “T”. That is, the number of training iterations conducted.

  • A L2-norm regularization coefficient “norm_coefficient”.

  • A small constant “epsilon” to avoid dividing-by-zero.

  • Two coefficients, “alpha” and “beta”.

At each Adam iteration, the optimized tensors are moved along a direction computed based on their exponentially-averaged historical gradient and exponentially-averaged historical squared gradient. Assume that only a tensor “X” is being optimized. The rest of required information is

  • the value of “X”,

  • “X“‘s gradient (denoted by “G”),

  • “X“‘s exponentially-averaged historical gradient (denoted by “V”), and

  • “X“‘s exponentially-averaged historical squared gradient (denoted by “H”).

Some of those parameters are passed into this operator as input tensors and others are stored as this operator’s attributes. Specifically, this operator’s input tensor list is [“R”, “T”, “X”, “G”, “V”, “H”]. That is, “R” is the first input, “T” is the second input, and so on. Other parameters are given as attributes because they are constants. Moreover, the corresponding output tensors are

  • the new value of “X” (called “X_new”),

  • the new exponentially-averaged historical gradient (denoted by “V_new”), and

  • the new exponentially-averaged historical squared gradient (denoted by “H_new”).

Those outputs are computed following the pseudo code below.

Let “+”, “-”, “*”, and “/” are all element-wise arithmetic operations with numpy-style broadcasting support. The pseudo code to compute those outputs is:

// Add gradient of 0.5 * norm_coefficient * ||X||_2^2, where ||X||_2 is the 2-norm. G_regularized = norm_coefficient * X + G

// Update exponentially-averaged historical gradient. V_new = alpha * V + (1 - alpha) * G_regularized

// Update exponentially-averaged historical squared gradient. H_new = beta * H + (1 - beta) * G_regularized * G_regularized

// Compute the element-wise square-root of H_new. V_new will be element-wisely // divided by H_sqrt for a better update direction. H_sqrt = Sqrt(H_new) + epsilon

// Compute learning-rate. Note that “alpha**T”/”beta**T” is alpha’s/beta’s T-th power. R_adjusted = T > 0 ? R * Sqrt(1 - beta**T) / (1 - alpha**T) : R

// Compute new value of “X”. X_new = X - R_adjusted * V_new / H_sqrt

// Post-update regularization. X_final = (1 - norm_coefficient_post) * X_new

If there are multiple inputs to be optimized, the pseudo code will be applied independently to each of them.

Attributes

  • alpha: Coefficient of previously accumulated gradient in running average. Default to 0.9. Default value is 0.8999999761581421.

  • beta: Coefficient of previously accumulated squared-gradient in running average. Default to 0.999. Default value is 0.9990000128746033.

  • epsilon: Small scalar to avoid dividing by zero. Default value is 9.999999974752427e-07.

  • norm_coefficient: Regularization coefficient of 0.5 * norm_coefficient * ||X||_2^2. Default to 0, which means no regularization. Default value is 0.0.

  • norm_coefficient_post: Regularization coefficient of 0.5 * norm_coefficient * ||X||_2^2. Default to 0, which means no regularization. Default value is 0.0.

Inputs

Between 3 and 2147483647 inputs.

  • R (heterogeneous) - T1: The initial learning rate.

  • T (heterogeneous) - T2: The update count of “X”. It should be a scalar.

  • inputs (variadic) - T3: The tensors to be optimized, followed by their respective gradients, followed by their respective accumulated gradients (aka momentum), followed by their respective accumulated squared gradients. For example, to optimize tensors “X_1” and “X_2,”, the input list would be [“X_1”, “X_2”, gradient of “X_1”, gradient of “X_2”, accumulated gradient of “X_1”, accumulated gradient of “X_2”, accumulated squared gradient of “X_1”, accumulated squared gradient of “X_2”].

Outputs

Between 1 and 2147483647 outputs.

  • outputs (variadic) - T3: New values of optimized tensors, followed by their respective new accumulated gradients, followed by their respective new accumulated squared gradients. For example, if two tensors “X_1” and “X_2” are optimized, the outputs list would be [new value of “X_1”, new value of “X_2”, new accumulated gradient of “X_1”, new accumulated gradient of “X_2”, new accumulated squared gradient of “X_1”, new accumulated squared gradient of “X_2”].

Type Constraints

  • T1 in ( tensor(double), tensor(float) ): Constrain input types to float scalars.

  • T2 in ( tensor(int64) ): Constrain input types to 64-bit integer scalars.

  • T3 in ( tensor(double), tensor(float) ): Constrain input and output types to float tensors.

OnnxAiOnnxPreviewTrainingGradient#

class mlprodict.npy.xop_auto_import_.OnnxAiOnnxPreviewTrainingGradient(*args, **kwargs)#

Version

  • name: Gradient (GitHub)

  • domain: ai.onnx.preview.training

  • since_version: 1

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: False

This version of the operator has been available since version 1 of domain ai.onnx.preview.training.

Summary

Gradient operator computes the partial derivatives of a specific tensor w.r.t. some other tensors. This operator is widely used in gradient-based training algorithms. To illustrate its use, let’s consider a computation graph,

X -----.
       |
       v
W --> Conv --> H --> Gemm --> Y
                      ^
                      |
                      Z

, where W and Z are trainable tensors. Note that operators’ attributes are omitted for the sake of simplicity. Let dY/dW (dY/dZ) be the gradient of Y with respect to W (Z). The user can compute gradient by inserting Gradient operator to form another graph shown below.

W --> Conv --> H --> Gemm --> Y
|      ^              ^
|      |              |
|      X              Z
|      |              |
|      |   .----------'
|      |   |  (W/Z/X is the 1st/2nd/3rd input of Gradient as shown in
|      |   |   "xs" followed by "zs")
|      v   v
'---> Gradient(xs=["W", "Z"], zs=["X"], y="Y")
       |   |
       |   '-----------------------------------> dY/dW (1st output of Gradient)
       |
       '---------------------------------------> dY/dZ (2nd output of Gradient)

By definition, the tensor “y” is a function of independent variables in “xs” and “zs”. Since we only compute the gradient of “y” w.r.t. the differentiable variables in “xs”, this Gradient only outputs dY/dW and dY/dZ. Note that “H” cannot appear in “xs” and “zs”. The reason is that “H” can be determined by tensors “W” and “X” and therefore “H” is not an independent variable.

All outputs are optional. If needed, for example, user can assign an empty string to the 1st output name of that Gradient to skip the generation of dY/dW. Note that the concept of optional outputs can also be found in ONNX’s RNN, GRU, and LSTM.

Gradient operator can compute derivative against intermediate tensors. For example, the gradient of Y with respect to H can be done via

W --> Conv --> H --> Gemm --> Y
       ^       |      ^
       |       |      |
       X       |      Z
       .-------'      |
       |   .----------'
       |   | (H/Z is the 1st/2nd input of Gradient as shown in "xs")
       v   v
      Gradient(xs=["H", "Z"], y="Y")
       |   |
       |   '-----------------------------------> dY/dH (1st output of Gradient)
       |
       '---------------------------------------> dY/dZ (2nd output of Gradient)

It is possible to represent high-order differentiation using Gradient operators. For example, given the following linear model:

W --> Gemm --> Y --> Loss --> O
       ^              ^
       |              |
       X              L

To compute the 2nd order derivative of O with respect to W (denoted by d^2O/dW^2), one can do

W --> Gemm --> Y --> Loss --> O
|      ^              ^
|      |              |
|      X .------------L
|      | |            |
|      | |            v
+------+-+> Gradient(xs=["X", "W"], zs=["L"], y="O") ---> dO/dX (1st output of Gradient)
|      | |    |
|      | |    '---> dO/dW (2nd output of Gradient)
|      v v
'---> Gradient(xs=["X", "W"], zs=["L"], y="dO/dW") ---> d(dO/dW)dX (1st output of
       |                                                  Gradient)
       |
       |
       '---> d^2O/dW^2 (2nd output of Gradient)

The tensors named in attributes “xs”, “zs”, and “y” define the differentiated computation graph, and the inputs to Gradient node define the values at which the gradient is computed. We can feed different tensors to the identified graph. For example, one can compute the gradient of Y with respect to H at a specific value of H, H_1, by providing that value as an input to the Gradient node.

W --> Conv --> H --> Gemm --> Y
       ^              ^
       |              |
       X              Z

          Z_1 (2nd input of Gradient)
           |
           v
H_1 --> Gradient(xs=["H", "Z"], y="Y") ---> dY/dH when H = H_1 and Y = Y_1.
           |
           '------------------------------> dY/dZ (2nd output of Gradient)

When the inputs of Gradient are the tensors named in “xs” and “zs”, the computation can be optimized. More specifically, intermediate variables in forward pass can be reused if the gradient is computed via reverse-mode auto-differentiation.

Attributes

  • xs (required): Input tensor names of the differentiated sub-graph. It contains only the necessary differentiated inputs of a (sub-)graph. Variables (usually called intermediate variables) that can be generated from inputs cannot be included in this attribute.

  • y (required): The targeted tensor. It can be viewed as the output of the differentiated function. The attribute “xs” and attribute “zs” are the minimal independent variable set that determines the value of “y”.

  • zs: Input tensor names of the differentiated sub-graph. It contains only the necessary non-differentiated inputs of a (sub-)graph. Variables (usually called intermediate variables) that can be generated from inputs cannot be included in this attribute.

Inputs

Between 1 and 2147483647 inputs.

  • Inputs (variadic) - T1: The values fed into graph identified by the attributes. The i-th input is the value of the i-th tensor specified in the concatenated list of the attribute “xs” and the attribute “zs”. For example, if xs=[“A”, “B”] and zs=[“C”], the first input is used as the value of symbol “A” and the 3rd input is substituted for all the occurrences of “C”.

Outputs

Between 1 and 2147483647 outputs.

  • Outputs (variadic) - T2: The gradient of the tensor specified by the attribute “y” with respect to each of tensors specified in the attribute “xs”. The i-th output is the gradient of “y” with respect to the i-th tensor specified in the attribute “xs”.

Type Constraints

  • T1 in ( tensor(bool), tensor(complex128), tensor(complex64), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(string), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) ): Allow outputs to be any kind of tensor.

  • T2 in ( tensor(double), tensor(float), tensor(float16) ): Allow inputs to be any kind of floating-point tensor.

OnnxAiOnnxPreviewTrainingGradient_1#

class mlprodict.npy.xop_auto_import_.OnnxAiOnnxPreviewTrainingGradient_1(*args, **kwargs)#

Version

  • name: Gradient (GitHub)

  • domain: ai.onnx.preview.training

  • since_version: 1

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: False

This version of the operator has been available since version 1 of domain ai.onnx.preview.training.

Summary

Gradient operator computes the partial derivatives of a specific tensor w.r.t. some other tensors. This operator is widely used in gradient-based training algorithms. To illustrate its use, let’s consider a computation graph,

X -----.
       |
       v
W --> Conv --> H --> Gemm --> Y
                      ^
                      |
                      Z

, where W and Z are trainable tensors. Note that operators’ attributes are omitted for the sake of simplicity. Let dY/dW (dY/dZ) be the gradient of Y with respect to W (Z). The user can compute gradient by inserting Gradient operator to form another graph shown below.

W --> Conv --> H --> Gemm --> Y
|      ^              ^
|      |              |
|      X              Z
|      |              |
|      |   .----------'
|      |   |  (W/Z/X is the 1st/2nd/3rd input of Gradient as shown in
|      |   |   "xs" followed by "zs")
|      v   v
'---> Gradient(xs=["W", "Z"], zs=["X"], y="Y")
       |   |
       |   '-----------------------------------> dY/dW (1st output of Gradient)
       |
       '---------------------------------------> dY/dZ (2nd output of Gradient)

By definition, the tensor “y” is a function of independent variables in “xs” and “zs”. Since we only compute the gradient of “y” w.r.t. the differentiable variables in “xs”, this Gradient only outputs dY/dW and dY/dZ. Note that “H” cannot appear in “xs” and “zs”. The reason is that “H” can be determined by tensors “W” and “X” and therefore “H” is not an independent variable.

All outputs are optional. If needed, for example, user can assign an empty string to the 1st output name of that Gradient to skip the generation of dY/dW. Note that the concept of optional outputs can also be found in ONNX’s RNN, GRU, and LSTM.

Gradient operator can compute derivative against intermediate tensors. For example, the gradient of Y with respect to H can be done via

W --> Conv --> H --> Gemm --> Y
       ^       |      ^
       |       |      |
       X       |      Z
       .-------'      |
       |   .----------'
       |   | (H/Z is the 1st/2nd input of Gradient as shown in "xs")
       v   v
      Gradient(xs=["H", "Z"], y="Y")
       |   |
       |   '-----------------------------------> dY/dH (1st output of Gradient)
       |
       '---------------------------------------> dY/dZ (2nd output of Gradient)

It is possible to represent high-order differentiation using Gradient operators. For example, given the following linear model:

W --> Gemm --> Y --> Loss --> O
       ^              ^
       |              |
       X              L

To compute the 2nd order derivative of O with respect to W (denoted by d^2O/dW^2), one can do

W --> Gemm --> Y --> Loss --> O
|      ^              ^
|      |              |
|      X .------------L
|      | |            |
|      | |            v
+------+-+> Gradient(xs=["X", "W"], zs=["L"], y="O") ---> dO/dX (1st output of Gradient)
|      | |    |
|      | |    '---> dO/dW (2nd output of Gradient)
|      v v
'---> Gradient(xs=["X", "W"], zs=["L"], y="dO/dW") ---> d(dO/dW)dX (1st output of
       |                                                  Gradient)
       |
       |
       '---> d^2O/dW^2 (2nd output of Gradient)

The tensors named in attributes “xs”, “zs”, and “y” define the differentiated computation graph, and the inputs to Gradient node define the values at which the gradient is computed. We can feed different tensors to the identified graph. For example, one can compute the gradient of Y with respect to H at a specific value of H, H_1, by providing that value as an input to the Gradient node.

W --> Conv --> H --> Gemm --> Y
       ^              ^
       |              |
       X              Z

          Z_1 (2nd input of Gradient)
           |
           v
H_1 --> Gradient(xs=["H", "Z"], y="Y") ---> dY/dH when H = H_1 and Y = Y_1.
           |
           '------------------------------> dY/dZ (2nd output of Gradient)

When the inputs of Gradient are the tensors named in “xs” and “zs”, the computation can be optimized. More specifically, intermediate variables in forward pass can be reused if the gradient is computed via reverse-mode auto-differentiation.

Attributes

  • xs (required): Input tensor names of the differentiated sub-graph. It contains only the necessary differentiated inputs of a (sub-)graph. Variables (usually called intermediate variables) that can be generated from inputs cannot be included in this attribute.

  • y (required): The targeted tensor. It can be viewed as the output of the differentiated function. The attribute “xs” and attribute “zs” are the minimal independent variable set that determines the value of “y”.

  • zs: Input tensor names of the differentiated sub-graph. It contains only the necessary non-differentiated inputs of a (sub-)graph. Variables (usually called intermediate variables) that can be generated from inputs cannot be included in this attribute.

Inputs

Between 1 and 2147483647 inputs.

  • Inputs (variadic) - T1: The values fed into graph identified by the attributes. The i-th input is the value of the i-th tensor specified in the concatenated list of the attribute “xs” and the attribute “zs”. For example, if xs=[“A”, “B”] and zs=[“C”], the first input is used as the value of symbol “A” and the 3rd input is substituted for all the occurrences of “C”.

Outputs

Between 1 and 2147483647 outputs.

  • Outputs (variadic) - T2: The gradient of the tensor specified by the attribute “y” with respect to each of tensors specified in the attribute “xs”. The i-th output is the gradient of “y” with respect to the i-th tensor specified in the attribute “xs”.

Type Constraints

  • T1 in ( tensor(bool), tensor(complex128), tensor(complex64), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(string), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) ): Allow outputs to be any kind of tensor.

  • T2 in ( tensor(double), tensor(float), tensor(float16) ): Allow inputs to be any kind of floating-point tensor.

OnnxAiOnnxPreviewTrainingMomentum#

class mlprodict.npy.xop_auto_import_.OnnxAiOnnxPreviewTrainingMomentum(*args, **kwargs)#

Version

  • name: Momentum (GitHub)

  • domain: ai.onnx.preview.training

  • since_version: 1

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 1 of domain ai.onnx.preview.training.

Summary

Compute one iteration of stochastic gradient update with momentum. This operator can conduct the optimization of multiple tensor variables.

Let’s define the behavior of this operator. As you can imagine, SG with momentum requires several parameters:

  • The learning-rate “R”.

  • The update count “T”. That is, the number of conducted training iterations. It should be zero in the first training iteration.

  • A L2-norm regularization coefficient “norm_coefficient”.

  • A decay coefficient of previous accumulated gradient (i.e., momentum) “alpha”.

  • The scaling coefficient of current gradient “beta”.

  • An attribute to choose either standard momentum or Nesterov’s momentum “mode” should be used.

For the sake of simplicity, assume that there is only one tensor (called “X”) to be optimized. Other necessary inputs are “X“‘s gradient (called “G”) and “X“‘s momentum (called “V”). This Momentum operator maps all these inputs to the new value of “X” (called “X_new”) and its new momentum (called “V_new”).

This operator supports two different momentum algorithms. Set the attribute “mode” to “nesterov” if Nesterov’s momentum is desired. Otherwise, set the attribute “model” to “standard” to use standard momentum. Computation details are described subsequently.

Let “+”, “-”, “*”, and “/” are all element-wise operations with numpy-style broadcasting.

Pseudo code for SG with standard momentum:

// Add gradient of 0.5 * norm_coefficient * ||X||^2, where ||X|| is the sum of squared // values of all elements in X. G_regularized = norm_coefficient * X + G

// In the first training iteration, beta should always be 1. beta_adjusted = T > 0 ? beta : 1

// Compute the current momentum based on previous momentum and the current gradient. V_new = alpha * V + beta_adjusted * G_regularized

// Update X. X_new = X - R * V_new

Pseudo code for SG with Nesterov’s momentum:

// Add gradient of 0.5 * norm_coefficient * ||X||^2, where ||X|| is the sum of squared // values of all elements in X. G_regularized = norm_coefficient * X + G;

// In the first training iteration, beta should always be 1. beta_adjusted = T > 0 ? beta : 1

// Compute the current momentum based on previous momentum and the current gradient. V_new = alpha * V + beta_adjusted * G_regularized;

// Compute final update direction and then update X. X_new = X - R * (G_regularized + alpha * V_new)

If one assign this operators to optimize multiple inputs, for example, “X_1” and “X_2”. The same pseudo code would be extended to handle all tensors jointly. More specifically, we can view “X” as a concatenation of “X_1” and “X_2” (of course, their gradient and accumulate gradient should be concatenated too) and then our pseudo code becomes applicable.

Attributes

  • alpha (required): The decay factor of momentum. It should be a scalar.

  • beta (required): The coefficient of gradient in computing new momentum. It should be a scalar.

  • mode (required): Its value should be either “nesterov” or “standard”. The value “nesterov” leads to the use of Nesterov’s momentum while “standard” invokes stochastic gradient method using standard momentum

  • norm_coefficient (required): Coefficient of 0.5 * norm_coefficient * ||X||^2.

Inputs

Between 3 and 2147483647 inputs.

  • R (heterogeneous) - T1: The learning rate.

  • T (heterogeneous) - T2: Update count of “X”. It should be a scalar.

  • inputs (variadic) - T3: It sequentially contains the current values of optimized tensors, then their gradient tensors, and finally their momentum tensors. For example, if two tensors “X_1” and “X_2” are optimized, The expected input list would be [“X_1”, “X_2”, gradient of “X_1”, gradient of “X_2”, momentum of “X_1”, momentum of “X_2”].

Outputs

Between 1 and 2147483647 outputs.

  • outputs (variadic) - T3: It sequentially contains the new values of optimized tensors and then the new values of their momentum tensors. For example, if two tensors “X_1” and “X_2” are optimized, the output list would be [new value of “X_1,” new value of “X_2” new momentum of “X_1”, new momentum of “X_2”].

Type Constraints

  • T1 in ( tensor(double), tensor(float) ): Constrain input types to float scalars.

  • T2 in ( tensor(int64) ): Constrain input types to 64-bit integer scalars.

  • T3 in ( tensor(double), tensor(float) ): Constrain input types to float tensors.

OnnxAiOnnxPreviewTrainingMomentum_1#

class mlprodict.npy.xop_auto_import_.OnnxAiOnnxPreviewTrainingMomentum_1(*args, **kwargs)#

Version

  • name: Momentum (GitHub)

  • domain: ai.onnx.preview.training

  • since_version: 1

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 1 of domain ai.onnx.preview.training.

Summary

Compute one iteration of stochastic gradient update with momentum. This operator can conduct the optimization of multiple tensor variables.

Let’s define the behavior of this operator. As you can imagine, SG with momentum requires several parameters:

  • The learning-rate “R”.

  • The update count “T”. That is, the number of conducted training iterations. It should be zero in the first training iteration.

  • A L2-norm regularization coefficient “norm_coefficient”.

  • A decay coefficient of previous accumulated gradient (i.e., momentum) “alpha”.

  • The scaling coefficient of current gradient “beta”.

  • An attribute to choose either standard momentum or Nesterov’s momentum “mode” should be used.

For the sake of simplicity, assume that there is only one tensor (called “X”) to be optimized. Other necessary inputs are “X“‘s gradient (called “G”) and “X“‘s momentum (called “V”). This Momentum operator maps all these inputs to the new value of “X” (called “X_new”) and its new momentum (called “V_new”).

This operator supports two different momentum algorithms. Set the attribute “mode” to “nesterov” if Nesterov’s momentum is desired. Otherwise, set the attribute “model” to “standard” to use standard momentum. Computation details are described subsequently.

Let “+”, “-”, “*”, and “/” are all element-wise operations with numpy-style broadcasting.

Pseudo code for SG with standard momentum:

// Add gradient of 0.5 * norm_coefficient * ||X||^2, where ||X|| is the sum of squared // values of all elements in X. G_regularized = norm_coefficient * X + G

// In the first training iteration, beta should always be 1. beta_adjusted = T > 0 ? beta : 1

// Compute the current momentum based on previous momentum and the current gradient. V_new = alpha * V + beta_adjusted * G_regularized

// Update X. X_new = X - R * V_new

Pseudo code for SG with Nesterov’s momentum:

// Add gradient of 0.5 * norm_coefficient * ||X||^2, where ||X|| is the sum of squared // values of all elements in X. G_regularized = norm_coefficient * X + G;

// In the first training iteration, beta should always be 1. beta_adjusted = T > 0 ? beta : 1

// Compute the current momentum based on previous momentum and the current gradient. V_new = alpha * V + beta_adjusted * G_regularized;

// Compute final update direction and then update X. X_new = X - R * (G_regularized + alpha * V_new)

If one assign this operators to optimize multiple inputs, for example, “X_1” and “X_2”. The same pseudo code would be extended to handle all tensors jointly. More specifically, we can view “X” as a concatenation of “X_1” and “X_2” (of course, their gradient and accumulate gradient should be concatenated too) and then our pseudo code becomes applicable.

Attributes

  • alpha (required): The decay factor of momentum. It should be a scalar.

  • beta (required): The coefficient of gradient in computing new momentum. It should be a scalar.

  • mode (required): Its value should be either “nesterov” or “standard”. The value “nesterov” leads to the use of Nesterov’s momentum while “standard” invokes stochastic gradient method using standard momentum

  • norm_coefficient (required): Coefficient of 0.5 * norm_coefficient * ||X||^2.

Inputs

Between 3 and 2147483647 inputs.

  • R (heterogeneous) - T1: The learning rate.

  • T (heterogeneous) - T2: Update count of “X”. It should be a scalar.

  • inputs (variadic) - T3: It sequentially contains the current values of optimized tensors, then their gradient tensors, and finally their momentum tensors. For example, if two tensors “X_1” and “X_2” are optimized, The expected input list would be [“X_1”, “X_2”, gradient of “X_1”, gradient of “X_2”, momentum of “X_1”, momentum of “X_2”].

Outputs

Between 1 and 2147483647 outputs.

  • outputs (variadic) - T3: It sequentially contains the new values of optimized tensors and then the new values of their momentum tensors. For example, if two tensors “X_1” and “X_2” are optimized, the output list would be [new value of “X_1,” new value of “X_2” new momentum of “X_1”, new momentum of “X_2”].

Type Constraints

  • T1 in ( tensor(double), tensor(float) ): Constrain input types to float scalars.

  • T2 in ( tensor(int64) ): Constrain input types to 64-bit integer scalars.

  • T3 in ( tensor(double), tensor(float) ): Constrain input types to float tensors.

OnnxAnd#

class mlprodict.npy.xop_auto_import_.OnnxAnd(*args, **kwargs)#

Version

  • name: And (GitHub)

  • domain: main

  • since_version: 7

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 7.

Summary

Returns the tensor resulted from performing the and logical operation elementwise on the input tensors A and B (with Numpy-style broadcasting support).

This operator supports multidirectional (i.e., Numpy-style) broadcasting; for more details please check Broadcasting in ONNX.

Inputs

  • A (heterogeneous) - T: First input operand for the logical operator.

  • B (heterogeneous) - T: Second input operand for the logical operator.

Outputs

  • C (heterogeneous) - T1: Result tensor.

Type Constraints

  • T in ( tensor(bool) ): Constrain input to boolean tensor.

  • T1 in ( tensor(bool) ): Constrain output to boolean tensor.

OnnxAnd_1#

class mlprodict.npy.xop_auto_import_.OnnxAnd_1(*args, **kwargs)#

Version

  • name: And (GitHub)

  • domain: main

  • since_version: 1

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 1.

Summary

Returns the tensor resulted from performing the and logical operation elementwise on the input tensors A and B.

If broadcasting is enabled, the right-hand-side argument will be broadcasted to match the shape of left-hand-side argument. See the doc of Add for a detailed description of the broadcasting rules.

Attributes

  • axis: If set, defines the broadcast dimensions.

  • broadcast: Enable broadcasting Default value is 0.

Inputs

  • A (heterogeneous) - T: Left input tensor for the logical operator.

  • B (heterogeneous) - T: Right input tensor for the logical operator.

Outputs

  • C (heterogeneous) - T1: Result tensor.

Type Constraints

  • T in ( tensor(bool) ): Constrain input to boolean tensor.

  • T1 in ( tensor(bool) ): Constrain output to boolean tensor.

OnnxAnd_7#

class mlprodict.npy.xop_auto_import_.OnnxAnd_7(*args, **kwargs)#

Version

  • name: And (GitHub)

  • domain: main

  • since_version: 7

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 7.

Summary

Returns the tensor resulted from performing the and logical operation elementwise on the input tensors A and B (with Numpy-style broadcasting support).

This operator supports multidirectional (i.e., Numpy-style) broadcasting; for more details please check Broadcasting in ONNX.

Inputs

  • A (heterogeneous) - T: First input operand for the logical operator.

  • B (heterogeneous) - T: Second input operand for the logical operator.

Outputs

  • C (heterogeneous) - T1: Result tensor.

Type Constraints

  • T in ( tensor(bool) ): Constrain input to boolean tensor.

  • T1 in ( tensor(bool) ): Constrain output to boolean tensor.

OnnxArgMax#

class mlprodict.npy.xop_auto_import_.OnnxArgMax(*args, **kwargs)#

Version

  • name: ArgMax (GitHub)

  • domain: main

  • since_version: 13

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 13.

Summary

Computes the indices of the max elements of the input tensor’s element along the provided axis. The resulting tensor has the same rank as the input if keepdims equals 1. If keepdims equals 0, then the resulting tensor has the reduced dimension pruned. If select_last_index is True (default False), the index of the last occurrence of the max is selected if the max appears more than once in the input. Otherwise the index of the first occurrence is selected. The type of the output tensor is integer.

Attributes

  • axis: The axis in which to compute the arg indices. Accepted range is [-r, r-1] where r = rank(data). Default value is 0.

  • keepdims: Keep the reduced dimension or not, default 1 means keep reduced dimension. Default value is 1.

  • select_last_index: Whether to select the last index or the first index if the {name} appears in multiple indices, default is False (first index). Default value is 0.

Inputs

  • data (heterogeneous) - T: An input tensor.

Outputs

  • reduced (heterogeneous) - tensor(int64): Reduced output tensor with integer data type.

Type Constraints

  • T in ( tensor(bfloat16), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) ): Constrain input and output types to all numeric tensors.

OnnxArgMax_1#

class mlprodict.npy.xop_auto_import_.OnnxArgMax_1(*args, **kwargs)#

Version

  • name: ArgMax (GitHub)

  • domain: main

  • since_version: 1

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 1.

Summary

Computes the indices of the max elements of the input tensor’s element along the provided axis. The resulting tensor has the same rank as the input if keepdims equals 1. If keepdims equal 0, then the resulted tensor have the reduced dimension pruned. The type of the output tensor is integer.

Attributes

  • axis: The axis in which to compute the arg indices. Default value is 0.

  • keepdims: Keep the reduced dimension or not, default 1 means keep reduced dimension. Default value is 1.

Inputs

  • data (heterogeneous) - T: An input tensor.

Outputs

  • reduced (heterogeneous) - tensor(int64): Reduced output tensor with integer data type.

Type Constraints

  • T in ( tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) ): Constrain input and output types to all numeric tensors.

OnnxArgMax_11#

class mlprodict.npy.xop_auto_import_.OnnxArgMax_11(*args, **kwargs)#

Version

  • name: ArgMax (GitHub)

  • domain: main

  • since_version: 11

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 11.

Summary

Computes the indices of the max elements of the input tensor’s element along the provided axis. The resulting tensor has the same rank as the input if keepdims equals 1. If keepdims equal 0, then the resulting tensor has the reduced dimension pruned. The type of the output tensor is integer.

Attributes

  • axis: The axis in which to compute the arg indices. Accepted range is [-r, r-1] where r = rank(data). Default value is 0.

  • keepdims: Keep the reduced dimension or not, default 1 means keep reduced dimension. Default value is 1.

Inputs

  • data (heterogeneous) - T: An input tensor.

Outputs

  • reduced (heterogeneous) - tensor(int64): Reduced output tensor with integer data type.

Type Constraints

  • T in ( tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) ): Constrain input and output types to all numeric tensors.

OnnxArgMax_12#

class mlprodict.npy.xop_auto_import_.OnnxArgMax_12(*args, **kwargs)#

Version

  • name: ArgMax (GitHub)

  • domain: main

  • since_version: 12

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 12.

Summary

Computes the indices of the max elements of the input tensor’s element along the provided axis. The resulting tensor has the same rank as the input if keepdims equals 1. If keepdims equal 0, then the resulting tensor has the reduced dimension pruned. If select_last_index is True (default False), the index of the last occurrence of the max is selected if the max appears more than once in the input. Otherwise the index of the first occurrence is selected. The type of the output tensor is integer.

Attributes

  • axis: The axis in which to compute the arg indices. Accepted range is [-r, r-1] where r = rank(data). Default value is 0.

  • keepdims: Keep the reduced dimension or not, default 1 means keep reduced dimension. Default value is 1.

  • select_last_index: Whether to select the last index or the first index if the {name} appears in multiple indices, default is False (first index). Default value is 0.

Inputs

  • data (heterogeneous) - T: An input tensor.

Outputs

  • reduced (heterogeneous) - tensor(int64): Reduced output tensor with integer data type.

Type Constraints

  • T in ( tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) ): Constrain input and output types to all numeric tensors.

OnnxArgMax_13#

class mlprodict.npy.xop_auto_import_.OnnxArgMax_13(*args, **kwargs)#

Version

  • name: ArgMax (GitHub)

  • domain: main

  • since_version: 13

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 13.

Summary

Computes the indices of the max elements of the input tensor’s element along the provided axis. The resulting tensor has the same rank as the input if keepdims equals 1. If keepdims equals 0, then the resulting tensor has the reduced dimension pruned. If select_last_index is True (default False), the index of the last occurrence of the max is selected if the max appears more than once in the input. Otherwise the index of the first occurrence is selected. The type of the output tensor is integer.

Attributes

  • axis: The axis in which to compute the arg indices. Accepted range is [-r, r-1] where r = rank(data). Default value is 0.

  • keepdims: Keep the reduced dimension or not, default 1 means keep reduced dimension. Default value is 1.

  • select_last_index: Whether to select the last index or the first index if the {name} appears in multiple indices, default is False (first index). Default value is 0.

Inputs

  • data (heterogeneous) - T: An input tensor.

Outputs

  • reduced (heterogeneous) - tensor(int64): Reduced output tensor with integer data type.

Type Constraints

  • T in ( tensor(bfloat16), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) ): Constrain input and output types to all numeric tensors.

OnnxArgMin#

class mlprodict.npy.xop_auto_import_.OnnxArgMin(*args, **kwargs)#

Version

  • name: ArgMin (GitHub)

  • domain: main

  • since_version: 13

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 13.

Summary

Computes the indices of the min elements of the input tensor’s element along the provided axis. The resulting tensor has the same rank as the input if keepdims equals 1. If keepdims equals 0, then the resulting tensor has the reduced dimension pruned. If select_last_index is True (default False), the index of the last occurrence of the min is selected if the min appears more than once in the input. Otherwise the index of the first occurrence is selected. The type of the output tensor is integer.

Attributes

  • axis: The axis in which to compute the arg indices. Accepted range is [-r, r-1] where r = rank(data). Default value is 0.

  • keepdims: Keep the reduced dimension or not, default 1 means keep reduced dimension. Default value is 1.

  • select_last_index: Whether to select the last index or the first index if the {name} appears in multiple indices, default is False (first index). Default value is 0.

Inputs

  • data (heterogeneous) - T: An input tensor.

Outputs

  • reduced (heterogeneous) - tensor(int64): Reduced output tensor with integer data type.

Type Constraints

  • T in ( tensor(bfloat16), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) ): Constrain input and output types to all numeric tensors.

OnnxArgMin_1#

class mlprodict.npy.xop_auto_import_.OnnxArgMin_1(*args, **kwargs)#

Version

  • name: ArgMin (GitHub)

  • domain: main

  • since_version: 1

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 1.

Summary

Computes the indices of the min elements of the input tensor’s element along the provided axis. The resulting tensor has the same rank as the input if keepdims equals 1. If keepdims equal 0, then the resulted tensor have the reduced dimension pruned. The type of the output tensor is integer.

Attributes

  • axis: The axis in which to compute the arg indices. Default value is 0.

  • keepdims: Keep the reduced dimension or not, default 1 means keep reduced dimension. Default value is 1.

Inputs

  • data (heterogeneous) - T: An input tensor.

Outputs

  • reduced (heterogeneous) - tensor(int64): Reduced output tensor with integer data type.

Type Constraints

  • T in ( tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) ): Constrain input and output types to all numeric tensors.

OnnxArgMin_11#

class mlprodict.npy.xop_auto_import_.OnnxArgMin_11(*args, **kwargs)#

Version

  • name: ArgMin (GitHub)

  • domain: main

  • since_version: 11

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 11.

Summary

Computes the indices of the min elements of the input tensor’s element along the provided axis. The resulting tensor has the same rank as the input if keepdims equals 1. If keepdims equal 0, then the resulting tensor has the reduced dimension pruned. The type of the output tensor is integer.

Attributes

  • axis: The axis in which to compute the arg indices. Accepted range is [-r, r-1] where r = rank(data). Default value is 0.

  • keepdims: Keep the reduced dimension or not, default 1 means keep reduced dimension. Default value is 1.

Inputs

  • data (heterogeneous) - T: An input tensor.

Outputs

  • reduced (heterogeneous) - tensor(int64): Reduced output tensor with integer data type.

Type Constraints

  • T in ( tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) ): Constrain input and output types to all numeric tensors.

OnnxArgMin_12#

class mlprodict.npy.xop_auto_import_.OnnxArgMin_12(*args, **kwargs)#

Version

  • name: ArgMin (GitHub)

  • domain: main

  • since_version: 12

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 12.

Summary

Computes the indices of the min elements of the input tensor’s element along the provided axis. The resulting tensor has the same rank as the input if keepdims equals 1. If keepdims equal 0, then the resulting tensor has the reduced dimension pruned. If select_last_index is True (default False), the index of the last occurrence of the min is selected if the min appears more than once in the input. Otherwise the index of the first occurrence is selected. The type of the output tensor is integer.

Attributes

  • axis: The axis in which to compute the arg indices. Accepted range is [-r, r-1] where r = rank(data). Default value is 0.

  • keepdims: Keep the reduced dimension or not, default 1 means keep reduced dimension. Default value is 1.

  • select_last_index: Whether to select the last index or the first index if the {name} appears in multiple indices, default is False (first index). Default value is 0.

Inputs

  • data (heterogeneous) - T: An input tensor.

Outputs

  • reduced (heterogeneous) - tensor(int64): Reduced output tensor with integer data type.

Type Constraints

  • T in ( tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) ): Constrain input and output types to all numeric tensors.

OnnxArgMin_13#

class mlprodict.npy.xop_auto_import_.OnnxArgMin_13(*args, **kwargs)#

Version

  • name: ArgMin (GitHub)

  • domain: main

  • since_version: 13

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 13.

Summary

Computes the indices of the min elements of the input tensor’s element along the provided axis. The resulting tensor has the same rank as the input if keepdims equals 1. If keepdims equals 0, then the resulting tensor has the reduced dimension pruned. If select_last_index is True (default False), the index of the last occurrence of the min is selected if the min appears more than once in the input. Otherwise the index of the first occurrence is selected. The type of the output tensor is integer.

Attributes

  • axis: The axis in which to compute the arg indices. Accepted range is [-r, r-1] where r = rank(data). Default value is 0.

  • keepdims: Keep the reduced dimension or not, default 1 means keep reduced dimension. Default value is 1.

  • select_last_index: Whether to select the last index or the first index if the {name} appears in multiple indices, default is False (first index). Default value is 0.

Inputs

  • data (heterogeneous) - T: An input tensor.

Outputs

  • reduced (heterogeneous) - tensor(int64): Reduced output tensor with integer data type.

Type Constraints

  • T in ( tensor(bfloat16), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) ): Constrain input and output types to all numeric tensors.

OnnxAsin#

class mlprodict.npy.xop_auto_import_.OnnxAsin(*args, **kwargs)#

Version

  • name: Asin (GitHub)

  • domain: main

  • since_version: 7

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 7.

Summary

Calculates the arcsine (inverse of sine) of the given input tensor, element-wise.

Inputs

  • input (heterogeneous) - T: Input tensor

Outputs

  • output (heterogeneous) - T: The arcsine of the input tensor computed element-wise

Type Constraints

  • T in ( tensor(double), tensor(float), tensor(float16) ): Constrain input and output types to float tensors.

OnnxAsin_7#

class mlprodict.npy.xop_auto_import_.OnnxAsin_7(*args, **kwargs)#

Version

  • name: Asin (GitHub)

  • domain: main

  • since_version: 7

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 7.

Summary

Calculates the arcsine (inverse of sine) of the given input tensor, element-wise.

Inputs

  • input (heterogeneous) - T: Input tensor

Outputs

  • output (heterogeneous) - T: The arcsine of the input tensor computed element-wise

Type Constraints

  • T in ( tensor(double), tensor(float), tensor(float16) ): Constrain input and output types to float tensors.

OnnxAsinh#

class mlprodict.npy.xop_auto_import_.OnnxAsinh(*args, **kwargs)#

Version

  • name: Asinh (GitHub)

  • domain: main

  • since_version: 9

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 9.

Summary

Calculates the hyperbolic arcsine of the given input tensor element-wise.

Inputs

  • input (heterogeneous) - T: Input tensor

Outputs

  • output (heterogeneous) - T: The hyperbolic arcsine values of the input tensor computed element- wise

Type Constraints

  • T in ( tensor(double), tensor(float), tensor(float16) ): Constrain input and output types to float tensors.

OnnxAsinh_9#

class mlprodict.npy.xop_auto_import_.OnnxAsinh_9(*args, **kwargs)#

Version

  • name: Asinh (GitHub)

  • domain: main

  • since_version: 9

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 9.

Summary

Calculates the hyperbolic arcsine of the given input tensor element-wise.

Inputs

  • input (heterogeneous) - T: Input tensor

Outputs

  • output (heterogeneous) - T: The hyperbolic arcsine values of the input tensor computed element- wise

Type Constraints

  • T in ( tensor(double), tensor(float), tensor(float16) ): Constrain input and output types to float tensors.

OnnxAtan#

class mlprodict.npy.xop_auto_import_.OnnxAtan(*args, **kwargs)#

Version

  • name: Atan (GitHub)

  • domain: main

  • since_version: 7

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 7.

Summary

Calculates the arctangent (inverse of tangent) of the given input tensor, element-wise.

Inputs

  • input (heterogeneous) - T: Input tensor

Outputs

  • output (heterogeneous) - T: The arctangent of the input tensor computed element-wise

Type Constraints

  • T in ( tensor(double), tensor(float), tensor(float16) ): Constrain input and output types to float tensors.

OnnxAtan_7#

class mlprodict.npy.xop_auto_import_.OnnxAtan_7(*args, **kwargs)#

Version

  • name: Atan (GitHub)

  • domain: main

  • since_version: 7

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 7.

Summary

Calculates the arctangent (inverse of tangent) of the given input tensor, element-wise.

Inputs

  • input (heterogeneous) - T: Input tensor

Outputs

  • output (heterogeneous) - T: The arctangent of the input tensor computed element-wise

Type Constraints

  • T in ( tensor(double), tensor(float), tensor(float16) ): Constrain input and output types to float tensors.

OnnxAtanh#

class mlprodict.npy.xop_auto_import_.OnnxAtanh(*args, **kwargs)#

Version

  • name: Atanh (GitHub)

  • domain: main

  • since_version: 9

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 9.

Summary

Calculates the hyperbolic arctangent of the given input tensor element-wise.

Inputs

  • input (heterogeneous) - T: Input tensor

Outputs

  • output (heterogeneous) - T: The hyperbolic arctangent values of the input tensor computed element-wise

Type Constraints

  • T in ( tensor(double), tensor(float), tensor(float16) ): Constrain input and output types to float tensors.

OnnxAtanh_9#

class mlprodict.npy.xop_auto_import_.OnnxAtanh_9(*args, **kwargs)#

Version

  • name: Atanh (GitHub)

  • domain: main

  • since_version: 9

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 9.

Summary

Calculates the hyperbolic arctangent of the given input tensor element-wise.

Inputs

  • input (heterogeneous) - T: Input tensor

Outputs

  • output (heterogeneous) - T: The hyperbolic arctangent values of the input tensor computed element-wise

Type Constraints

  • T in ( tensor(double), tensor(float), tensor(float16) ): Constrain input and output types to float tensors.

OnnxAveragePool#

class mlprodict.npy.xop_auto_import_.OnnxAveragePool(*args, **kwargs)#

Version

  • name: AveragePool (GitHub)

  • domain: main

  • since_version: 11

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 11.

Summary

AveragePool consumes an input tensor X and applies average pooling across the tensor according to kernel sizes, stride sizes, and pad lengths. average pooling consisting of computing the average on all values of a subset of the input tensor according to the kernel size and downsampling the data into the output tensor Y for further processing. The output spatial shape will be following:

output_spatial_shape[i] = floor((input_spatial_shape[i] + pad_shape[i] - kernel_spatial_shape[i]) / strides_spatial_shape[i] + 1)

or#

output_spatial_shape[i] = ceil((input_spatial_shape[i] + pad_shape[i] - kernel_spatial_shape[i]) / strides_spatial_shape[i] + 1)

if ceil_mode is enabled

* pad_shape[i] is sum of pads along axis i

auto_pad is a DEPRECATED attribute. If you are using them currently, the output spatial shape will be following:

VALID: output_spatial_shape[i] = ceil((input_spatial_shape[i] - kernel_spatial_shape[i] + 1) / strides_spatial_shape[i])
SAME_UPPER or SAME_LOWER: output_spatial_shape[i] = ceil(input_spatial_shape[i] / strides_spatial_shape[i])

And pad shape will be following if SAME_UPPER or SAME_LOWER:

pad_shape[i] = (output_spatial_shape[i] - 1) * strides_spatial_shape[i] + kernel_spatial_shape[i] - input_spatial_shape[i]

The output of each pooling window is divided by the number of elements (exclude pad when attribute count_include_pad is zero).

Attributes

  • auto_pad: auto_pad must be either NOTSET, SAME_UPPER, SAME_LOWER or VALID. Where default value is NOTSET, which means explicit padding is used. SAME_UPPER or SAME_LOWER mean pad the input so that output_shape[i] = ceil(input_shape[i] / strides[i]) for each axis i. The padding is split between the two sides equally or almost equally (depending on whether it is even or odd). In case the padding is an odd number, the extra padding is added at the end for SAME_UPPER and at the beginning for SAME_LOWER. Default value is 'NOTSET'.

  • ceil_mode: Whether to use ceil or floor (default) to compute the output shape. Default value is 0.

  • count_include_pad: Whether include pad pixels when calculating values for the edges. Default is 0, doesn’t count include pad. Default value is 0.

  • kernel_shape (required): The size of the kernel along each axis.

  • pads: Padding for the beginning and ending along each spatial axis, it can take any value greater than or equal to 0. The value represent the number of pixels added to the beginning and end part of the corresponding axis. pads format should be as follow [x1_begin, x2_begin…x1_end, x2_end,…], where xi_begin the number of pixels added at the beginning of axis i and xi_end, the number of pixels added at the end of axis i. This attribute cannot be used simultaneously with auto_pad attribute. If not present, the padding defaults to 0 along start and end of each spatial axis.

  • strides: Stride along each spatial axis. If not present, the stride defaults to 1 along each spatial axis.

Inputs

  • X (heterogeneous) - T: Input data tensor from the previous operator; dimensions for image case are (N x C x H x W), where N is the batch size, C is the number of channels, and H and W are the height and the width of the data. For non image case, the dimensions are in the form of (N x C x D1 x D2 … Dn), where N is the batch size. Optionally, if dimension denotation is in effect, the operation expects the input data tensor to arrive with the dimension denotation of [DATA_BATCH, DATA_CHANNEL, DATA_FEATURE, DATA_FEATURE …].

Outputs

  • Y (heterogeneous) - T: Output data tensor from average or max pooling across the input tensor. Dimensions will vary based on various kernel, stride, and pad sizes. Floor value of the dimension is used

Type Constraints

  • T in ( tensor(double), tensor(float), tensor(float16) ): Constrain input and output types to float tensors.

OnnxAveragePool_1#

class mlprodict.npy.xop_auto_import_.OnnxAveragePool_1(*args, **kwargs)#

Version

  • name: AveragePool (GitHub)

  • domain: main

  • since_version: 1

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 1.

Summary

AveragePool consumes an input tensor X and applies average pooling across the tensor according to kernel sizes, stride sizes, and pad lengths. average pooling consisting of computing the average on all values of a subset of the input tensor according to the kernel size and downsampling the data into the output tensor Y for further processing. The output spatial shape will be following:

output_spatial_shape[i] = floor((input_spatial_shape[i] + pad_shape[i] - kernel_spatial_shape[i]) / strides_spatial_shape[i] + 1)

* pad_shape[i] is sum of pads along axis i

auto_pad is a DEPRECATED attribute. If you are using them currently, the output spatial shape will be following:

VALID: output_spatial_shape[i] = ceil((input_spatial_shape[i] - kernel_spatial_shape[i] + 1) / strides_spatial_shape[i])
SAME_UPPER or SAME_LOWER: output_spatial_shape[i] = ceil(input_spatial_shape[i] / strides_spatial_shape[i])

And pad shape will be following if SAME_UPPER or SAME_LOWER:

pad_shape[i] = (output_spatial_shape[i] - 1) * strides_spatial_shape[i] + kernel_spatial_shape[i] - input_spatial_shape[i]

The output of each pooling window is divided by the number of elements exclude pad.

Attributes

  • auto_pad: auto_pad must be either NOTSET, SAME_UPPER, SAME_LOWER or VALID. Where default value is NOTSET, which means explicit padding is used. SAME_UPPER or SAME_LOWER mean pad the input so that the output spatial size match the input.In case of odd number add the extra padding at the end for SAME_UPPER and at the beginning for SAME_LOWER. VALID mean no padding. Default value is 'NOTSET'.

  • kernel_shape (required): The size of the kernel along each axis.

  • pads: Padding for the beginning and ending along each spatial axis, it can take any value greater than or equal to 0. The value represent the number of pixels added to the beginning and end part of the corresponding axis. pads format should be as follow [x1_begin, x2_begin…x1_end, x2_end,…], where xi_begin the number of pixels added at the beginning of axis i and xi_end, the number of pixels added at the end of axis i. This attribute cannot be used simultaneously with auto_pad attribute. If not present, the padding defaults to 0 along start and end of each spatial axis.

  • strides: Stride along each spatial axis.

Inputs

  • X (heterogeneous) - T: Input data tensor from the previous operator; dimensions for image case are (N x C x H x W), where N is the batch size, C is the number of channels, and H and W are the height and the width of the data. For non image case, the dimensions are in the form of (N x C x D1 x D2 … Dn), where N is the batch size. Optionally, if dimension denotation is in effect, the operation expects the input data tensor to arrive with the dimension denotation of [DATA_BATCH, DATA_CHANNEL, DATA_FEATURE, DATA_FEATURE …].

Outputs

  • Y (heterogeneous) - T: Output data tensor from average or max pooling across the input tensor. Dimensions will vary based on various kernel, stride, and pad sizes. Floor value of the dimension is used

Type Constraints

  • T in ( tensor(double), tensor(float), tensor(float16) ): Constrain input and output types to float tensors.

OnnxAveragePool_10#

class mlprodict.npy.xop_auto_import_.OnnxAveragePool_10(*args, **kwargs)#

Version

  • name: AveragePool (GitHub)

  • domain: main

  • since_version: 10

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 10.

Summary

AveragePool consumes an input tensor X and applies average pooling across the tensor according to kernel sizes, stride sizes, and pad lengths. average pooling consisting of computing the average on all values of a subset of the input tensor according to the kernel size and downsampling the data into the output tensor Y for further processing. The output spatial shape will be following:

output_spatial_shape[i] = floor((input_spatial_shape[i] + pad_shape[i] - kernel_spatial_shape[i]) / strides_spatial_shape[i] + 1)

or#

output_spatial_shape[i] = ceil((input_spatial_shape[i] + pad_shape[i] - kernel_spatial_shape[i]) / strides_spatial_shape[i] + 1)

if ceil_mode is enabled

* pad_shape[i] is sum of pads along axis i

auto_pad is a DEPRECATED attribute. If you are using them currently, the output spatial shape will be following:

VALID: output_spatial_shape[i] = ceil((input_spatial_shape[i] - kernel_spatial_shape[i] + 1) / strides_spatial_shape[i])
SAME_UPPER or SAME_LOWER: output_spatial_shape[i] = ceil(input_spatial_shape[i] / strides_spatial_shape[i])

And pad shape will be following if SAME_UPPER or SAME_LOWER:

pad_shape[i] = (output_spatial_shape[i] - 1) * strides_spatial_shape[i] + kernel_spatial_shape[i] - input_spatial_shape[i]

The output of each pooling window is divided by the number of elements (exclude pad when attribute count_include_pad is zero).

Attributes

  • auto_pad: auto_pad must be either NOTSET, SAME_UPPER, SAME_LOWER or VALID. Where default value is NOTSET, which means explicit padding is used. SAME_UPPER or SAME_LOWER mean pad the input so that the output spatial size match the input.In case of odd number add the extra padding at the end for SAME_UPPER and at the beginning for SAME_LOWER. VALID mean no padding. Default value is 'NOTSET'.

  • ceil_mode: Whether to use ceil or floor (default) to compute the output shape. Default value is 0.

  • count_include_pad: Whether include pad pixels when calculating values for the edges. Default is 0, doesn’t count include pad. Default value is 0.

  • kernel_shape (required): The size of the kernel along each axis.

  • pads: Padding for the beginning and ending along each spatial axis, it can take any value greater than or equal to 0. The value represent the number of pixels added to the beginning and end part of the corresponding axis. pads format should be as follow [x1_begin, x2_begin…x1_end, x2_end,…], where xi_begin the number of pixels added at the beginning of axis i and xi_end, the number of pixels added at the end of axis i. This attribute cannot be used simultaneously with auto_pad attribute. If not present, the padding defaults to 0 along start and end of each spatial axis.

  • strides: Stride along each spatial axis.

Inputs

  • X (heterogeneous) - T: Input data tensor from the previous operator; dimensions for image case are (N x C x H x W), where N is the batch size, C is the number of channels, and H and W are the height and the width of the data. For non image case, the dimensions are in the form of (N x C x D1 x D2 … Dn), where N is the batch size. Optionally, if dimension denotation is in effect, the operation expects the input data tensor to arrive with the dimension denotation of [DATA_BATCH, DATA_CHANNEL, DATA_FEATURE, DATA_FEATURE …].

Outputs

  • Y (heterogeneous) - T: Output data tensor from average or max pooling across the input tensor. Dimensions will vary based on various kernel, stride, and pad sizes. Floor value of the dimension is used

Type Constraints

  • T in ( tensor(double), tensor(float), tensor(float16) ): Constrain input and output types to float tensors.

OnnxAveragePool_11#

class mlprodict.npy.xop_auto_import_.OnnxAveragePool_11(*args, **kwargs)#

Version

  • name: AveragePool (GitHub)

  • domain: main

  • since_version: 11

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 11.

Summary

AveragePool consumes an input tensor X and applies average pooling across the tensor according to kernel sizes, stride sizes, and pad lengths. average pooling consisting of computing the average on all values of a subset of the input tensor according to the kernel size and downsampling the data into the output tensor Y for further processing. The output spatial shape will be following:

output_spatial_shape[i] = floor((input_spatial_shape[i] + pad_shape[i] - kernel_spatial_shape[i]) / strides_spatial_shape[i] + 1)

or#

output_spatial_shape[i] = ceil((input_spatial_shape[i] + pad_shape[i] - kernel_spatial_shape[i]) / strides_spatial_shape[i] + 1)

if ceil_mode is enabled

* pad_shape[i] is sum of pads along axis i

auto_pad is a DEPRECATED attribute. If you are using them currently, the output spatial shape will be following:

VALID: output_spatial_shape[i] = ceil((input_spatial_shape[i] - kernel_spatial_shape[i] + 1) / strides_spatial_shape[i])
SAME_UPPER or SAME_LOWER: output_spatial_shape[i] = ceil(input_spatial_shape[i] / strides_spatial_shape[i])

And pad shape will be following if SAME_UPPER or SAME_LOWER:

pad_shape[i] = (output_spatial_shape[i] - 1) * strides_spatial_shape[i] + kernel_spatial_shape[i] - input_spatial_shape[i]

The output of each pooling window is divided by the number of elements (exclude pad when attribute count_include_pad is zero).

Attributes

  • auto_pad: auto_pad must be either NOTSET, SAME_UPPER, SAME_LOWER or VALID. Where default value is NOTSET, which means explicit padding is used. SAME_UPPER or SAME_LOWER mean pad the input so that output_shape[i] = ceil(input_shape[i] / strides[i]) for each axis i. The padding is split between the two sides equally or almost equally (depending on whether it is even or odd). In case the padding is an odd number, the extra padding is added at the end for SAME_UPPER and at the beginning for SAME_LOWER. Default value is 'NOTSET'.

  • ceil_mode: Whether to use ceil or floor (default) to compute the output shape. Default value is 0.

  • count_include_pad: Whether include pad pixels when calculating values for the edges. Default is 0, doesn’t count include pad. Default value is 0.

  • kernel_shape (required): The size of the kernel along each axis.

  • pads: Padding for the beginning and ending along each spatial axis, it can take any value greater than or equal to 0. The value represent the number of pixels added to the beginning and end part of the corresponding axis. pads format should be as follow [x1_begin, x2_begin…x1_end, x2_end,…], where xi_begin the number of pixels added at the beginning of axis i and xi_end, the number of pixels added at the end of axis i. This attribute cannot be used simultaneously with auto_pad attribute. If not present, the padding defaults to 0 along start and end of each spatial axis.

  • strides: Stride along each spatial axis. If not present, the stride defaults to 1 along each spatial axis.

Inputs

  • X (heterogeneous) - T: Input data tensor from the previous operator; dimensions for image case are (N x C x H x W), where N is the batch size, C is the number of channels, and H and W are the height and the width of the data. For non image case, the dimensions are in the form of (N x C x D1 x D2 … Dn), where N is the batch size. Optionally, if dimension denotation is in effect, the operation expects the input data tensor to arrive with the dimension denotation of [DATA_BATCH, DATA_CHANNEL, DATA_FEATURE, DATA_FEATURE …].

Outputs

  • Y (heterogeneous) - T: Output data tensor from average or max pooling across the input tensor. Dimensions will vary based on various kernel, stride, and pad sizes. Floor value of the dimension is used

Type Constraints

  • T in ( tensor(double), tensor(float), tensor(float16) ): Constrain input and output types to float tensors.

OnnxAveragePool_7#

class mlprodict.npy.xop_auto_import_.OnnxAveragePool_7(*args, **kwargs)#

Version

  • name: AveragePool (GitHub)

  • domain: main

  • since_version: 7

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 7.

Summary

AveragePool consumes an input tensor X and applies average pooling across the tensor according to kernel sizes, stride sizes, and pad lengths. average pooling consisting of computing the average on all values of a subset of the input tensor according to the kernel size and downsampling the data into the output tensor Y for further processing. The output spatial shape will be following:

output_spatial_shape[i] = floor((input_spatial_shape[i] + pad_shape[i] - kernel_spatial_shape[i]) / strides_spatial_shape[i] + 1)

* pad_shape[i] is sum of pads along axis i

auto_pad is a DEPRECATED attribute. If you are using them currently, the output spatial shape will be following:

VALID: output_spatial_shape[i] = ceil((input_spatial_shape[i] - kernel_spatial_shape[i] + 1) / strides_spatial_shape[i])
SAME_UPPER or SAME_LOWER: output_spatial_shape[i] = ceil(input_spatial_shape[i] / strides_spatial_shape[i])

And pad shape will be following if SAME_UPPER or SAME_LOWER:

pad_shape[i] = (output_spatial_shape[i] - 1) * strides_spatial_shape[i] + kernel_spatial_shape[i] - input_spatial_shape[i]

The output of each pooling window is divided by the number of elements (exclude pad when attribute count_include_pad is zero).

Attributes

  • auto_pad: auto_pad must be either NOTSET, SAME_UPPER, SAME_LOWER or VALID. Where default value is NOTSET, which means explicit padding is used. SAME_UPPER or SAME_LOWER mean pad the input so that the output spatial size match the input.In case of odd number add the extra padding at the end for SAME_UPPER and at the beginning for SAME_LOWER. VALID mean no padding. Default value is 'NOTSET'.

  • count_include_pad: Whether include pad pixels when calculating values for the edges. Default is 0, doesn’t count include pad. Default value is 0.

  • kernel_shape (required): The size of the kernel along each axis.

  • pads: Padding for the beginning and ending along each spatial axis, it can take any value greater than or equal to 0. The value represent the number of pixels added to the beginning and end part of the corresponding axis. pads format should be as follow [x1_begin, x2_begin…x1_end, x2_end,…], where xi_begin the number of pixels added at the beginning of axis i and xi_end, the number of pixels added at the end of axis i. This attribute cannot be used simultaneously with auto_pad attribute. If not present, the padding defaults to 0 along start and end of each spatial axis.

  • strides: Stride along each spatial axis.

Inputs

  • X (heterogeneous) - T: Input data tensor from the previous operator; dimensions for image case are (N x C x H x W), where N is the batch size, C is the number of channels, and H and W are the height and the width of the data. For non image case, the dimensions are in the form of (N x C x D1 x D2 … Dn), where N is the batch size. Optionally, if dimension denotation is in effect, the operation expects the input data tensor to arrive with the dimension denotation of [DATA_BATCH, DATA_CHANNEL, DATA_FEATURE, DATA_FEATURE …].

Outputs

  • Y (heterogeneous) - T: Output data tensor from average or max pooling across the input tensor. Dimensions will vary based on various kernel, stride, and pad sizes. Floor value of the dimension is used

Type Constraints

  • T in ( tensor(double), tensor(float), tensor(float16) ): Constrain input and output types to float tensors.

OnnxBatchNormalization#

class mlprodict.npy.xop_auto_import_.OnnxBatchNormalization(*args, **kwargs)#

Version

  • name: BatchNormalization (GitHub)

  • domain: main

  • since_version: 15

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 15.

Summary

Carries out batch normalization as described in the paper https://arxiv.org/abs/1502.03167. Depending on the mode it is being run, There are five required inputs ‘X’, ‘scale’, ‘B’, ‘input_mean’ and ‘input_var’. Note that ‘input_mean’ and ‘input_var’ are expected to be the estimated statistics in inference mode (training_mode=False, default), and the running statistics in training mode (training_mode=True). There are multiple cases for the number of outputs, which we list below:

Output case #1: Y, running_mean, running_var (training_mode=True) Output case #2: Y (training_mode=False)

When training_mode=False, extra outputs are invalid. The outputs are updated as follows when training_mode=True:

running_mean = input_mean * momentum + current_mean * (1 - momentum)
running_var = input_var * momentum + current_var * (1 - momentum)

Y = (X - current_mean) / sqrt(current_var + epsilon) * scale + B

where:

current_mean = ReduceMean(X, axis=all_except_channel_index)
current_var =  ReduceVar(X, axis=all_except_channel_index)

Notice that ReduceVar refers to the population variance, and it equals to
sum(sqrd(x_i - x_avg)) / N
where N is the population size (this formula does not use sample size N - 1).

The computation of ReduceMean and ReduceVar uses float to avoid overflow for float16 inputs.

When training_mode=False:

Y = (X - input_mean) / sqrt(input_var + epsilon) * scale + B

For previous (depreciated) non-spatial cases, implementors are suggested to flatten the input shape to (N x C * D1 * D2 * … * Dn) before a BatchNormalization Op. This operator has optional inputs/outputs. See ONNX for more details about the representation of optional arguments. An empty string may be used in the place of an actual argument’s name to indicate a missing argument. Trailing optional arguments (those not followed by an argument that is present) may also be simply omitted.

Attributes

  • epsilon: The epsilon value to use to avoid division by zero. Default value is 9.999999747378752e-06.

  • momentum: Factor used in computing the running mean and variance.e.g., running_mean = running_mean * momentum + mean * (1 - momentum). Default value is 0.8999999761581421.

  • training_mode: If set to true, it indicates BatchNormalization is being used for training, and outputs 1, 2, 3, and 4 would be populated. Default value is 0.

Inputs

  • X (heterogeneous) - T: Input data tensor from the previous operator; dimensions are in the form of (N x C x D1 x D2 … Dn), where N is the batch size, C is the number of channels. Statistics are computed for every channel of C over N and D1 to Dn dimensions. For image data, input dimensions become (N x C x H x W). The op also accepts single dimension input of size N in which case C is assumed to be 1

  • scale (heterogeneous) - T1: Scale tensor of shape (C).

  • B (heterogeneous) - T1: Bias tensor of shape (C).

  • input_mean (heterogeneous) - T2: running (training) or estimated (testing) mean tensor of shape (C).

  • input_var (heterogeneous) - T2: running (training) or estimated (testing) variance tensor of shape (C).

Outputs

Between 1 and 3 outputs.

  • Y (heterogeneous) - T: The output tensor of the same shape as X

  • running_mean (optional, heterogeneous) - T2: The running mean after the BatchNormalization operator.

  • running_var (optional, heterogeneous) - T2: The running variance after the BatchNormalization operator. This op uses the population size (N) for calculating variance, and not the sample size N-1.

Type Constraints

  • T in ( tensor(bfloat16), tensor(double), tensor(float), tensor(float16) ): Constrain input and output types to float tensors.

  • T1 in ( tensor(bfloat16), tensor(double), tensor(float), tensor(float16) ): Constrain scale and bias types to float tensors.

  • T2 in ( tensor(bfloat16), tensor(double), tensor(float), tensor(float16) ): Constrain mean and variance types to float tensors.

OnnxBatchNormalization_1#

class mlprodict.npy.xop_auto_import_.OnnxBatchNormalization_1(*args, **kwargs)#

Version

  • name: BatchNormalization (GitHub)

  • domain: main

  • since_version: 1

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: False

This version of the operator has been available since version 1.

Summary

Carries out batch normalization as described in the paper https://arxiv.org/abs/1502.03167. Depending on the mode it is being run, there are multiple cases for the number of outputs, which we list below:

Output case #1: Y, mean, var, saved_mean, saved_var (training mode) Output case #2: Y (test mode)

Attributes

  • consumed_inputs (required): legacy optimization attribute.

  • epsilon: The epsilon value to use to avoid division by zero, default is 1e-5f. Default value is 9.999999747378752e-06.

  • is_test: If set to nonzero, run spatial batch normalization in test mode, default is 0. Default value is 0.

  • momentum: Factor used in computing the running mean and variance.e.g., running_mean = running_mean * momentum + mean * (1 - momentum), default is 0.9f. Default value is 0.8999999761581421.

  • spatial: If true, compute the mean and variance across all spatial elements If false, compute the mean and variance across per feature.Default is 1. Default value is 1.

Inputs

  • X (heterogeneous) - T: The input 4-dimensional tensor of shape NCHW.

  • scale (heterogeneous) - T: The scale as a 1-dimensional tensor of size C to be applied to the output.

  • B (heterogeneous) - T: The bias as a 1-dimensional tensor of size C to be applied to the output.

  • mean (heterogeneous) - T: The running mean (training) or the estimated mean (testing) as a 1-dimensional tensor of size C.

  • var (heterogeneous) - T: The running variance (training) or the estimated variance (testing) as a 1-dimensional tensor of size C.

Outputs

Between 1 and 5 outputs.

  • Y (heterogeneous) - T: The output 4-dimensional tensor of the same shape as X.

  • mean (optional, heterogeneous) - T: The running mean after the BatchNormalization operator. Must be in- place with the input mean. Should not be used for testing.

  • var (optional, heterogeneous) - T: The running variance after the BatchNormalization operator. Must be in-place with the input var. Should not be used for testing.

  • saved_mean (optional, heterogeneous) - T: Saved mean used during training to speed up gradient computation. Should not be used for testing.

  • saved_var (optional, heterogeneous) - T: Saved variance used during training to speed up gradient computation. Should not be used for testing.

Type Constraints

  • T in ( tensor(double), tensor(float), tensor(float16) ): Constrain input and output types to float tensors.

OnnxBatchNormalization_14#

class mlprodict.npy.xop_auto_import_.OnnxBatchNormalization_14(*args, **kwargs)#

Version

  • name: BatchNormalization (GitHub)

  • domain: main

  • since_version: 14

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 14.

Summary

Carries out batch normalization as described in the paper https://arxiv.org/abs/1502.03167. Depending on the mode it is being run, There are five required inputs ‘X’, ‘scale’, ‘B’, ‘input_mean’ and ‘input_var’. Note that ‘input_mean’ and ‘input_var’ are expected to be the estimated statistics in inference mode (training_mode=False, default), and the running statistics in training mode (training_mode=True). There are multiple cases for the number of outputs, which we list below:

Output case #1: Y, running_mean, running_var (training_mode=True) Output case #2: Y (training_mode=False)

When training_mode=False, extra outputs are invalid. The outputs are updated as follows when training_mode=True:

running_mean = input_mean * momentum + current_mean * (1 - momentum)
running_var = input_var * momentum + current_var * (1 - momentum)

Y = (X - current_mean) / sqrt(current_var + epsilon) * scale + B

where:

current_mean = ReduceMean(X, axis=all_except_channel_index)
current_var =  ReduceVar(X, axis=all_except_channel_index)

Notice that ReduceVar refers to the population variance, and it equals to
sum(sqrd(x_i - x_avg)) / N
where N is the population size (this formula does not use sample size N - 1).

When training_mode=False:

Y = (X - input_mean) / sqrt(input_var + epsilon) * scale + B

For previous (depreciated) non-spatial cases, implementors are suggested to flatten the input shape to (N x C * D1 * D2 * … * Dn) before a BatchNormalization Op. This operator has optional inputs/outputs. See ONNX for more details about the representation of optional arguments. An empty string may be used in the place of an actual argument’s name to indicate a missing argument. Trailing optional arguments (those not followed by an argument that is present) may also be simply omitted.

Attributes

  • epsilon: The epsilon value to use to avoid division by zero. Default value is 9.999999747378752e-06.

  • momentum: Factor used in computing the running mean and variance.e.g., running_mean = running_mean * momentum + mean * (1 - momentum). Default value is 0.8999999761581421.

  • training_mode: If set to true, it indicates BatchNormalization is being used for training, and outputs 1, 2, 3, and 4 would be populated. Default value is 0.

Inputs

  • X (heterogeneous) - T: Input data tensor from the previous operator; dimensions are in the form of (N x C x D1 x D2 … Dn), where N is the batch size, C is the number of channels. Statistics are computed for every channel of C over N and D1 to Dn dimensions. For image data, input dimensions become (N x C x H x W). The op also accepts single dimension input of size N in which case C is assumed to be 1

  • scale (heterogeneous) - T: Scale tensor of shape (C).

  • B (heterogeneous) - T: Bias tensor of shape (C).

  • input_mean (heterogeneous) - U: running (training) or estimated (testing) mean tensor of shape (C).

  • input_var (heterogeneous) - U: running (training) or estimated (testing) variance tensor of shape (C).

Outputs

Between 1 and 3 outputs.

  • Y (heterogeneous) - T: The output tensor of the same shape as X

  • running_mean (optional, heterogeneous) - U: The running mean after the BatchNormalization operator.

  • running_var (optional, heterogeneous) - U: The running variance after the BatchNormalization operator. This op uses the population size (N) for calculating variance, and not the sample size N-1.

Type Constraints

  • T in ( tensor(bfloat16), tensor(double), tensor(float), tensor(float16) ): Constrain input and output types to float tensors.

  • U in ( tensor(bfloat16), tensor(double), tensor(float), tensor(float16) ): Constrain mean and variance types to float tensors. It allows all float type for U.

OnnxBatchNormalization_15#

class mlprodict.npy.xop_auto_import_.OnnxBatchNormalization_15(*args, **kwargs)#

Version

  • name: BatchNormalization (GitHub)

  • domain: main

  • since_version: 15

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 15.

Summary

Carries out batch normalization as described in the paper https://arxiv.org/abs/1502.03167. Depending on the mode it is being run, There are five required inputs ‘X’, ‘scale’, ‘B’, ‘input_mean’ and ‘input_var’. Note that ‘input_mean’ and ‘input_var’ are expected to be the estimated statistics in inference mode (training_mode=False, default), and the running statistics in training mode (training_mode=True). There are multiple cases for the number of outputs, which we list below:

Output case #1: Y, running_mean, running_var (training_mode=True) Output case #2: Y (training_mode=False)

When training_mode=False, extra outputs are invalid. The outputs are updated as follows when training_mode=True:

running_mean = input_mean * momentum + current_mean * (1 - momentum)
running_var = input_var * momentum + current_var * (1 - momentum)

Y = (X - current_mean) / sqrt(current_var + epsilon) * scale + B

where:

current_mean = ReduceMean(X, axis=all_except_channel_index)
current_var =  ReduceVar(X, axis=all_except_channel_index)

Notice that ReduceVar refers to the population variance, and it equals to
sum(sqrd(x_i - x_avg)) / N
where N is the population size (this formula does not use sample size N - 1).

The computation of ReduceMean and ReduceVar uses float to avoid overflow for float16 inputs.

When training_mode=False:

Y = (X - input_mean) / sqrt(input_var + epsilon) * scale + B

For previous (depreciated) non-spatial cases, implementors are suggested to flatten the input shape to (N x C * D1 * D2 * … * Dn) before a BatchNormalization Op. This operator has optional inputs/outputs. See ONNX for more details about the representation of optional arguments. An empty string may be used in the place of an actual argument’s name to indicate a missing argument. Trailing optional arguments (those not followed by an argument that is present) may also be simply omitted.

Attributes

  • epsilon: The epsilon value to use to avoid division by zero. Default value is 9.999999747378752e-06.

  • momentum: Factor used in computing the running mean and variance.e.g., running_mean = running_mean * momentum + mean * (1 - momentum). Default value is 0.8999999761581421.

  • training_mode: If set to true, it indicates BatchNormalization is being used for training, and outputs 1, 2, 3, and 4 would be populated. Default value is 0.

Inputs

  • X (heterogeneous) - T: Input data tensor from the previous operator; dimensions are in the form of (N x C x D1 x D2 … Dn), where N is the batch size, C is the number of channels. Statistics are computed for every channel of C over N and D1 to Dn dimensions. For image data, input dimensions become (N x C x H x W). The op also accepts single dimension input of size N in which case C is assumed to be 1

  • scale (heterogeneous) - T1: Scale tensor of shape (C).

  • B (heterogeneous) - T1: Bias tensor of shape (C).

  • input_mean (heterogeneous) - T2: running (training) or estimated (testing) mean tensor of shape (C).

  • input_var (heterogeneous) - T2: running (training) or estimated (testing) variance tensor of shape (C).

Outputs

Between 1 and 3 outputs.

  • Y (heterogeneous) - T: The output tensor of the same shape as X

  • running_mean (optional, heterogeneous) - T2: The running mean after the BatchNormalization operator.

  • running_var (optional, heterogeneous) - T2: The running variance after the BatchNormalization operator. This op uses the population size (N) for calculating variance, and not the sample size N-1.

Type Constraints

  • T in ( tensor(bfloat16), tensor(double), tensor(float), tensor(float16) ): Constrain input and output types to float tensors.

  • T1 in ( tensor(bfloat16), tensor(double), tensor(float), tensor(float16) ): Constrain scale and bias types to float tensors.

  • T2 in ( tensor(bfloat16), tensor(double), tensor(float), tensor(float16) ): Constrain mean and variance types to float tensors.

OnnxBatchNormalization_6#

class mlprodict.npy.xop_auto_import_.OnnxBatchNormalization_6(*args, **kwargs)#

Version

  • name: BatchNormalization (GitHub)

  • domain: main

  • since_version: 6

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 6.

Summary

Carries out batch normalization as described in the paper https://arxiv.org/abs/1502.03167. Depending on the mode it is being run, there are multiple cases for the number of outputs, which we list below:

Output case #1: Y, mean, var, saved_mean, saved_var (training mode) Output case #2: Y (test mode)

Attributes

  • epsilon: The epsilon value to use to avoid division by zero, default is 1e-5f. Default value is 9.999999747378752e-06.

  • is_test: If set to nonzero, run spatial batch normalization in test mode, default is 0. Default value is 0.

  • momentum: Factor used in computing the running mean and variance.e.g., running_mean = running_mean * momentum + mean * (1 - momentum), default is 0.9f. Default value is 0.8999999761581421.

  • spatial: If true, compute the mean and variance across all spatial elements If false, compute the mean and variance across per feature.Default is 1. Default value is 1.

Inputs

  • X (heterogeneous) - T: Input data tensor from the previous operator; dimensions for image case are (N x C x H x W), where N is the batch size, C is the number of channels, and H and W are the height and the width of the data. For non image case, the dimensions are in the form of (N x C x D1 x D2 … Dn), where N is the batch size.

  • scale (heterogeneous) - T: The scale as a 1-dimensional tensor of size C to be applied to the output.

  • B (heterogeneous) - T: The bias as a 1-dimensional tensor of size C to be applied to the output.

  • mean (heterogeneous) - T: The running mean (training) or the estimated mean (testing) as a 1-dimensional tensor of size C.

  • var (heterogeneous) - T: The running variance (training) or the estimated variance (testing) as a 1-dimensional tensor of size C.

Outputs

Between 1 and 5 outputs.

  • Y (heterogeneous) - T: The output tensor of the same shape as X.

  • mean (optional, heterogeneous) - T: The running mean after the BatchNormalization operator. Must be in- place with the input mean. Should not be used for testing.

  • var (optional, heterogeneous) - T: The running variance after the BatchNormalization operator. Must be in-place with the input var. Should not be used for testing.

  • saved_mean (optional, heterogeneous) - T: Saved mean used during training to speed up gradient computation. Should not be used for testing.

  • saved_var (optional, heterogeneous) - T: Saved variance used during training to speed up gradient computation. Should not be used for testing.

Type Constraints

  • T in ( tensor(double), tensor(float), tensor(float16) ): Constrain input and output types to float tensors.

OnnxBatchNormalization_7#

class mlprodict.npy.xop_auto_import_.OnnxBatchNormalization_7(*args, **kwargs)#

Version

  • name: BatchNormalization (GitHub)

  • domain: main

  • since_version: 7

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 7.

Summary

Carries out batch normalization as described in the paper https://arxiv.org/abs/1502.03167. Depending on the mode it is being run, there are multiple cases for the number of outputs, which we list below:

Output case #1: Y, mean, var, saved_mean, saved_var (training mode) Output case #2: Y (test mode)

This operator has optional inputs/outputs. See ONNX for more details about the representation of optional arguments. An empty string may be used in the place of an actual argument’s name to indicate a missing argument. Trailing optional arguments (those not followed by an argument that is present) may also be simply omitted.

Attributes

  • epsilon: The epsilon value to use to avoid division by zero. Default value is 9.999999747378752e-06.

  • momentum: Factor used in computing the running mean and variance.e.g., running_mean = running_mean * momentum + mean * (1 - momentum). Default value is 0.8999999761581421.

  • spatial: If true, compute the mean and variance across per activation. If false, compute the mean and variance across per feature over each mini-batch. Default value is 1.

Inputs

  • X (heterogeneous) - T: Input data tensor from the previous operator; dimensions for image case are (N x C x H x W), where N is the batch size, C is the number of channels, and H and W are the height and the width of the data. For non image case, the dimensions are in the form of (N x C x D1 x D2 … Dn), where N is the batch size.

  • scale (heterogeneous) - T: If spatial is true, the dimension of scale is (C). If spatial is false, the dimensions of scale are (C x D1 x … x Dn)

  • B (heterogeneous) - T: If spatial is true, the dimension of bias is (C). If spatial is false, the dimensions of bias are (C x D1 x … x Dn)

  • mean (heterogeneous) - T: If spatial is true, the dimension of the running mean (training) or the estimated mean (testing) is (C). If spatial is false, the dimensions of the running mean (training) or the estimated mean (testing) are (C x D1 x … x Dn).

  • var (heterogeneous) - T: If spatial is true, the dimension of the running variance(training) or the estimated variance (testing) is (C). If spatial is false, the dimensions of the running variance(training) or the estimated variance (testing) are (C x D1 x … x Dn).

Outputs

Between 1 and 5 outputs.

  • Y (heterogeneous) - T: The output tensor of the same shape as X

  • mean (optional, heterogeneous) - T: The running mean after the BatchNormalization operator.

  • var (optional, heterogeneous) - T: The running variance after the BatchNormalization operator.

  • saved_mean (optional, heterogeneous) - T: Saved mean used during training to speed up gradient computation.

  • saved_var (optional, heterogeneous) - T: Saved variance used during training to speed up gradient computation.

Type Constraints

  • T in ( tensor(double), tensor(float), tensor(float16) ): Constrain input and output types to float tensors.

OnnxBatchNormalization_9#

class mlprodict.npy.xop_auto_import_.OnnxBatchNormalization_9(*args, **kwargs)#

Version

  • name: BatchNormalization (GitHub)

  • domain: main

  • since_version: 9

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 9.

Summary

Carries out batch normalization as described in the paper https://arxiv.org/abs/1502.03167. Depending on the mode it is being run, there are multiple cases for the number of outputs, which we list below:

Output case #1: Y, mean, var, saved_mean, saved_var (training mode) Output case #2: Y (test mode)

For previous (depreciated) non-spatial cases, implementors are suggested to flatten the input shape to (N x C*D1*D2 ..*Dn) before a BatchNormalization Op. This operator has optional inputs/outputs. See ONNX for more details about the representation of optional arguments. An empty string may be used in the place of an actual argument’s name to indicate a missing argument. Trailing optional arguments (those not followed by an argument that is present) may also be simply omitted.

Attributes

  • epsilon: The epsilon value to use to avoid division by zero. Default value is 9.999999747378752e-06.

  • momentum: Factor used in computing the running mean and variance.e.g., running_mean = running_mean * momentum + mean * (1 - momentum). Default value is 0.8999999761581421.

Inputs

  • X (heterogeneous) - T: Input data tensor from the previous operator; dimensions are in the form of (N x C x D1 x D2 … Dn), where N is the batch size, C is the number of channels. Statistics are computed for every channel of C over N and D1 to Dn dimensions. For image data, input dimensions become (N x C x H x W). The op also accepts single dimension input of size N in which case C is assumed to be 1

  • scale (heterogeneous) - T: Scale tensor of shape (C).

  • B (heterogeneous) - T: Bias tensor of shape (C).

  • mean (heterogeneous) - T: running (training) or estimated (testing) mean tensor of shape (C).

  • var (heterogeneous) - T: running (training) or estimated (testing) variance tensor of shape (C).

Outputs

Between 1 and 5 outputs.

  • Y (heterogeneous) - T: The output tensor of the same shape as X

  • mean (optional, heterogeneous) - T: The running mean after the BatchNormalization operator.

  • var (optional, heterogeneous) - T: The running variance after the BatchNormalization operator.

  • saved_mean (optional, heterogeneous) - T: Saved mean used during training to speed up gradient computation.

  • saved_var (optional, heterogeneous) - T: Saved variance used during training to speed up gradient computation.

Type Constraints

  • T in ( tensor(double), tensor(float), tensor(float16) ): Constrain input and output types to float tensors.

OnnxBernoulli#

class mlprodict.npy.xop_auto_import_.OnnxBernoulli(*args, **kwargs)#

Version

  • name: Bernoulli (GitHub)

  • domain: main

  • since_version: 15

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 15.

Summary

Draws binary random numbers (0 or 1) from a Bernoulli distribution. The input tensor should be a tensor containing probabilities p (a value in the range [0,1]) to be used for drawing the binary random number, where an output of 1 is produced with probability p and an output of 0 is produced with probability (1-p).

This operator is non-deterministic and may not produce the same values in different implementations (even if a seed is specified).

Attributes

  • dtype: The data type for the elements of the output tensor. if not specified, we will use the data type of the input tensor.

  • seed: (Optional) Seed to the random generator, if not specified we will auto generate one.

Inputs

  • input (heterogeneous) - T1: All values in input have to be in the range:[0, 1].

Outputs

  • output (heterogeneous) - T2: The returned output tensor only has values 0 or 1, same shape as input tensor.

Type Constraints

  • T1 in ( tensor(double), tensor(float), tensor(float16) ): Constrain input types to float tensors.

  • T2 in ( tensor(bfloat16), tensor(bool), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) ): Constrain output types to all numeric tensors and bool tensors.

OnnxBernoulli_15#

class mlprodict.npy.xop_auto_import_.OnnxBernoulli_15(*args, **kwargs)#

Version

  • name: Bernoulli (GitHub)

  • domain: main

  • since_version: 15

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 15.

Summary

Draws binary random numbers (0 or 1) from a Bernoulli distribution. The input tensor should be a tensor containing probabilities p (a value in the range [0,1]) to be used for drawing the binary random number, where an output of 1 is produced with probability p and an output of 0 is produced with probability (1-p).

This operator is non-deterministic and may not produce the same values in different implementations (even if a seed is specified).

Attributes

  • dtype: The data type for the elements of the output tensor. if not specified, we will use the data type of the input tensor.

  • seed: (Optional) Seed to the random generator, if not specified we will auto generate one.

Inputs

  • input (heterogeneous) - T1: All values in input have to be in the range:[0, 1].

Outputs

  • output (heterogeneous) - T2: The returned output tensor only has values 0 or 1, same shape as input tensor.

Type Constraints

  • T1 in ( tensor(double), tensor(float), tensor(float16) ): Constrain input types to float tensors.

  • T2 in ( tensor(bfloat16), tensor(bool), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) ): Constrain output types to all numeric tensors and bool tensors.

OnnxBitShift#

class mlprodict.npy.xop_auto_import_.OnnxBitShift(*args, **kwargs)#

Version

  • name: BitShift (GitHub)

  • domain: main

  • since_version: 11

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 11.

Summary

Bitwise shift operator performs element-wise operation. For each input element, if the

attribute “direction” is “RIGHT”, this operator moves its binary representation toward the right side so that the input value is effectively decreased. If the attribute “direction” is “LEFT”, bits of binary representation moves toward the left side, which results the increase of its actual value. The input X is the tensor to be shifted and another input Y specifies the amounts of shifting. For example, if “direction” is “Right”, X is [1, 4], and S is [1, 1], the corresponding output Z would be [0, 2]. If “direction” is “LEFT” with X=[1, 2] and S=[1, 2], the corresponding output Y would be [2, 8].

Because this operator supports Numpy-style broadcasting, X’s and Y’s shapes are not necessarily identical.

This operator supports multidirectional (i.e., Numpy-style) broadcasting; for more details please check Broadcasting in ONNX.

Attributes

  • direction (required): Direction of moving bits. It can be either “RIGHT” (for right shift) or “LEFT” (for left shift).

Inputs

  • X (heterogeneous) - T: First operand, input to be shifted.

  • Y (heterogeneous) - T: Second operand, amounts of shift.

Outputs

  • Z (heterogeneous) - T: Output tensor

Type Constraints

  • T in ( tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) ): Constrain input and output types to integer tensors.

OnnxBitShift_11#

class mlprodict.npy.xop_auto_import_.OnnxBitShift_11(*args, **kwargs)#

Version

  • name: BitShift (GitHub)

  • domain: main

  • since_version: 11

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 11.

Summary

Bitwise shift operator performs element-wise operation. For each input element, if the

attribute “direction” is “RIGHT”, this operator moves its binary representation toward the right side so that the input value is effectively decreased. If the attribute “direction” is “LEFT”, bits of binary representation moves toward the left side, which results the increase of its actual value. The input X is the tensor to be shifted and another input Y specifies the amounts of shifting. For example, if “direction” is “Right”, X is [1, 4], and S is [1, 1], the corresponding output Z would be [0, 2]. If “direction” is “LEFT” with X=[1, 2] and S=[1, 2], the corresponding output Y would be [2, 8].

Because this operator supports Numpy-style broadcasting, X’s and Y’s shapes are not necessarily identical.

This operator supports multidirectional (i.e., Numpy-style) broadcasting; for more details please check Broadcasting in ONNX.

Attributes

  • direction (required): Direction of moving bits. It can be either “RIGHT” (for right shift) or “LEFT” (for left shift).

Inputs

  • X (heterogeneous) - T: First operand, input to be shifted.

  • Y (heterogeneous) - T: Second operand, amounts of shift.

Outputs

  • Z (heterogeneous) - T: Output tensor

Type Constraints

  • T in ( tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) ): Constrain input and output types to integer tensors.

OnnxBitwiseAnd#

class mlprodict.npy.xop_auto_import_.OnnxBitwiseAnd(*args, **kwargs)#

Version

  • name: BitwiseAnd (GitHub)

  • domain: main

  • since_version: 18

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 18.

Summary

Returns the tensor resulting from performing the bitwise and operation elementwise on the input tensors A and B (with Numpy-style broadcasting support).

This operator supports multidirectional (i.e., Numpy-style) broadcasting; for more details please check Broadcasting in ONNX.

Inputs

  • A (heterogeneous) - T: First input operand for the bitwise operator.

  • B (heterogeneous) - T: Second input operand for the bitwise operator.

Outputs

  • C (heterogeneous) - T: Result tensor.

Type Constraints

  • T in ( tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) ): Constrain input to integer tensors.

OnnxBitwiseAnd_18#

class mlprodict.npy.xop_auto_import_.OnnxBitwiseAnd_18(*args, **kwargs)#

Version

  • name: BitwiseAnd (GitHub)

  • domain: main

  • since_version: 18

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 18.

Summary

Returns the tensor resulting from performing the bitwise and operation elementwise on the input tensors A and B (with Numpy-style broadcasting support).

This operator supports multidirectional (i.e., Numpy-style) broadcasting; for more details please check Broadcasting in ONNX.

Inputs

  • A (heterogeneous) - T: First input operand for the bitwise operator.

  • B (heterogeneous) - T: Second input operand for the bitwise operator.

Outputs

  • C (heterogeneous) - T: Result tensor.

Type Constraints

  • T in ( tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) ): Constrain input to integer tensors.

OnnxBitwiseNot#

class mlprodict.npy.xop_auto_import_.OnnxBitwiseNot(*args, **kwargs)#

Version

  • name: BitwiseNot (GitHub)

  • domain: main

  • since_version: 18

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 18.

Summary

Returns the bitwise not of the input tensor element-wise.

Inputs

  • X (heterogeneous) - T: Input tensor

Outputs

  • Y (heterogeneous) - T: Output tensor

Type Constraints

  • T in ( tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) ): Constrain input/output to integer tensors.

OnnxBitwiseNot_18#

class mlprodict.npy.xop_auto_import_.OnnxBitwiseNot_18(*args, **kwargs)#

Version

  • name: BitwiseNot (GitHub)

  • domain: main

  • since_version: 18

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 18.

Summary

Returns the bitwise not of the input tensor element-wise.

Inputs

  • X (heterogeneous) - T: Input tensor

Outputs

  • Y (heterogeneous) - T: Output tensor

Type Constraints

  • T in ( tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) ): Constrain input/output to integer tensors.

OnnxBitwiseOr#

class mlprodict.npy.xop_auto_import_.OnnxBitwiseOr(*args, **kwargs)#

Version

  • name: BitwiseOr (GitHub)

  • domain: main

  • since_version: 18

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 18.

Summary

Returns the tensor resulting from performing the bitwise or operation elementwise on the input tensors A and B (with Numpy-style broadcasting support).

This operator supports multidirectional (i.e., Numpy-style) broadcasting; for more details please check Broadcasting in ONNX.

Inputs

  • A (heterogeneous) - T: First input operand for the bitwise operator.

  • B (heterogeneous) - T: Second input operand for the bitwise operator.

Outputs

  • C (heterogeneous) - T: Result tensor.

Type Constraints

  • T in ( tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) ): Constrain input to integer tensors.

OnnxBitwiseOr_18#

class mlprodict.npy.xop_auto_import_.OnnxBitwiseOr_18(*args, **kwargs)#

Version

  • name: BitwiseOr (GitHub)

  • domain: main

  • since_version: 18

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 18.

Summary

Returns the tensor resulting from performing the bitwise or operation elementwise on the input tensors A and B (with Numpy-style broadcasting support).

This operator supports multidirectional (i.e., Numpy-style) broadcasting; for more details please check Broadcasting in ONNX.

Inputs

  • A (heterogeneous) - T: First input operand for the bitwise operator.

  • B (heterogeneous) - T: Second input operand for the bitwise operator.

Outputs

  • C (heterogeneous) - T: Result tensor.

Type Constraints

  • T in ( tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) ): Constrain input to integer tensors.

OnnxBitwiseXor#

class mlprodict.npy.xop_auto_import_.OnnxBitwiseXor(*args, **kwargs)#

Version

  • name: BitwiseXor (GitHub)

  • domain: main

  • since_version: 18

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 18.

Summary

Returns the tensor resulting from performing the bitwise xor operation elementwise on the input tensors A and B (with Numpy-style broadcasting support).

This operator supports multidirectional (i.e., Numpy-style) broadcasting; for more details please check Broadcasting in ONNX.

Inputs

  • A (heterogeneous) - T: First input operand for the bitwise operator.

  • B (heterogeneous) - T: Second input operand for the bitwise operator.

Outputs

  • C (heterogeneous) - T: Result tensor.

Type Constraints

  • T in ( tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) ): Constrain input to integer tensors.

OnnxBitwiseXor_18#

class mlprodict.npy.xop_auto_import_.OnnxBitwiseXor_18(*args, **kwargs)#

Version

  • name: BitwiseXor (GitHub)

  • domain: main

  • since_version: 18

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 18.

Summary

Returns the tensor resulting from performing the bitwise xor operation elementwise on the input tensors A and B (with Numpy-style broadcasting support).

This operator supports multidirectional (i.e., Numpy-style) broadcasting; for more details please check Broadcasting in ONNX.

Inputs

  • A (heterogeneous) - T: First input operand for the bitwise operator.

  • B (heterogeneous) - T: Second input operand for the bitwise operator.

Outputs

  • C (heterogeneous) - T: Result tensor.

Type Constraints

  • T in ( tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) ): Constrain input to integer tensors.

OnnxBlackmanWindow#

class mlprodict.npy.xop_auto_import_.OnnxBlackmanWindow(*args, **kwargs)#

Version

  • name: BlackmanWindow (GitHub)

  • domain: main

  • since_version: 17

  • function: True

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 17.

Summary

Generates a Blackman window as described in the paper https://ieeexplore.ieee.org/document/1455106.

Attributes

  • output_datatype: The data type of the output tensor. Strictly must be one of the values from DataType enum in TensorProto whose values correspond to T2. The default value is 1 = FLOAT. Default value is 1.

  • periodic: If 1, returns a window to be used as periodic function. If 0, return a symmetric window. When ‘periodic’ is specified, hann computes a window of length size + 1 and returns the first size points. The default value is 1. Default value is 1.

Inputs

  • size (heterogeneous) - T1: A scalar value indicating the length of the window.

Outputs

  • output (heterogeneous) - T2: A Blackman window with length: size. The output has the shape: [size].

Type Constraints

  • T1 in ( tensor(int32), tensor(int64) ): Constrain the input size to int64_t.

  • T2 in ( tensor(bfloat16), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) ): Constrain output types to numeric tensors.

OnnxBlackmanWindow_17#

class mlprodict.npy.xop_auto_import_.OnnxBlackmanWindow_17(*args, **kwargs)#

Version

  • name: BlackmanWindow (GitHub)

  • domain: main

  • since_version: 17

  • function: True

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 17.

Summary

Generates a Blackman window as described in the paper https://ieeexplore.ieee.org/document/1455106.

Attributes

  • output_datatype: The data type of the output tensor. Strictly must be one of the values from DataType enum in TensorProto whose values correspond to T2. The default value is 1 = FLOAT. Default value is 1.

  • periodic: If 1, returns a window to be used as periodic function. If 0, return a symmetric window. When ‘periodic’ is specified, hann computes a window of length size + 1 and returns the first size points. The default value is 1. Default value is 1.

Inputs

  • size (heterogeneous) - T1: A scalar value indicating the length of the window.

Outputs

  • output (heterogeneous) - T2: A Blackman window with length: size. The output has the shape: [size].

Type Constraints

  • T1 in ( tensor(int32), tensor(int64) ): Constrain the input size to int64_t.

  • T2 in ( tensor(bfloat16), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) ): Constrain output types to numeric tensors.

OnnxCast#

class mlprodict.npy.xop_auto_import_.OnnxCast(*args, **kwargs)#

Version

  • name: Cast (GitHub)

  • domain: main

  • since_version: 13

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 13.

Summary

The operator casts the elements of a given input tensor to a data type specified by the ‘to’ argument and returns an output tensor of the same size in the converted type. The ‘to’ argument must be one of the data types specified in the ‘DataType’ enum field in the TensorProto message.

Casting from string tensor in plain (e.g., “3.14” and “1000”) and scientific numeric representations (e.g., “1e-5” and “1E8”) to float types is supported. For example, converting string “100.5” to an integer may result 100. There are some string literals reserved for special floating-point values; “+INF” (and “INF”), “-INF”, and “NaN” are positive infinity, negative infinity, and not-a-number, respectively. Any string which can exactly match “+INF” in a case-insensitive way would be mapped to positive infinite. Similarly, this case-insensitive rule is applied to “INF” and “NaN”. When casting from numeric tensors to string tensors, plain floating-point representation (such as “314.15926”) would be used. Converting non-numerical-literal string such as “Hello World!” is an undefined behavior. Cases of converting string representing floating-point arithmetic value, such as “2.718”, to INT is an undefined behavior.

Conversion from a numerical type to any numerical type is always allowed. User must be aware of precision loss and value change caused by range difference between two types. For example, a 64-bit float 3.1415926459 may be round to a 32-bit float 3.141592. Similarly, converting an integer 36 to Boolean may produce 1 because we truncate bits which can’t be stored in the targeted type.

In more detail, the conversion among numerical types should follow these rules:

  • Casting from floating point to: * floating point: +/- infinity if OOR (out of range). * fixed point: undefined if OOR. * bool: +/- 0.0 to False; all else to True.

  • Casting from fixed point to: * floating point: +/- infinity if OOR. (+ infinity in the case of uint) * fixed point: when OOR, discard higher bits and reinterpret (with respect to two’s complement representation for

signed types). For example, 200 (int16) -> -56 (int8).
  • bool: zero to False; nonzero to True.

  • Casting from bool to: * floating point: {1.0, 0.0}. * fixed point: {1, 0}. * bool: no change.

Attributes

  • to (required): The data type to which the elements of the input tensor are cast. Strictly must be one of the types from DataType enum in TensorProto

Inputs

  • input (heterogeneous) - T1: Input tensor to be cast.

Outputs

  • output (heterogeneous) - T2: Output tensor with the same shape as input with type specified by the ‘to’ argument

Type Constraints

  • T1 in ( tensor(bfloat16), tensor(bool), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(string), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) ): Constrain input types. Casting from complex is not supported.

  • T2 in ( tensor(bfloat16), tensor(bool), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(string), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) ): Constrain output types. Casting to complex is not supported.

OnnxCastLike#

class mlprodict.npy.xop_auto_import_.OnnxCastLike(*args, **kwargs)#

Version

  • name: CastLike (GitHub)

  • domain: main

  • since_version: 15

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 15.

Summary

The operator casts the elements of a given input tensor (the first input) to the same data type as the elements of the second input tensor. See documentation of the Cast operator for further details.

Inputs

  • input (heterogeneous) - T1: Input tensor to be cast.

  • target_type (heterogeneous) - T2: The (first) input tensor will be cast to produce a tensor of the same type as this (second input) tensor.

Outputs

  • output (heterogeneous) - T2: Output tensor produced by casting the first input tensor to have the same type as the second input tensor.

Type Constraints

  • T1 in ( tensor(bfloat16), tensor(bool), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(string), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) ): Constrain input types. Casting from complex is not supported.

  • T2 in ( tensor(bfloat16), tensor(bool), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(string), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) ): Constrain output types. Casting to complex is not supported.

OnnxCastLike_15#

class mlprodict.npy.xop_auto_import_.OnnxCastLike_15(*args, **kwargs)#

Version

  • name: CastLike (GitHub)

  • domain: main

  • since_version: 15

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 15.

Summary

The operator casts the elements of a given input tensor (the first input) to the same data type as the elements of the second input tensor. See documentation of the Cast operator for further details.

Inputs

  • input (heterogeneous) - T1: Input tensor to be cast.

  • target_type (heterogeneous) - T2: The (first) input tensor will be cast to produce a tensor of the same type as this (second input) tensor.

Outputs

  • output (heterogeneous) - T2: Output tensor produced by casting the first input tensor to have the same type as the second input tensor.

Type Constraints

  • T1 in ( tensor(bfloat16), tensor(bool), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(string), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) ): Constrain input types. Casting from complex is not supported.

  • T2 in ( tensor(bfloat16), tensor(bool), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(string), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) ): Constrain output types. Casting to complex is not supported.

OnnxCast_1#

class mlprodict.npy.xop_auto_import_.OnnxCast_1(*args, **kwargs)#

Version

  • name: Cast (GitHub)

  • domain: main

  • since_version: 1

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: False

This version of the operator has been available since version 1.

Summary

The operator casts the elements of a given input tensor to a data type specified by the ‘to’ argument and returns an output tensor of the same size in the converted type. The ‘to’ argument must be one of the data types specified in the ‘DataType’ enum field in the TensorProto message. NOTE: Casting to and from strings is not supported yet.

Attributes

  • to (required): The data type to which the elements of the input tensor are cast. Strictly must be one of the types from DataType enum in TensorProto

Inputs

  • input (heterogeneous) - T1: Input tensor to be cast.

Outputs

  • output (heterogeneous) - T2: Output tensor with the same shape as input with type specified by the ‘to’ argument

Type Constraints

  • T1 in ( tensor(bool), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) ): Constrain input types. Casting from strings and complex are not supported.

  • T2 in ( tensor(bool), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) ): Constrain output types. Casting to strings and complex are not supported.

OnnxCast_13#

class mlprodict.npy.xop_auto_import_.OnnxCast_13(*args, **kwargs)#

Version

  • name: Cast (GitHub)

  • domain: main

  • since_version: 13

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 13.

Summary

The operator casts the elements of a given input tensor to a data type specified by the ‘to’ argument and returns an output tensor of the same size in the converted type. The ‘to’ argument must be one of the data types specified in the ‘DataType’ enum field in the TensorProto message.

Casting from string tensor in plain (e.g., “3.14” and “1000”) and scientific numeric representations (e.g., “1e-5” and “1E8”) to float types is supported. For example, converting string “100.5” to an integer may result 100. There are some string literals reserved for special floating-point values; “+INF” (and “INF”), “-INF”, and “NaN” are positive infinity, negative infinity, and not-a-number, respectively. Any string which can exactly match “+INF” in a case-insensitive way would be mapped to positive infinite. Similarly, this case-insensitive rule is applied to “INF” and “NaN”. When casting from numeric tensors to string tensors, plain floating-point representation (such as “314.15926”) would be used. Converting non-numerical-literal string such as “Hello World!” is an undefined behavior. Cases of converting string representing floating-point arithmetic value, such as “2.718”, to INT is an undefined behavior.

Conversion from a numerical type to any numerical type is always allowed. User must be aware of precision loss and value change caused by range difference between two types. For example, a 64-bit float 3.1415926459 may be round to a 32-bit float 3.141592. Similarly, converting an integer 36 to Boolean may produce 1 because we truncate bits which can’t be stored in the targeted type.

In more detail, the conversion among numerical types should follow these rules:

  • Casting from floating point to: * floating point: +/- infinity if OOR (out of range). * fixed point: undefined if OOR. * bool: +/- 0.0 to False; all else to True.

  • Casting from fixed point to: * floating point: +/- infinity if OOR. (+ infinity in the case of uint) * fixed point: when OOR, discard higher bits and reinterpret (with respect to two’s complement representation for

signed types). For example, 200 (int16) -> -56 (int8).
  • bool: zero to False; nonzero to True.

  • Casting from bool to: * floating point: {1.0, 0.0}. * fixed point: {1, 0}. * bool: no change.

Attributes

  • to (required): The data type to which the elements of the input tensor are cast. Strictly must be one of the types from DataType enum in TensorProto

Inputs

  • input (heterogeneous) - T1: Input tensor to be cast.

Outputs

  • output (heterogeneous) - T2: Output tensor with the same shape as input with type specified by the ‘to’ argument

Type Constraints

  • T1 in ( tensor(bfloat16), tensor(bool), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(string), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) ): Constrain input types. Casting from complex is not supported.

  • T2 in ( tensor(bfloat16), tensor(bool), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(string), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) ): Constrain output types. Casting to complex is not supported.

OnnxCast_6#

class mlprodict.npy.xop_auto_import_.OnnxCast_6(*args, **kwargs)#

Version

  • name: Cast (GitHub)

  • domain: main

  • since_version: 6

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 6.

Summary

The operator casts the elements of a given input tensor to a data type specified by the ‘to’ argument and returns an output tensor of the same size in the converted type. The ‘to’ argument must be one of the data types specified in the ‘DataType’ enum field in the TensorProto message. NOTE: Casting to and from strings is not supported yet.

Attributes

  • to (required): The data type to which the elements of the input tensor are cast. Strictly must be one of the types from DataType enum in TensorProto

Inputs

  • input (heterogeneous) - T1: Input tensor to be cast.

Outputs

  • output (heterogeneous) - T2: Output tensor with the same shape as input with type specified by the ‘to’ argument

Type Constraints

  • T1 in ( tensor(bool), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) ): Constrain input types. Casting from strings and complex are not supported.

  • T2 in ( tensor(bool), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) ): Constrain output types. Casting to strings and complex are not supported.

OnnxCast_9#

class mlprodict.npy.xop_auto_import_.OnnxCast_9(*args, **kwargs)#

Version

  • name: Cast (GitHub)

  • domain: main

  • since_version: 9

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 9.

Summary

The operator casts the elements of a given input tensor to a data type specified by the ‘to’ argument and returns an output tensor of the same size in the converted type. The ‘to’ argument must be one of the data types specified in the ‘DataType’ enum field in the TensorProto message.

Casting from string tensor in plain (e.g., “3.14” and “1000”) and scientific numeric representations (e.g., “1e-5” and “1E8”) to float types is supported. For example, converting string “100.5” to an integer may result 100. There are some string literals reserved for special floating-point values; “+INF” (and “INF”), “-INF”, and “NaN” are positive infinity, negative infinity, and not-a-number, respectively. Any string which can exactly match “+INF” in a case-insensitive way would be mapped to positive infinite. Similarly, this case-insensitive rule is applied to “INF” and “NaN”. When casting from numeric tensors to string tensors, plain floating-point representation (such as “314.15926”) would be used. Converting non-numerical-literal string such as “Hello World!” is an undefined behavior. Cases of converting string representing floating-point arithmetic value, such as “2.718”, to INT is an undefined behavior.

Conversion from a numerical type to any numerical type is always allowed. User must be aware of precision loss and value change caused by range difference between two types. For example, a 64-bit float 3.1415926459 may be round to a 32-bit float 3.141592. Similarly, converting an integer 36 to Boolean may produce 1 because we truncate bits which can’t be stored in the targeted type.

Attributes

  • to (required): The data type to which the elements of the input tensor are cast. Strictly must be one of the types from DataType enum in TensorProto

Inputs

  • input (heterogeneous) - T1: Input tensor to be cast.

Outputs

  • output (heterogeneous) - T2: Output tensor with the same shape as input with type specified by the ‘to’ argument

Type Constraints

  • T1 in ( tensor(bool), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(string), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) ): Constrain input types. Casting from complex is not supported.

  • T2 in ( tensor(bool), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(string), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) ): Constrain output types. Casting to complex is not supported.

OnnxCeil#

class mlprodict.npy.xop_auto_import_.OnnxCeil(*args, **kwargs)#

Version

  • name: Ceil (GitHub)

  • domain: main

  • since_version: 13

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 13.

Summary

Ceil takes one input data (Tensor<T>) and produces one output data (Tensor<T>) where the ceil is, y = ceil(x), is applied to the tensor elementwise.

Inputs

  • X (heterogeneous) - T: Input tensor

Outputs

  • Y (heterogeneous) - T: Output tensor

Type Constraints

  • T in ( tensor(bfloat16), tensor(double), tensor(float), tensor(float16) ): Constrain input and output types to float tensors.

OnnxCeil_1#

class mlprodict.npy.xop_auto_import_.OnnxCeil_1(*args, **kwargs)#

Version

  • name: Ceil (GitHub)

  • domain: main

  • since_version: 1

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: False

This version of the operator has been available since version 1.

Summary

Ceil takes one input data (Tensor<T>) and produces one output data (Tensor<T>) where the ceil is, y = ceil(x), is applied to the tensor elementwise.

Attributes

  • consumed_inputs: legacy optimization attribute.

Inputs

  • X (heterogeneous) - T: Input tensor

Outputs

  • Y (heterogeneous) - T: Output tensor

Type Constraints

  • T in ( tensor(double), tensor(float), tensor(float16) ): Constrain input and output types to float tensors.

OnnxCeil_13#

class mlprodict.npy.xop_auto_import_.OnnxCeil_13(*args, **kwargs)#

Version

  • name: Ceil (GitHub)

  • domain: main

  • since_version: 13

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 13.

Summary

Ceil takes one input data (Tensor<T>) and produces one output data (Tensor<T>) where the ceil is, y = ceil(x), is applied to the tensor elementwise.

Inputs

  • X (heterogeneous) - T: Input tensor

Outputs

  • Y (heterogeneous) - T: Output tensor

Type Constraints

  • T in ( tensor(bfloat16), tensor(double), tensor(float), tensor(float16) ): Constrain input and output types to float tensors.

OnnxCeil_6#

class mlprodict.npy.xop_auto_import_.OnnxCeil_6(*args, **kwargs)#

Version

  • name: Ceil (GitHub)

  • domain: main

  • since_version: 6

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 6.

Summary

Ceil takes one input data (Tensor<T>) and produces one output data (Tensor<T>) where the ceil is, y = ceil(x), is applied to the tensor elementwise.

Inputs

  • X (heterogeneous) - T: Input tensor

Outputs

  • Y (heterogeneous) - T: Output tensor

Type Constraints

  • T in ( tensor(double), tensor(float), tensor(float16) ): Constrain input and output types to float tensors.

OnnxCelu#

class mlprodict.npy.xop_auto_import_.OnnxCelu(*args, **kwargs)#

Version

  • name: Celu (GitHub)

  • domain: main

  • since_version: 12

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 12.

Summary

Continuously Differentiable Exponential Linear Units: Perform the linear unit element-wise on the input tensor X using formula:

max(0,x) + min(0,alpha*(exp(x/alpha)-1))

Attributes

  • alpha: The Alpha value in Celu formula which control the shape of the unit. The default value is 1.0. Default value is 1.0.

Inputs

  • X (heterogeneous) - T: Input tensor

Outputs

  • Y (heterogeneous) - T: Output tensor

Type Constraints

  • T in ( tensor(float) ): Constrain input and output types to float32 tensors.

OnnxCelu_12#

class mlprodict.npy.xop_auto_import_.OnnxCelu_12(*args, **kwargs)#

Version

  • name: Celu (GitHub)

  • domain: main

  • since_version: 12

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 12.

Summary

Continuously Differentiable Exponential Linear Units: Perform the linear unit element-wise on the input tensor X using formula:

max(0,x) + min(0,alpha*(exp(x/alpha)-1))

Attributes

  • alpha: The Alpha value in Celu formula which control the shape of the unit. The default value is 1.0. Default value is 1.0.

Inputs

  • X (heterogeneous) - T: Input tensor

Outputs

  • Y (heterogeneous) - T: Output tensor

Type Constraints

  • T in ( tensor(float) ): Constrain input and output types to float32 tensors.

OnnxCenterCropPad#

class mlprodict.npy.xop_auto_import_.OnnxCenterCropPad(*args, **kwargs)#

Version

  • name: CenterCropPad (GitHub)

  • domain: main

  • since_version: 18

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 18.

Summary

Center crop or pad an input to given dimensions.

The crop/pad dimensions can be specified for a subset of the axes. Non-specified dimensions will not be cropped or padded.

If the input dimensions are bigger than the crop shape, a centered cropping window is extracted from the input. If the input dimensions are smaller than the crop shape, the input is padded on each side equally, so that the input is centered in the output.

Attributes

  • axes: If provided, it specifies a subset of axes that ‘shape’ refer to. If not provided, all axes are assumed [0, 1, …, r-1], where r = rank(data). Negative value means counting dimensions from the back. Accepted range is [-r, r-1], where r = rank(data). Behavior is undefined if an axis is repeated.

Inputs

  • input_data (heterogeneous) - T: Input to extract the centered crop from.

  • shape (heterogeneous) - Tind: 1-D tensor representing the cropping window dimensions.

Outputs

  • output_data (heterogeneous) - T: Output data.

Type Constraints

  • T in ( tensor(bfloat16), tensor(bool), tensor(complex128), tensor(complex64), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(string), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) ): Constrain input and output types to all tensor types.

  • Tind in ( tensor(int32), tensor(int64) ): Constrain indices to integer types

OnnxCenterCropPad_18#

class mlprodict.npy.xop_auto_import_.OnnxCenterCropPad_18(*args, **kwargs)#

Version

  • name: CenterCropPad (GitHub)

  • domain: main

  • since_version: 18

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 18.

Summary

Center crop or pad an input to given dimensions.

The crop/pad dimensions can be specified for a subset of the axes. Non-specified dimensions will not be cropped or padded.

If the input dimensions are bigger than the crop shape, a centered cropping window is extracted from the input. If the input dimensions are smaller than the crop shape, the input is padded on each side equally, so that the input is centered in the output.

Attributes

  • axes: If provided, it specifies a subset of axes that ‘shape’ refer to. If not provided, all axes are assumed [0, 1, …, r-1], where r = rank(data). Negative value means counting dimensions from the back. Accepted range is [-r, r-1], where r = rank(data). Behavior is undefined if an axis is repeated.

Inputs

  • input_data (heterogeneous) - T: Input to extract the centered crop from.

  • shape (heterogeneous) - Tind: 1-D tensor representing the cropping window dimensions.

Outputs

  • output_data (heterogeneous) - T: Output data.

Type Constraints

  • T in ( tensor(bfloat16), tensor(bool), tensor(complex128), tensor(complex64), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(string), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) ): Constrain input and output types to all tensor types.

  • Tind in ( tensor(int32), tensor(int64) ): Constrain indices to integer types

OnnxClip#

class mlprodict.npy.xop_auto_import_.OnnxClip(*args, **kwargs)#

Version

  • name: Clip (GitHub)

  • domain: main

  • since_version: 13

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 13.

Summary

Clip operator limits the given input within an interval. The interval is specified by the inputs ‘min’ and ‘max’. They default to numeric_limits::lowest() and numeric_limits::max(), respectively.

Inputs

Between 1 and 3 inputs.

  • input (heterogeneous) - T: Input tensor whose elements to be clipped

  • min (optional, heterogeneous) - T: Minimum value, under which element is replaced by min. It must be a scalar(tensor of empty shape).

  • max (optional, heterogeneous) - T: Maximum value, above which element is replaced by max. It must be a scalar(tensor of empty shape).

Outputs

  • output (heterogeneous) - T: Output tensor with clipped input elements

Type Constraints

  • T in ( tensor(bfloat16), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) ): Constrain input and output types to all numeric tensors.

OnnxClip_1#

class mlprodict.npy.xop_auto_import_.OnnxClip_1(*args, **kwargs)#

Version

  • name: Clip (GitHub)

  • domain: main

  • since_version: 1

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: False

This version of the operator has been available since version 1.

Summary

Clip operator limits the given input within an interval. The interval is specified with arguments ‘min’ and ‘max’. They default to numeric_limits::lowest() and numeric_limits::max() respectively.

Attributes

  • consumed_inputs: legacy optimization attribute.

  • max: Maximum value, above which element is replaced by max

  • min: Minimum value, under which element is replaced by min

Inputs

  • input (heterogeneous) - T: Input tensor whose elements to be clipped

Outputs

  • output (heterogeneous) - T: Output tensor with clipped input elements

Type Constraints

  • T in ( tensor(double), tensor(float), tensor(float16) ): Constrain input and output types to float tensors.

OnnxClip_11#

class mlprodict.npy.xop_auto_import_.OnnxClip_11(*args, **kwargs)#

Version

  • name: Clip (GitHub)

  • domain: main

  • since_version: 11

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 11.

Summary

Clip operator limits the given input within an interval. The interval is specified by the inputs ‘min’ and ‘max’. They default to numeric_limits::lowest() and numeric_limits::max(), respectively.

Inputs

Between 1 and 3 inputs.

  • input (heterogeneous) - T: Input tensor whose elements to be clipped

  • min (optional, heterogeneous) - T: Minimum value, under which element is replaced by min. It must be a scalar(tensor of empty shape).

  • max (optional, heterogeneous) - T: Maximum value, above which element is replaced by max. It must be a scalar(tensor of empty shape).

Outputs

  • output (heterogeneous) - T: Output tensor with clipped input elements

Type Constraints

  • T in ( tensor(double), tensor(float), tensor(float16) ): Constrain input and output types to float tensors.

OnnxClip_12#

class mlprodict.npy.xop_auto_import_.OnnxClip_12(*args, **kwargs)#

Version

  • name: Clip (GitHub)

  • domain: main

  • since_version: 12

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 12.

Summary

Clip operator limits the given input within an interval. The interval is specified by the inputs ‘min’ and ‘max’. They default to numeric_limits::lowest() and numeric_limits::max(), respectively.

Inputs

Between 1 and 3 inputs.

  • input (heterogeneous) - T: Input tensor whose elements to be clipped

  • min (optional, heterogeneous) - T: Minimum value, under which element is replaced by min. It must be a scalar(tensor of empty shape).

  • max (optional, heterogeneous) - T: Maximum value, above which element is replaced by max. It must be a scalar(tensor of empty shape).

Outputs

  • output (heterogeneous) - T: Output tensor with clipped input elements

Type Constraints

  • T in ( tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) ): Constrain input and output types to all numeric tensors.

OnnxClip_13#

class mlprodict.npy.xop_auto_import_.OnnxClip_13(*args, **kwargs)#

Version

  • name: Clip (GitHub)

  • domain: main

  • since_version: 13

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 13.

Summary

Clip operator limits the given input within an interval. The interval is specified by the inputs ‘min’ and ‘max’. They default to numeric_limits::lowest() and numeric_limits::max(), respectively.

Inputs

Between 1 and 3 inputs.

  • input (heterogeneous) - T: Input tensor whose elements to be clipped

  • min (optional, heterogeneous) - T: Minimum value, under which element is replaced by min. It must be a scalar(tensor of empty shape).

  • max (optional, heterogeneous) - T: Maximum value, above which element is replaced by max. It must be a scalar(tensor of empty shape).

Outputs

  • output (heterogeneous) - T: Output tensor with clipped input elements

Type Constraints

  • T in ( tensor(bfloat16), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) ): Constrain input and output types to all numeric tensors.

OnnxClip_6#

class mlprodict.npy.xop_auto_import_.OnnxClip_6(*args, **kwargs)#

Version

  • name: Clip (GitHub)

  • domain: main

  • since_version: 6

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 6.

Summary

Clip operator limits the given input within an interval. The interval is specified with arguments ‘min’ and ‘max’. They default to numeric_limits::lowest() and numeric_limits::max() respectively.

Attributes

  • max: Maximum value, above which element is replaced by max Default value is 3.4028234663852886e+38.

  • min: Minimum value, under which element is replaced by min Default value is -3.4028234663852886e+38.

Inputs

  • input (heterogeneous) - T: Input tensor whose elements to be clipped

Outputs

  • output (heterogeneous) - T: Output tensor with clipped input elements

Type Constraints

  • T in ( tensor(double), tensor(float), tensor(float16) ): Constrain input and output types to float tensors.

OnnxCol2Im#

class mlprodict.npy.xop_auto_import_.OnnxCol2Im(*args, **kwargs)#

Version

  • name: Col2Im (GitHub)

  • domain: main

  • since_version: 18

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 18.

Summary

The operator rearranges column blocks back into a multidimensional image

Col2Im behaves similarly to PyTorch’s fold https://pytorch.org/docs/stable/generated/torch.nn.Fold.html, but it only supports batched multi-dimensional image tensors. Another implementation in Python with N-dimension support can be found at f-dangel/unfoldNd.

NOTE: Although specifying image_shape looks redundant because it could be calculated from

convolution formulas, it is required as input for more advanced scenarios as explained at PyTorch’s implementation (pytorch/pytorch)

Attributes

  • dilations: 1-dimensional tensor with dilation value along each spatial axis of the image. If not present, the dilation defaults to 1 along each spatial axis of the image.

  • pads: 1-dimensional tensor with padding value for the beginning and ending along each spatial axis, it can take any value greater than or equal to 0. The value represent the number of pixels added to the beginning and end part of the corresponding axis. pads format should be as follow [x1_begin, x2_begin…x1_end, x2_end,…], where xi_begin is the number of pixels added at the beginning of axis i and xi_end is the number of pixels added at the end of axis i. If not present, the padding defaults to 0 along start and end of each spatial axis.

  • strides: 1-dimensional tensor with stride value along each spatial axis. If not present, the stride defaults to 1 along each spatial axis.

Inputs

  • input (heterogeneous) - T: Input data tensor to be rearranged from column blocks back into an image. This is a 3-dimensional tensor containing [N, C * n-ary- product(block_shape), L], where N is batch dimension, C is image channel dimension and L is number of blocks.The blocks are enumerated in increasing lexicographic-order of their indices.For example, with an image-size 10*20 and block-size 9*18, there would be 2*3 blocks, enumerated in the order block(0, 0), block(0, 1), block(0, 2), block(1, 0), block(1, 1), block(1, 2).

  • image_shape (heterogeneous) - tensor(int64): The shape of the spatial dimensions of the image after rearranging the column blocks.This is a 1-dimensional tensor with size of at least 2, containing the value [H_img, W_img] for a 2-D image or [dim_i1, dim_i2, …, dim_iN] for a N-D image.

  • block_shape (heterogeneous) - tensor(int64): The shape of the block to apply on the input.This is a 1-dimensional tensor of size of at least 2, containing the value [H_block, W_block] for a 2-D image or [dim_b1, dim_b2, …, dim_bN] for a N-D block.This is the block-shape before dilation is applied to it.

Outputs

  • output (heterogeneous) - T: Output tensor produced by rearranging blocks into an image.

Type Constraints

  • T in ( tensor(bfloat16), tensor(bool), tensor(complex128), tensor(complex64), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(string), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) ): Constrain input and output types to all numeric tensor types.

OnnxCol2Im_18#

class mlprodict.npy.xop_auto_import_.OnnxCol2Im_18(*args, **kwargs)#

Version

  • name: Col2Im (GitHub)

  • domain: main

  • since_version: 18

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

This version of the operator has been available since version 18.

Summary

The operator rearranges column blocks back into a multidimensional image

Col2Im behaves similarly to PyTorch’s fold https://pytorch.org/docs/stable/generated/torch.nn.Fold.html, but it only supports batched multi-dimensional image tensors. Another implementation in Python with N-dimension support can be found at f-dangel/unfoldNd.

NOTE: Although specifying image_shape looks redundant because it could be calculated from

convolution formulas, it is required as input for more advanced scenarios as explained at PyTorch’s implementation (pytorch/pytorch)

Attributes

  • dilations: 1-dimensional tensor with dilation value along each spatial axis of the image. If not present, the dilation defaults to 1 along each spatial axis of the image.

  • pads: 1-dimensional tensor with padding value for the beginning and ending along each spatial axis, it can take any value greater than or equal to 0. The value represent the number of pixels added to the beginning and end part of the corresponding axis. pads format should be as follow [x1_begin, x2_begin…x1_end, x2_end,…], where xi_begin is the number of pixels added at the beginning of axis i and xi_end is the number of pixels added at the end of axis i. If not present, the padding defaults to 0 along start and end of each spatial axis.

  • strides: 1-dimensional tensor with stride value along each spatial axis. If not present, the stride defaults to 1 along each spatial axis.

Inputs

  • input (heterogeneous) - T: Input data tensor to be rearranged from column blocks back into an image. This is a 3-dimensional tensor containing [N, C * n-ary- product(block_shape), L], where N is batch dimension, C is image channel dimension and L is number of blocks.The blocks are enumerated in increasing lexicographic-order of their indices.For example, with an image-size 10*20 and block-size 9*18, there would be 2*3 blocks, enumerated in the order block(0, 0), block(0, 1), block(0, 2), block(1, 0), block(1, 1), block(1, 2).

  • image_shape (heterogeneous) - tensor(int64): The shape of the spatial dimensions of the image after rearranging the column blocks.This is a 1-dimensional tensor with size of at least 2, containing the value [H_img, W_img] for a 2-D image or [dim_i1, dim_i2, …, dim_iN] for a N-D image.

  • block_shape (heterogeneous) - tensor(int64): The shape of the block to apply on the input.This is a 1-dimensional tensor of size of at least 2, containing the value [H_block, W_block] for a 2-D image or [dim_b1, dim_b2, …, dim_bN] for a N-D block.This is the block-shape before dilation is applied to it.

Outputs

  • output (heterogeneous) - T: Output tensor produced by rearranging blocks into an image.

Type Constraints

  • T in ( tensor(bfloat16), tensor(bool), tensor(complex128), tensor(complex64), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(string), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) ): Constrain input and output types to all numeric tensor types.

OnnxComMicrosoftAdamOptimizer#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftAdamOptimizer(*args, **kwargs)#

Version

  • name: AdamOptimizer (GitHub)

  • domain: com.microsoft

  • since_version: 1

  • function:

  • support_level:

  • shape inference:

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

Attributes

  • alpha: Coefficient of previous gradient in running average. Default value is ?.

  • beta: Coefficient of previous squared gradient in running average.The effective learning rate is computed by r = R / (1 + T * decay_factor). Default to 0 so that increasing update counts doesn’t reduce the learning rate. Default value is ?.

  • do_bias_correction: Compute unbiased 1st and 2nd momentums. Default value is ?.

  • epsilon: Small scalar to avoid dividing by zero. Default value is ?.

  • lambda: Regularization coefficient of 0.5 * lambda * ||X||_2^2. Default to 0, which means no regularization. Default value is ?.

  • max_norm_clip: clip threshold of gradients. Default value is ?.

  • weight_decay_mode: Modes for applying weight decay, 0 means applying decay before weight update, 1 means applying decay after weight update. Default value is ?.

Inputs

Between 6 and 10 inputs.

  • R (heterogeneous) - T1: The initial learning rate.

  • T (heterogeneous) - T2: The update count of “X”. It should be a scalar.

  • weights (heterogeneous) - T3: weights to optimize.

  • gradients (heterogeneous) - T_GRAD: gradients computed in this iteration.

  • moment_1 (heterogeneous) - T4: exponentially averaged historical gradients.

  • moment_2 (heterogeneous) - T4: exponentially averaged historical squared gradients.

  • mixed_precision_weights (optional, heterogeneous) - T_MIXED_PRECISION_FP: FP16 or BFloat16 weights to optimize.

  • loss_scale (optional, heterogeneous) - T3: loss scale for mixed precision training

  • global_gradient_norm (optional, heterogeneous) - T_GRAD_NORM: Global gradient norm.

  • update_signal (optional, heterogeneous) - T_BOOL: This signal indicates if weight tensors should be updated.

Outputs

Between 3 and 6 outputs.

  • new_T (heterogeneous) - T2: New update count.

  • new_moment_1 (heterogeneous) - T4: New averaged gradients.

  • new_moment_2 (heterogeneous) - T4: New averaged squared gradients.

  • new_weights (optional, heterogeneous) - T3: New weights.

  • new_gradients (optional, heterogeneous) - T_GRAD: New gradients.

  • new_mixed_precision_weights (optional, heterogeneous) - T_MIXED_PRECISION_FP: New FP16 or BFloat16 weights

OnnxComMicrosoftAdamOptimizer_1#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftAdamOptimizer_1(*args, **kwargs)#

Version

  • name: AdamOptimizer (GitHub)

  • domain: com.microsoft

  • since_version: 1

  • function:

  • support_level:

  • shape inference:

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

Attributes

  • alpha: Coefficient of previous gradient in running average. Default value is ?.

  • beta: Coefficient of previous squared gradient in running average.The effective learning rate is computed by r = R / (1 + T * decay_factor). Default to 0 so that increasing update counts doesn’t reduce the learning rate. Default value is ?.

  • do_bias_correction: Compute unbiased 1st and 2nd momentums. Default value is ?.

  • epsilon: Small scalar to avoid dividing by zero. Default value is ?.

  • lambda: Regularization coefficient of 0.5 * lambda * ||X||_2^2. Default to 0, which means no regularization. Default value is ?.

  • max_norm_clip: clip threshold of gradients. Default value is ?.

  • weight_decay_mode: Modes for applying weight decay, 0 means applying decay before weight update, 1 means applying decay after weight update. Default value is ?.

Inputs

Between 6 and 10 inputs.

  • R (heterogeneous) - T1: The initial learning rate.

  • T (heterogeneous) - T2: The update count of “X”. It should be a scalar.

  • weights (heterogeneous) - T3: weights to optimize.

  • gradients (heterogeneous) - T_GRAD: gradients computed in this iteration.

  • moment_1 (heterogeneous) - T4: exponentially averaged historical gradients.

  • moment_2 (heterogeneous) - T4: exponentially averaged historical squared gradients.

  • mixed_precision_weights (optional, heterogeneous) - T_MIXED_PRECISION_FP: FP16 or BFloat16 weights to optimize.

  • loss_scale (optional, heterogeneous) - T3: loss scale for mixed precision training

  • global_gradient_norm (optional, heterogeneous) - T_GRAD_NORM: Global gradient norm.

  • update_signal (optional, heterogeneous) - T_BOOL: This signal indicates if weight tensors should be updated.

Outputs

Between 3 and 6 outputs.

  • new_T (heterogeneous) - T2: New update count.

  • new_moment_1 (heterogeneous) - T4: New averaged gradients.

  • new_moment_2 (heterogeneous) - T4: New averaged squared gradients.

  • new_weights (optional, heterogeneous) - T3: New weights.

  • new_gradients (optional, heterogeneous) - T_GRAD: New gradients.

  • new_mixed_precision_weights (optional, heterogeneous) - T_MIXED_PRECISION_FP: New FP16 or BFloat16 weights

OnnxComMicrosoftAdamWOptimizer#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftAdamWOptimizer(*args, **kwargs)#

Version

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

Attributes

  • adam_mode: Modes for applying bias correction and weight decay (default 0) 0 : Weight decay is applied before weight is updated. Computation aligned with Torch AdamW. In this mode, correct_bias should be 1 to keep aligned with PyTorch.1 : Weight decay is applied after weight is updated. Computation is aligned with Huggingface AdamW. Default value is ?.

  • alpha: Coefficient of previously accumulated gradient in running average. Default value is ?.

  • beta: Coefficient of previously accumulated squared-gradient in running average. Default value is ?.

  • correct_bias: Whether or not to correct bias, enabled by default. Default value is ?.

  • epsilon: Small scalar to avoid dividing by zero. Default value is ?.

  • weight_decay: weight decay coefficient. Default value is ?.

Inputs

Between 6 and 7 inputs.

  • lr (heterogeneous) - T1: The learning rate.

  • step (heterogeneous) - T2: The update count of weights. It should be a scalar.

  • weights (heterogeneous) - S_WEIGHT: Sequence of weights to optimize.

  • gradients (heterogeneous) - S_GRAD: Sequence of gradients computed in this iteration.

  • momentums_1 (heterogeneous) - S_MOMENT: Sequence of exponentially averaged historical gradients.

  • momentums_2 (heterogeneous) - S_MOMENT: Sequence of exponentially averaged historical squared gradients.

  • update_signal (optional, heterogeneous) - T_BOOL: This signal indicates if weight updates are skipped, applicable to gradient infinity check in mixed precision training.

Outputs

Between 1 and 4 outputs.

  • updated_flag (heterogeneous) - T2: Whether gradient is applied or not.

  • updated_weights (optional, heterogeneous) - S_WEIGHT: Sequence of weights after optimize.

  • updated_momentums_1 (optional, heterogeneous) - S_MOMENT: Sequence of momentum_1 after optimize.

  • updated_momentums_2 (optional, heterogeneous) - S_MOMENT: Sequence of momentum_2 after optimize.

OnnxComMicrosoftAdamWOptimizer_1#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftAdamWOptimizer_1(*args, **kwargs)#

Version

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

Attributes

  • adam_mode: Modes for applying bias correction and weight decay (default 0) 0 : Weight decay is applied before weight is updated. Computation aligned with Torch AdamW. In this mode, correct_bias should be 1 to keep aligned with PyTorch.1 : Weight decay is applied after weight is updated. Computation is aligned with Huggingface AdamW. Default value is ?.

  • alpha: Coefficient of previously accumulated gradient in running average. Default value is ?.

  • beta: Coefficient of previously accumulated squared-gradient in running average. Default value is ?.

  • correct_bias: Whether or not to correct bias, enabled by default. Default value is ?.

  • epsilon: Small scalar to avoid dividing by zero. Default value is ?.

  • weight_decay: weight decay coefficient. Default value is ?.

Inputs

Between 6 and 7 inputs.

  • lr (heterogeneous) - T1: The learning rate.

  • step (heterogeneous) - T2: The update count of weights. It should be a scalar.

  • weights (heterogeneous) - S_WEIGHT: Sequence of weights to optimize.

  • gradients (heterogeneous) - S_GRAD: Sequence of gradients computed in this iteration.

  • momentums_1 (heterogeneous) - S_MOMENT: Sequence of exponentially averaged historical gradients.

  • momentums_2 (heterogeneous) - S_MOMENT: Sequence of exponentially averaged historical squared gradients.

  • update_signal (optional, heterogeneous) - T_BOOL: This signal indicates if weight updates are skipped, applicable to gradient infinity check in mixed precision training.

Outputs

Between 1 and 4 outputs.

  • updated_flag (heterogeneous) - T2: Whether gradient is applied or not.

  • updated_weights (optional, heterogeneous) - S_WEIGHT: Sequence of weights after optimize.

  • updated_momentums_1 (optional, heterogeneous) - S_MOMENT: Sequence of momentum_1 after optimize.

  • updated_momentums_2 (optional, heterogeneous) - S_MOMENT: Sequence of momentum_2 after optimize.

OnnxComMicrosoftAdasumAllReduce#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftAdasumAllReduce(*args, **kwargs)#

Version

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

Attributes

  • reduce_algo: Algorithms for Adasum. Valid values are: CpuReduction(1) or GpuHierarchicalReduction(2) Default value is ?.

Inputs

Between 1 and 2147483647 inputs.

  • input (variadic, heterogeneous) - T: tensors to be reduced

Outputs

Between 1 and 2147483647 outputs.

  • output (variadic, heterogeneous) - T: reduced tensors

OnnxComMicrosoftAdasumAllReduce_1#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftAdasumAllReduce_1(*args, **kwargs)#

Version

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

Attributes

  • reduce_algo: Algorithms for Adasum. Valid values are: CpuReduction(1) or GpuHierarchicalReduction(2) Default value is ?.

Inputs

Between 1 and 2147483647 inputs.

  • input (variadic, heterogeneous) - T: tensors to be reduced

Outputs

Between 1 and 2147483647 outputs.

  • output (variadic, heterogeneous) - T: reduced tensors

OnnxComMicrosoftAll#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftAll(*args, **kwargs)#

Version

  • name: All (GitHub)

  • domain: com.microsoft

  • since_version: 1

  • function:

  • support_level:

  • shape inference:

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

Return true if all elements are true and false otherwise.

Inputs

  • X (heterogeneous) - T: input

Outputs

  • Y (heterogeneous) - T: output.

OnnxComMicrosoftAll_1#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftAll_1(*args, **kwargs)#

Version

  • name: All (GitHub)

  • domain: com.microsoft

  • since_version: 1

  • function:

  • support_level:

  • shape inference:

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

Return true if all elements are true and false otherwise.

Inputs

  • X (heterogeneous) - T: input

Outputs

  • Y (heterogeneous) - T: output.

OnnxComMicrosoftAttention#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftAttention(*args, **kwargs)#

Version

  • name: Attention (GitHub)

  • domain: com.microsoft

  • since_version: 1

  • function:

  • support_level:

  • shape inference:

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

Multi-Head Self Attention that can be either unidirectional (like GPT-2) or bidirectional (like BERT). The mask_index input is optional. Besides raw attention mask with shape (batch_size, past_sequence_length + sequence_length) or (batch_size, sequence_length, past_sequence_length + sequence_length) with value 0 for masked and 1 otherwise, we also support other two formats: When input has right-side padding, mask_index is one dimension with shape (batch_size), where value of each element is the end position, or valid length of actual sequence excluding padding. When input has left-side padding, mask_index has shape (2 * batch_size), where the values are the exclusive end positions followed by the inclusive start positions. When unidirectional is 1, and each token only attend to previous tokens. For GPT-2, both past and present state are optional. Present state could appear in output even when past state is not in input.

Attributes

  • num_heads (required): Number of attention heads Default value is ?.

  • qkv_hidden_sizes: Hidden layer sizes of Q, K, V paths in Attention Default value is ?.

  • unidirectional: Whether every token can only attend to previous tokens. Default value is 0. Default value is ?.

Inputs

Between 3 and 6 inputs.

  • input (heterogeneous) - T: 3D input tensor with shape (batch_size, sequence_length, input_hidden_size)

  • weight (heterogeneous) - T: 2D input tensor with shape (input_hidden_size, 3 * hidden_size), where hidden_size = num_heads * head_size

  • bias (heterogeneous) - T: 1D input tensor with shape (3 * hidden_size)

  • mask_index (optional, heterogeneous) - M: Attention mask with shape (batch_size, 1, max_sequence_length, max_sequence_length), (batch_size, past_sequence_length + sequence_length)or (batch_size, sequence_length, past_sequence_length + sequence_length), or index with shape (batch_size) or (2 * batch_size).

  • past (optional, heterogeneous) - T: past state for key and value with shape (2, batch_size, num_heads, past_sequence_length, head_size).

  • extra_add (optional, heterogeneous) - T: additional add to QxK’ with shape (batch_size, num_heads, sequence_length, sequence_length).

Outputs

Between 1 and 2 outputs.

  • output (heterogeneous) - T: 3D output tensor with shape (batch_size, sequence_length, hidden_size)

  • present (optional, heterogeneous) - T: present state for key and value with shape (2, batch_size, num_heads, past_sequence_length + sequence_length, head_size)

OnnxComMicrosoftAttention_1#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftAttention_1(*args, **kwargs)#

Version

  • name: Attention (GitHub)

  • domain: com.microsoft

  • since_version: 1

  • function:

  • support_level:

  • shape inference:

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

Multi-Head Self Attention that can be either unidirectional (like GPT-2) or bidirectional (like BERT). The mask_index input is optional. Besides raw attention mask with shape (batch_size, past_sequence_length + sequence_length) or (batch_size, sequence_length, past_sequence_length + sequence_length) with value 0 for masked and 1 otherwise, we also support other two formats: When input has right-side padding, mask_index is one dimension with shape (batch_size), where value of each element is the end position, or valid length of actual sequence excluding padding. When input has left-side padding, mask_index has shape (2 * batch_size), where the values are the exclusive end positions followed by the inclusive start positions. When unidirectional is 1, and each token only attend to previous tokens. For GPT-2, both past and present state are optional. Present state could appear in output even when past state is not in input.

Attributes

  • num_heads (required): Number of attention heads Default value is ?.

  • qkv_hidden_sizes: Hidden layer sizes of Q, K, V paths in Attention Default value is ?.

  • unidirectional: Whether every token can only attend to previous tokens. Default value is 0. Default value is ?.

Inputs

Between 3 and 6 inputs.

  • input (heterogeneous) - T: 3D input tensor with shape (batch_size, sequence_length, input_hidden_size)

  • weight (heterogeneous) - T: 2D input tensor with shape (input_hidden_size, 3 * hidden_size), where hidden_size = num_heads * head_size

  • bias (heterogeneous) - T: 1D input tensor with shape (3 * hidden_size)

  • mask_index (optional, heterogeneous) - M: Attention mask with shape (batch_size, 1, max_sequence_length, max_sequence_length), (batch_size, past_sequence_length + sequence_length)or (batch_size, sequence_length, past_sequence_length + sequence_length), or index with shape (batch_size) or (2 * batch_size).

  • past (optional, heterogeneous) - T: past state for key and value with shape (2, batch_size, num_heads, past_sequence_length, head_size).

  • extra_add (optional, heterogeneous) - T: additional add to QxK’ with shape (batch_size, num_heads, sequence_length, sequence_length).

Outputs

Between 1 and 2 outputs.

  • output (heterogeneous) - T: 3D output tensor with shape (batch_size, sequence_length, hidden_size)

  • present (optional, heterogeneous) - T: present state for key and value with shape (2, batch_size, num_heads, past_sequence_length + sequence_length, head_size)

OnnxComMicrosoftAttnLSTM#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftAttnLSTM(*args, **kwargs)#

Version

  • name: AttnLSTM (GitHub)

  • domain: com.microsoft

  • since_version: 1

  • function:

  • support_level:

  • shape inference:

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

Computes an one-layer RNN where its RNN Cell is an AttentionWrapper wrapped a LSTM Cell. The RNN layer contains following basic component: LSTM Cell, Bahdanau Attention Mechanism, AttentionWrapp.

Activation functions:

Relu(x) - max(0, x)

Tanh(x) - (1 - e^{-2x})/(1 + e^{-2x})

Sigmoid(x) - 1/(1 + e^{-x})

(NOTE: Below are optional)

Affine(x) - alpha*x + beta

LeakyRelu(x) - x if x >= 0 else alpha * x

ThresholdedRelu(x) - x if x >= alpha else 0

ScaledTanh(x) - alpha*Tanh(beta*x)

HardSigmoid(x) - min(max(alpha*x + beta, 0), 1)

Elu(x) - x if x >= 0 else alpha*(e^x - 1)

Softsign(x) - x/(1 + |x|)

Softplus(x) - log(1 + e^x)

Softmax(x) - exp(x) / sum(exp(x))

Bahdanau Attention Mechanism:

M - Memory tensor.

VALUES - masked Memory by its real sequence length.

MW - Memory layer weight.

KEYS - Processed memory tensor by the memory layer.

KEYS = M * MW

Query - Query tensor, normally at specific time step in sequence.

QW - Query layer weight in the attention mechanism

PQ - processed query, = Query * QW

`V’ - attention vector

ALIGN - calculated alignment based on Query and KEYS

ALIGN = softmax(reduce_sum(V * Tanh(KEYS + PQ)))

CONTEXT - context based on ALIGN and VALUES

CONTEXT = ALIGN * VALUES

LSTM Cell:

X - input tensor concat with attention state in the attention wrapper

i - input gate

o - output gate

f - forget gate

c - cell gate

t - time step (t-1 means previous time step)

W[iofc] - W parameter weight matrix for input, output, forget, and cell gates

R[iofc] - R recurrence weight matrix for input, output, forget, and cell gates

Wb[iofc] - W bias vectors for input, output, forget, and cell gates

Rb[iofc] - R bias vectors for input, output, forget, and cell gates

P[iof] - P peephole weight vector for input, output, and forget gates

WB[iofc] - W parameter weight matrix for backward input, output, forget, and cell gates

RB[iofc] - R recurrence weight matrix for backward input, output, forget, and cell gates

WBb[iofc] - W bias vectors for backward input, output, forget, and cell gates

RBb[iofc] - R bias vectors for backward input, output, forget, and cell gates

PB[iof] - P peephole weight vector for backward input, output, and forget gates

H - Hidden state

num_directions - 2 if direction == bidirectional else 1

Equations (Default: f=Sigmoid, g=Tanh, h=Tanh):

  • it = f(Xt*(Wi^T) + Ht-1*(Ri^T) + Pi (.) Ct-1 + Wbi + Rbi)

  • ft = f(Xt*(Wf^T) + Ht-1*(Rf^T) + Pf (.) Ct-1 + Wbf + Rbf)

  • ct = g(Xt*(Wc^T) + Ht-1*(Rc^T) + Wbc + Rbc)

  • Ct = ft (.) Ct-1 + it (.) ct

  • ot = f(Xt*(Wo^T) + Ht-1*(Ro^T) + Po (.) Ct + Wbo + Rbo)

  • Ht = ot (.) h(Ct)

AttentionWrapp Notations:
`lstm()’ - wrapped inner cell.

Ht, Ct = lstm(concat(Xt, ATTNt-1), Ct-1)

am() - attention mechanism the wrapper used.

CONTEXTt, ALIGNt = am(Ht, ALIGNt-1)

AW - attention layer weights, optional.

ATTN - attention state, initial is zero. If AW provided, it is the output of the attention layer,

ATTNt = concat(Ht, CONTEXTt) * AW

otherwise,

ATTNt = CONTEXTt

RNN layer output:

Y - if needed is the sequence of Ht from lstm cell.

Y_h - is the last valid H from lstm cell.

Y_c - is the last valid C from lstm cell.

Attributes

  • activation_alpha: Optional scaling values used by some activation functions. The values are consumed in the order of activation functions, for example (f, g, h) in LSTM. Default values are the same as of corresponding ONNX operators.For example with LeakyRelu, the default alpha is 0.01. Default value is ?.

  • activation_beta: Optional scaling values used by some activation functions. The values are consumed in the order of activation functions, for example (f, g, h) in LSTM. Default values are the same as of corresponding ONNX operators. Default value is ?.

  • activations: A list of 3 (or 6 if bidirectional) activation functions for input, output, forget, cell, and hidden. The activation functions must be one of the activation functions specified above. Optional: See the equations for default if not specified. Default value is ?.

  • clip: Cell clip threshold. Clipping bounds the elements of a tensor in the range of [-threshold, +threshold] and is applied to the input of activations. No clip if not specified. Default value is ?.

  • direction: Specify if the RNN is forward, reverse, or bidirectional. Must be one of forward (default), reverse, or bidirectional. Default value is ?.

  • hidden_size: Number of neurons in the hidden layer. Default value is ?.

  • input_forget: Couple the input and forget gates if 1, default 0. Default value is ?.

Inputs

Between 3 and 14 inputs.

  • X (heterogeneous) - T: The input sequences packed (and potentially padded) into one 3-D tensor with the shape of [seq_length, batch_size, input_size]

  • W (heterogeneous) - T: The weight tensor for the gates. Concatenation of W[iofc] and WB[iofc] (if bidirectional) along dimension 0. The tensor has shape [num_directions, 4*hidden_size, input_size].

  • R (heterogeneous) - T: The recurrence weight tensor. Concatenation of R[iofc] and RB[iofc] (if bidirectional) along dimension 0. This tensor has shape [num_directions, 4*hidden_size, hidden_size].

  • B (optional, heterogeneous) - T: The bias tensor for input gate. Concatenation of [Wb[iofc], Rb[iofc]], and [WBb[iofc], RBb[iofc]] (if bidirectional) along dimension 0. This tensor has shape [num_directions, 8*hidden_size]. Optional: If not specified - assumed to be 0.

  • sequence_lens (optional, heterogeneous) - T1: Optional tensor specifying lengths of the sequences in a batch. If not specified - assumed all sequences in the batch to have length seq_length. It has shape [batch_size]

  • initial_h (optional, heterogeneous) - T: Optional initial value of the hidden. If not specified - assumed to be 0. It has shape [num_directions, batch_size, hidden_size].

  • initial_c (optional, heterogeneous) - T: Optional initial value of the cell. If not specified - assumed to be 0. It has shape [num_directions, batch_size, hidden_size].

  • P (optional, heterogeneous) - T: The weight tensor for peepholes. Concatenation of P[iof] and PB[iof] (if bidirectional) along dimension 0. It has shape [num_directions, 3*hidde_size]. Optional: If not specified - assumed to be 0.

  • QW (optional, heterogeneous) - T: The weight tensor of the query layer in the attention mechanism. Should be of shape [num_directions, am_query_depth(hidden_size of lstm), am_attn_size]

  • MW (optional, heterogeneous) - T: The weight tensor of the memory layer in the attention mechanism. Should be of shape [num_directions, memory_depth, am_attn_size]

  • V (optional, heterogeneous) - T: The attention_v tensor in the attention mechanism. Should be of shape [num_directions, am_attn_size]

  • M (optional, heterogeneous) - T: The sequence of the memory (input) for attention mechanism. Should be of [batch_size, max_memory_step, memory_depth]

  • memory_seq_lens (optional, heterogeneous) - T1: The sequence length of the input memory for the attention mechanism. Should be of [batch_size]

  • AW (optional, heterogeneous) - T: The weights of attention layer in the attention wrapper. If exists, should be of shape [num_directions, memory_depth+hidden_size, aw_attn_size]. Please note that attention mechanism context depth is also memory_depth in the attention mechanism.

Outputs

Between 0 and 3 outputs.

  • Y (optional, heterogeneous) - T: A tensor that concats all the intermediate output values of the hidden. It has shape [seq_length, num_directions, batch_size, hidden_size]

  • Y_h (optional, heterogeneous) - T: The last output value of the hidden. It has shape [num_directions, batch_size, hidden_size].

  • Y_c (optional, heterogeneous) - T: The last output value of the cell. It has shape [num_directions, batch_size, hidden_size].

OnnxComMicrosoftAttnLSTM_1#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftAttnLSTM_1(*args, **kwargs)#

Version

  • name: AttnLSTM (GitHub)

  • domain: com.microsoft

  • since_version: 1

  • function:

  • support_level:

  • shape inference:

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

Computes an one-layer RNN where its RNN Cell is an AttentionWrapper wrapped a LSTM Cell. The RNN layer contains following basic component: LSTM Cell, Bahdanau Attention Mechanism, AttentionWrapp.

Activation functions:

Relu(x) - max(0, x)

Tanh(x) - (1 - e^{-2x})/(1 + e^{-2x})

Sigmoid(x) - 1/(1 + e^{-x})

(NOTE: Below are optional)

Affine(x) - alpha*x + beta

LeakyRelu(x) - x if x >= 0 else alpha * x

ThresholdedRelu(x) - x if x >= alpha else 0

ScaledTanh(x) - alpha*Tanh(beta*x)

HardSigmoid(x) - min(max(alpha*x + beta, 0), 1)

Elu(x) - x if x >= 0 else alpha*(e^x - 1)

Softsign(x) - x/(1 + |x|)

Softplus(x) - log(1 + e^x)

Softmax(x) - exp(x) / sum(exp(x))

Bahdanau Attention Mechanism:

M - Memory tensor.

VALUES - masked Memory by its real sequence length.

MW - Memory layer weight.

KEYS - Processed memory tensor by the memory layer.

KEYS = M * MW

Query - Query tensor, normally at specific time step in sequence.

QW - Query layer weight in the attention mechanism

PQ - processed query, = Query * QW

`V’ - attention vector

ALIGN - calculated alignment based on Query and KEYS

ALIGN = softmax(reduce_sum(V * Tanh(KEYS + PQ)))

CONTEXT - context based on ALIGN and VALUES

CONTEXT = ALIGN * VALUES

LSTM Cell:

X - input tensor concat with attention state in the attention wrapper

i - input gate

o - output gate

f - forget gate

c - cell gate

t - time step (t-1 means previous time step)

W[iofc] - W parameter weight matrix for input, output, forget, and cell gates

R[iofc] - R recurrence weight matrix for input, output, forget, and cell gates

Wb[iofc] - W bias vectors for input, output, forget, and cell gates

Rb[iofc] - R bias vectors for input, output, forget, and cell gates

P[iof] - P peephole weight vector for input, output, and forget gates

WB[iofc] - W parameter weight matrix for backward input, output, forget, and cell gates

RB[iofc] - R recurrence weight matrix for backward input, output, forget, and cell gates

WBb[iofc] - W bias vectors for backward input, output, forget, and cell gates

RBb[iofc] - R bias vectors for backward input, output, forget, and cell gates

PB[iof] - P peephole weight vector for backward input, output, and forget gates

H - Hidden state

num_directions - 2 if direction == bidirectional else 1

Equations (Default: f=Sigmoid, g=Tanh, h=Tanh):

  • it = f(Xt*(Wi^T) + Ht-1*(Ri^T) + Pi (.) Ct-1 + Wbi + Rbi)

  • ft = f(Xt*(Wf^T) + Ht-1*(Rf^T) + Pf (.) Ct-1 + Wbf + Rbf)

  • ct = g(Xt*(Wc^T) + Ht-1*(Rc^T) + Wbc + Rbc)

  • Ct = ft (.) Ct-1 + it (.) ct

  • ot = f(Xt*(Wo^T) + Ht-1*(Ro^T) + Po (.) Ct + Wbo + Rbo)

  • Ht = ot (.) h(Ct)

AttentionWrapp Notations:
`lstm()’ - wrapped inner cell.

Ht, Ct = lstm(concat(Xt, ATTNt-1), Ct-1)

am() - attention mechanism the wrapper used.

CONTEXTt, ALIGNt = am(Ht, ALIGNt-1)

AW - attention layer weights, optional.

ATTN - attention state, initial is zero. If AW provided, it is the output of the attention layer,

ATTNt = concat(Ht, CONTEXTt) * AW

otherwise,

ATTNt = CONTEXTt

RNN layer output:

Y - if needed is the sequence of Ht from lstm cell.

Y_h - is the last valid H from lstm cell.

Y_c - is the last valid C from lstm cell.

Attributes

  • activation_alpha: Optional scaling values used by some activation functions. The values are consumed in the order of activation functions, for example (f, g, h) in LSTM. Default values are the same as of corresponding ONNX operators.For example with LeakyRelu, the default alpha is 0.01. Default value is ?.

  • activation_beta: Optional scaling values used by some activation functions. The values are consumed in the order of activation functions, for example (f, g, h) in LSTM. Default values are the same as of corresponding ONNX operators. Default value is ?.

  • activations: A list of 3 (or 6 if bidirectional) activation functions for input, output, forget, cell, and hidden. The activation functions must be one of the activation functions specified above. Optional: See the equations for default if not specified. Default value is ?.

  • clip: Cell clip threshold. Clipping bounds the elements of a tensor in the range of [-threshold, +threshold] and is applied to the input of activations. No clip if not specified. Default value is ?.

  • direction: Specify if the RNN is forward, reverse, or bidirectional. Must be one of forward (default), reverse, or bidirectional. Default value is ?.

  • hidden_size: Number of neurons in the hidden layer. Default value is ?.

  • input_forget: Couple the input and forget gates if 1, default 0. Default value is ?.

Inputs

Between 3 and 14 inputs.

  • X (heterogeneous) - T: The input sequences packed (and potentially padded) into one 3-D tensor with the shape of [seq_length, batch_size, input_size]

  • W (heterogeneous) - T: The weight tensor for the gates. Concatenation of W[iofc] and WB[iofc] (if bidirectional) along dimension 0. The tensor has shape [num_directions, 4*hidden_size, input_size].

  • R (heterogeneous) - T: The recurrence weight tensor. Concatenation of R[iofc] and RB[iofc] (if bidirectional) along dimension 0. This tensor has shape [num_directions, 4*hidden_size, hidden_size].

  • B (optional, heterogeneous) - T: The bias tensor for input gate. Concatenation of [Wb[iofc], Rb[iofc]], and [WBb[iofc], RBb[iofc]] (if bidirectional) along dimension 0. This tensor has shape [num_directions, 8*hidden_size]. Optional: If not specified - assumed to be 0.

  • sequence_lens (optional, heterogeneous) - T1: Optional tensor specifying lengths of the sequences in a batch. If not specified - assumed all sequences in the batch to have length seq_length. It has shape [batch_size]

  • initial_h (optional, heterogeneous) - T: Optional initial value of the hidden. If not specified - assumed to be 0. It has shape [num_directions, batch_size, hidden_size].

  • initial_c (optional, heterogeneous) - T: Optional initial value of the cell. If not specified - assumed to be 0. It has shape [num_directions, batch_size, hidden_size].

  • P (optional, heterogeneous) - T: The weight tensor for peepholes. Concatenation of P[iof] and PB[iof] (if bidirectional) along dimension 0. It has shape [num_directions, 3*hidde_size]. Optional: If not specified - assumed to be 0.

  • QW (optional, heterogeneous) - T: The weight tensor of the query layer in the attention mechanism. Should be of shape [num_directions, am_query_depth(hidden_size of lstm), am_attn_size]

  • MW (optional, heterogeneous) - T: The weight tensor of the memory layer in the attention mechanism. Should be of shape [num_directions, memory_depth, am_attn_size]

  • V (optional, heterogeneous) - T: The attention_v tensor in the attention mechanism. Should be of shape [num_directions, am_attn_size]

  • M (optional, heterogeneous) - T: The sequence of the memory (input) for attention mechanism. Should be of [batch_size, max_memory_step, memory_depth]

  • memory_seq_lens (optional, heterogeneous) - T1: The sequence length of the input memory for the attention mechanism. Should be of [batch_size]

  • AW (optional, heterogeneous) - T: The weights of attention layer in the attention wrapper. If exists, should be of shape [num_directions, memory_depth+hidden_size, aw_attn_size]. Please note that attention mechanism context depth is also memory_depth in the attention mechanism.

Outputs

Between 0 and 3 outputs.

  • Y (optional, heterogeneous) - T: A tensor that concats all the intermediate output values of the hidden. It has shape [seq_length, num_directions, batch_size, hidden_size]

  • Y_h (optional, heterogeneous) - T: The last output value of the hidden. It has shape [num_directions, batch_size, hidden_size].

  • Y_c (optional, heterogeneous) - T: The last output value of the cell. It has shape [num_directions, batch_size, hidden_size].

OnnxComMicrosoftBatchNormInternal#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftBatchNormInternal(*args, **kwargs)#

Version

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

Variant of BatchNormalization with additional output for saved_mean/inv_std_dev.

Attributes

  • epsilon: epsilon value Default value is ?.

  • momentum: momentum value Default value is ?.

  • training_mode: true if training Default value is ?.

Inputs

  • X (heterogeneous) - T: Input tensor.

  • scale (heterogeneous) - T1: Scale tensor of shape (C).

  • B (heterogeneous) - T1: Bias tensor of shape (C).

  • input_mean (heterogeneous) - T2: running mean tensor of shape (C).

  • input_var (heterogeneous) - T2: running variance tensor of shape (C).

Outputs

Between 1 and 5 outputs.

  • Y (heterogeneous) - T: The output tensor of the same shape as X

  • running_mean (optional, heterogeneous) - T2: The running mean after BN.

  • running_var (optional, heterogeneous) - T2: Running var after BN

  • saved_mean (optional, heterogeneous) - T2: Mean of the batch

  • saved_inv_std (optional, heterogeneous) - T2: Inverse standard deviation for the batch

OnnxComMicrosoftBatchNormInternal_1#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftBatchNormInternal_1(*args, **kwargs)#

Version

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

Variant of BatchNormalization with additional output for saved_mean/inv_std_dev.

Attributes

  • epsilon: epsilon value Default value is ?.

  • momentum: momentum value Default value is ?.

  • training_mode: true if training Default value is ?.

Inputs

  • X (heterogeneous) - T: Input tensor.

  • scale (heterogeneous) - T1: Scale tensor of shape (C).

  • B (heterogeneous) - T1: Bias tensor of shape (C).

  • input_mean (heterogeneous) - T2: running mean tensor of shape (C).

  • input_var (heterogeneous) - T2: running variance tensor of shape (C).

Outputs

Between 1 and 5 outputs.

  • Y (heterogeneous) - T: The output tensor of the same shape as X

  • running_mean (optional, heterogeneous) - T2: The running mean after BN.

  • running_var (optional, heterogeneous) - T2: Running var after BN

  • saved_mean (optional, heterogeneous) - T2: Mean of the batch

  • saved_inv_std (optional, heterogeneous) - T2: Inverse standard deviation for the batch

OnnxComMicrosoftBatchNormalizationGrad#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftBatchNormalizationGrad(*args, **kwargs)#

Version

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

BatchNormalizationGrad

Attributes

  • epsilon (required): epsilon value Default value is ?.

Inputs

  • dY (heterogeneous) - T: Gradient output from previous node

  • X (heterogeneous) - T: Input

  • scale (heterogeneous) - T1: Scale tensor

  • mean (heterogeneous) - T2: Mean of X

  • variance (heterogeneous) - T2: Variance of X

Outputs

  • X_grad (heterogeneous) - T: Gradient of the input

  • scale_grad (heterogeneous) - T1: Gradient of the scale

  • bias_grad (heterogeneous) - T1: Gradient of the bias

OnnxComMicrosoftBatchNormalizationGrad_1#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftBatchNormalizationGrad_1(*args, **kwargs)#

Version

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

BatchNormalizationGrad

Attributes

  • epsilon (required): epsilon value Default value is ?.

Inputs

  • dY (heterogeneous) - T: Gradient output from previous node

  • X (heterogeneous) - T: Input

  • scale (heterogeneous) - T1: Scale tensor

  • mean (heterogeneous) - T2: Mean of X

  • variance (heterogeneous) - T2: Variance of X

Outputs

  • X_grad (heterogeneous) - T: Gradient of the input

  • scale_grad (heterogeneous) - T1: Gradient of the scale

  • bias_grad (heterogeneous) - T1: Gradient of the bias

OnnxComMicrosoftBeamSearch#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftBeamSearch(*args, **kwargs)#

Version

  • name: BeamSearch (GitHub)

  • domain: com.microsoft

  • since_version: 1

  • function:

  • support_level:

  • shape inference:

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

Beam Search for text generation. Supports GPT-2 decoder.

Attributes

  • decoder (required): Decoder subgraph to execute in a loop. Default value is ?.

  • early_stopping: early stop or not Default value is ?.

  • encoder_decoder_init: subgraph for initialization of encoder and decoder. It will be called once before decoder subgraph. Default value is ?.

  • eos_token_id (required): The id of the end-of-sequence token Default value is ?.

  • model_type: model type: 0 for GPT-2; 1 for encoder decoder like T5 Default value is ?.

  • no_repeat_ngram_size: no repeat ngrams size Default value is ?.

  • pad_token_id (required): The id of the padding token Default value is ?.

Inputs

Between 6 and 10 inputs.

  • input_ids (heterogeneous) - I: The sequence used as a prompt for the generation. Shape is (batch_size, sequence_length)

  • max_length (heterogeneous) - I: The maximum length of the sequence to be generated. Shape is (1)

  • min_length (optional, heterogeneous) - I: The minimum length below which the score of eos_token_id is set to -Inf. Shape is (1)

  • num_beams (heterogeneous) - I: Number of beams for beam search. 1 means no beam search. Shape is (1)

  • num_return_sequences (heterogeneous) - I: The number of returned sequences in the batch. Shape is (1)

  • temperature (heterogeneous) - T: The value used to module the next token probabilities. Accepts value > 0.0. Shape is (1)

  • length_penalty (optional, heterogeneous) - T: Exponential penalty to the length. Default value 1.0 means no penalty.Value > 1.0 encourages longer sequences, while values < 1.0 produces shorter sequences.Shape is (1,)

  • repetition_penalty (optional, heterogeneous) - T: The parameter for repetition penalty. Default value 1.0 means no penalty. Accepts value > 0.0. Shape is (1)

  • vocab_mask (optional, heterogeneous) - M: Mask of vocabulary. Words that masked with 0 are not allowed to be generated, and 1 is allowed. Shape is (vacab_size)

  • prefix_vocab_mask (optional, heterogeneous) - M: Mask of vocabulary for first step. Words that masked with 0 are not allowed to be generated, and 1 is allowed. Shape is (batch_size, vocab_size)

Outputs

Between 1 and 3 outputs.

  • sequences (heterogeneous) - I: Word IDs of generated sequences. Shape is (batch_size, num_return_sequences, max_sequence_length)

  • sequences_scores (optional, heterogeneous) - T: Final beam score of the generated sequences. Shape is (batch_size, num_return_sequences)

  • scores (optional, heterogeneous) - T: Processed beam scores for each vocabulary token at each generation step.Beam scores consisting of log softmax scores for each vocabulary token and sum of log softmax of previously generated tokens in this beam.Shape is (max_length - sequence_length, batch_size, num_beams, vocab_size)

OnnxComMicrosoftBeamSearch_1#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftBeamSearch_1(*args, **kwargs)#

Version

  • name: BeamSearch (GitHub)

  • domain: com.microsoft

  • since_version: 1

  • function:

  • support_level:

  • shape inference:

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

Beam Search for text generation. Supports GPT-2 decoder.

Attributes

  • decoder (required): Decoder subgraph to execute in a loop. Default value is ?.

  • early_stopping: early stop or not Default value is ?.

  • encoder_decoder_init: subgraph for initialization of encoder and decoder. It will be called once before decoder subgraph. Default value is ?.

  • eos_token_id (required): The id of the end-of-sequence token Default value is ?.

  • model_type: model type: 0 for GPT-2; 1 for encoder decoder like T5 Default value is ?.

  • no_repeat_ngram_size: no repeat ngrams size Default value is ?.

  • pad_token_id (required): The id of the padding token Default value is ?.

Inputs

Between 6 and 10 inputs.

  • input_ids (heterogeneous) - I: The sequence used as a prompt for the generation. Shape is (batch_size, sequence_length)

  • max_length (heterogeneous) - I: The maximum length of the sequence to be generated. Shape is (1)

  • min_length (optional, heterogeneous) - I: The minimum length below which the score of eos_token_id is set to -Inf. Shape is (1)

  • num_beams (heterogeneous) - I: Number of beams for beam search. 1 means no beam search. Shape is (1)

  • num_return_sequences (heterogeneous) - I: The number of returned sequences in the batch. Shape is (1)

  • temperature (heterogeneous) - T: The value used to module the next token probabilities. Accepts value > 0.0. Shape is (1)

  • length_penalty (optional, heterogeneous) - T: Exponential penalty to the length. Default value 1.0 means no penalty.Value > 1.0 encourages longer sequences, while values < 1.0 produces shorter sequences.Shape is (1,)

  • repetition_penalty (optional, heterogeneous) - T: The parameter for repetition penalty. Default value 1.0 means no penalty. Accepts value > 0.0. Shape is (1)

  • vocab_mask (optional, heterogeneous) - M: Mask of vocabulary. Words that masked with 0 are not allowed to be generated, and 1 is allowed. Shape is (vacab_size)

  • prefix_vocab_mask (optional, heterogeneous) - M: Mask of vocabulary for first step. Words that masked with 0 are not allowed to be generated, and 1 is allowed. Shape is (batch_size, vocab_size)

Outputs

Between 1 and 3 outputs.

  • sequences (heterogeneous) - I: Word IDs of generated sequences. Shape is (batch_size, num_return_sequences, max_sequence_length)

  • sequences_scores (optional, heterogeneous) - T: Final beam score of the generated sequences. Shape is (batch_size, num_return_sequences)

  • scores (optional, heterogeneous) - T: Processed beam scores for each vocabulary token at each generation step.Beam scores consisting of log softmax scores for each vocabulary token and sum of log softmax of previously generated tokens in this beam.Shape is (max_length - sequence_length, batch_size, num_beams, vocab_size)

OnnxComMicrosoftBiasDropout#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftBiasDropout(*args, **kwargs)#

Version

  • name: BiasDropout (GitHub)

  • domain: com.microsoft

  • since_version: 1

  • function:

  • support_level:

  • shape inference:

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

output, dropout_mask = Dropout(data + bias, ratio) + residual, Intended to specialize the dropout pattern commonly found in transformer models.

Attributes

  • seed: (Optional) Seed to the random generator, if not specified we will auto generate one. Default value is ?.

Inputs

Between 2 and 5 inputs.

  • data (heterogeneous) - T: The input data as Tensor.

  • bias (heterogeneous) - T: The bias input, a vector with the same shape as last dim of data OR same shape with data

  • residual (optional, heterogeneous) - T: The residual input, must have the same shape as data

  • ratio (optional, heterogeneous) - T1: The ratio of random dropout, with value in [0, 1). If this input was not set, or if it was set to 0, the output would be a simple copy of the input. If it’s non-zero, output will be a random dropout of the scaled input, which is typically the case during training. It is an optional value, if not specified it will default to 0.5.

  • training_mode (optional, heterogeneous) - T2: If set to true then it indicates dropout is being used for training. It is an optional value hence unless specified explicitly, it is false. If it is false, ratio is ignored and the operation mimics inference mode where nothing will be dropped from the input data and if mask is requested as output it will contain all ones.

Outputs

Between 1 and 2 outputs.

  • output (heterogeneous) - T: The output.

  • mask (optional, heterogeneous) - T2: The output mask of dropout.

OnnxComMicrosoftBiasDropout_1#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftBiasDropout_1(*args, **kwargs)#

Version

  • name: BiasDropout (GitHub)

  • domain: com.microsoft

  • since_version: 1

  • function:

  • support_level:

  • shape inference:

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

output, dropout_mask = Dropout(data + bias, ratio) + residual, Intended to specialize the dropout pattern commonly found in transformer models.

Attributes

  • seed: (Optional) Seed to the random generator, if not specified we will auto generate one. Default value is ?.

Inputs

Between 2 and 5 inputs.

  • data (heterogeneous) - T: The input data as Tensor.

  • bias (heterogeneous) - T: The bias input, a vector with the same shape as last dim of data OR same shape with data

  • residual (optional, heterogeneous) - T: The residual input, must have the same shape as data

  • ratio (optional, heterogeneous) - T1: The ratio of random dropout, with value in [0, 1). If this input was not set, or if it was set to 0, the output would be a simple copy of the input. If it’s non-zero, output will be a random dropout of the scaled input, which is typically the case during training. It is an optional value, if not specified it will default to 0.5.

  • training_mode (optional, heterogeneous) - T2: If set to true then it indicates dropout is being used for training. It is an optional value hence unless specified explicitly, it is false. If it is false, ratio is ignored and the operation mimics inference mode where nothing will be dropped from the input data and if mask is requested as output it will contain all ones.

Outputs

Between 1 and 2 outputs.

  • output (heterogeneous) - T: The output.

  • mask (optional, heterogeneous) - T2: The output mask of dropout.

OnnxComMicrosoftBiasFastGeluGrad_dX#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftBiasFastGeluGrad_dX(*args, **kwargs)#

Version

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

Computes dX for FastGeluGrad with bias

Inputs

  • dY (heterogeneous) - T: The gradient tensor from output.

  • X (heterogeneous) - T: The input tensor.

  • B (heterogeneous) - T: The bias tensor.

Outputs

  • dX (heterogeneous) - T: Gradient of the input.

OnnxComMicrosoftBiasFastGeluGrad_dX_1#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftBiasFastGeluGrad_dX_1(*args, **kwargs)#

Version

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

Computes dX for FastGeluGrad with bias

Inputs

  • dY (heterogeneous) - T: The gradient tensor from output.

  • X (heterogeneous) - T: The input tensor.

  • B (heterogeneous) - T: The bias tensor.

Outputs

  • dX (heterogeneous) - T: Gradient of the input.

OnnxComMicrosoftBiasGelu#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftBiasGelu(*args, **kwargs)#

Version

  • name: BiasGelu (GitHub)

  • domain: com.microsoft

  • since_version: 1

  • function:

  • support_level:

  • shape inference:

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

Bias Gelu. It’s an extension of Gelu. It takes the sum of input A and bias input B as the input of Gelu activation.

Inputs

  • A (heterogeneous) - T: The normal input data.

  • B (heterogeneous) - T: The bias input data that is a 1D tensor.

Outputs

  • C (heterogeneous) - T: The output.

OnnxComMicrosoftBiasGeluGrad_dX#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftBiasGeluGrad_dX(*args, **kwargs)#

Version

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

Computes dX for BiasGeluGrad

Inputs

  • dY (heterogeneous) - T: The gradient tensor from output.

  • X (heterogeneous) - T: The input tensor.

  • B (heterogeneous) - T: The bias tensor.

Outputs

  • dX (heterogeneous) - T: Gradient of the input.

OnnxComMicrosoftBiasGeluGrad_dX_1#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftBiasGeluGrad_dX_1(*args, **kwargs)#

Version

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

Computes dX for BiasGeluGrad

Inputs

  • dY (heterogeneous) - T: The gradient tensor from output.

  • X (heterogeneous) - T: The input tensor.

  • B (heterogeneous) - T: The bias tensor.

Outputs

  • dX (heterogeneous) - T: Gradient of the input.

OnnxComMicrosoftBiasGelu_1#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftBiasGelu_1(*args, **kwargs)#

Version

  • name: BiasGelu (GitHub)

  • domain: com.microsoft

  • since_version: 1

  • function:

  • support_level:

  • shape inference:

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

Bias Gelu. It’s an extension of Gelu. It takes the sum of input A and bias input B as the input of Gelu activation.

Inputs

  • A (heterogeneous) - T: The normal input data.

  • B (heterogeneous) - T: The bias input data that is a 1D tensor.

Outputs

  • C (heterogeneous) - T: The output.

OnnxComMicrosoftBiasSoftmax#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftBiasSoftmax(*args, **kwargs)#

Version

  • name: BiasSoftmax (GitHub)

  • domain: com.microsoft

  • since_version: 1

  • function:

  • support_level:

  • shape inference:

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

Y = softmax(scores + bias)) with simple broadcast on bias. Intended to specialize softmax(scores + additive_mask) commonly found in transformer models.

Attributes

  • broadcast_axis: broadcast bias across input for dimensions broadcast_axis to softmax_axis-1 Default value is ?.

  • softmax_axis: apply softmax to elements for dimensions softmax_axis or higher Default value is ?.

Inputs

  • data (heterogeneous) - T: The input data as Tensor.

  • bias (heterogeneous) - T: The bias (or mask) as Tensor.

Outputs

  • output (heterogeneous) - T: The output.

OnnxComMicrosoftBiasSoftmax_1#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftBiasSoftmax_1(*args, **kwargs)#

Version

  • name: BiasSoftmax (GitHub)

  • domain: com.microsoft

  • since_version: 1

  • function:

  • support_level:

  • shape inference:

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

Y = softmax(scores + bias)) with simple broadcast on bias. Intended to specialize softmax(scores + additive_mask) commonly found in transformer models.

Attributes

  • broadcast_axis: broadcast bias across input for dimensions broadcast_axis to softmax_axis-1 Default value is ?.

  • softmax_axis: apply softmax to elements for dimensions softmax_axis or higher Default value is ?.

Inputs

  • data (heterogeneous) - T: The input data as Tensor.

  • bias (heterogeneous) - T: The bias (or mask) as Tensor.

Outputs

  • output (heterogeneous) - T: The output.

OnnxComMicrosoftBifurcationDetector#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftBifurcationDetector(*args, **kwargs)#

Version

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

Component for aggressive decoding. Find the bifurcation index of predicted tokens, between source tokens, starting from previous suffix match index, and predicted tokens. Concat predicted tokens, starting from bifurcation index, to the back of current tokens. This forms the output tokens. Detect suffix match index in source tokens, between source tokens and output tokens. Detection is based on finding the appearances of last n-gram in output tokens in source tokens. A match is considered found if source tokens contain a single matching n-gram. Return the index of the start of the n-gram in source tokens. No matching if found if src tokens contain multiple or zero matching n-grams. Return -1.

Attributes

  • max_ngram_size: The maximum NGram size for suffix matching. Default value is ?.

  • min_ngram_size: The minimum NGram size for suffix matching. Default value is ?.

Inputs

Between 3 and 4 inputs.

  • src_tokens (heterogeneous) - T: Encoder input ids.

  • cur_tokens (heterogeneous) - T: Decoder input ids.

  • prev_suffix_match_idx (heterogeneous) - T: Previous suffix match index

  • pred_tokens (optional, heterogeneous) - T: Predicted token ids from aggressive decoding

Outputs

  • tokens (heterogeneous) - T: Decoder input ids after merging predicted tokens

  • suffix_match_idx (heterogeneous) - T: new suffix match index

OnnxComMicrosoftBifurcationDetector_1#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftBifurcationDetector_1(*args, **kwargs)#

Version

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

Component for aggressive decoding. Find the bifurcation index of predicted tokens, between source tokens, starting from previous suffix match index, and predicted tokens. Concat predicted tokens, starting from bifurcation index, to the back of current tokens. This forms the output tokens. Detect suffix match index in source tokens, between source tokens and output tokens. Detection is based on finding the appearances of last n-gram in output tokens in source tokens. A match is considered found if source tokens contain a single matching n-gram. Return the index of the start of the n-gram in source tokens. No matching if found if src tokens contain multiple or zero matching n-grams. Return -1.

Attributes

  • max_ngram_size: The maximum NGram size for suffix matching. Default value is ?.

  • min_ngram_size: The minimum NGram size for suffix matching. Default value is ?.

Inputs

Between 3 and 4 inputs.

  • src_tokens (heterogeneous) - T: Encoder input ids.

  • cur_tokens (heterogeneous) - T: Decoder input ids.

  • prev_suffix_match_idx (heterogeneous) - T: Previous suffix match index

  • pred_tokens (optional, heterogeneous) - T: Predicted token ids from aggressive decoding

Outputs

  • tokens (heterogeneous) - T: Decoder input ids after merging predicted tokens

  • suffix_match_idx (heterogeneous) - T: new suffix match index

OnnxComMicrosoftBitmaskBiasDropout#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftBitmaskBiasDropout(*args, **kwargs)#

Version

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

output, dropout_bitmask = Dropout(data + bias, ratio) + residual, Intended to specialize the dropout pattern commonly found in transformer models.

Attributes

  • seed: (Optional) Seed to the random generator, if not specified we will auto generate one. Default value is ?.

Inputs

Between 2 and 5 inputs.

  • data (heterogeneous) - T: The input data as Tensor.

  • bias (heterogeneous) - T: The bias input, a vector with the same shape as last dim of data OR same shape with data

  • residual (optional, heterogeneous) - T: The residual input, must have the same shape as data

  • ratio (optional, heterogeneous) - T1: The ratio of random dropout, with value in [0, 1). If this input was not set, or if it was set to 0, the output would be a simple copy of the input. If it’s non-zero, output will be a random dropout of the scaled input, which is typically the case during training. It is an optional value, if not specified it will default to 0.5.

  • training_mode (optional, heterogeneous) - T2: If set to true then it indicates dropout is being used for training. It is an optional value hence unless specified explicitly, it is false. If it is false, ratio is ignored and the operation mimics inference mode where nothing will be dropped from the input data and if mask is requested as output it will contain all ones.

Outputs

Between 1 and 2 outputs.

  • output (heterogeneous) - T: The output.

  • mask (optional, heterogeneous) - T3: The output mask of dropout.

OnnxComMicrosoftBitmaskBiasDropout_1#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftBitmaskBiasDropout_1(*args, **kwargs)#

Version

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

output, dropout_bitmask = Dropout(data + bias, ratio) + residual, Intended to specialize the dropout pattern commonly found in transformer models.

Attributes

  • seed: (Optional) Seed to the random generator, if not specified we will auto generate one. Default value is ?.

Inputs

Between 2 and 5 inputs.

  • data (heterogeneous) - T: The input data as Tensor.

  • bias (heterogeneous) - T: The bias input, a vector with the same shape as last dim of data OR same shape with data

  • residual (optional, heterogeneous) - T: The residual input, must have the same shape as data

  • ratio (optional, heterogeneous) - T1: The ratio of random dropout, with value in [0, 1). If this input was not set, or if it was set to 0, the output would be a simple copy of the input. If it’s non-zero, output will be a random dropout of the scaled input, which is typically the case during training. It is an optional value, if not specified it will default to 0.5.

  • training_mode (optional, heterogeneous) - T2: If set to true then it indicates dropout is being used for training. It is an optional value hence unless specified explicitly, it is false. If it is false, ratio is ignored and the operation mimics inference mode where nothing will be dropped from the input data and if mask is requested as output it will contain all ones.

Outputs

Between 1 and 2 outputs.

  • output (heterogeneous) - T: The output.

  • mask (optional, heterogeneous) - T3: The output mask of dropout.

OnnxComMicrosoftBitmaskDropout#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftBitmaskDropout(*args, **kwargs)#

Version

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

BitmaskDropout takes an input floating-point tensor, an optional input ratio (floating-point scalar) and an optional input training_mode (boolean scalar). It produces two tensor outputs: output (floating-point tensor) and mask (optional Tensor<uint32>). If training_mode is true then the output Y will be a random dropout. Note that this Dropout scales the masked input data by the following equation, so to convert the trained model into inference mode, the user can simply not pass training_mode input or set it to false.

output = scale * data * mask,

where

scale = 1. / (1. - ratio).

This op functions in much the same was as Dropout-11 and Dropout-13 do, execpt that the mask is output as a bit-packed uint32 tensor, instead of a boolean tensor.

Attributes

  • seed: (Optional) Seed to the random generator, if not specified we will auto generate one. Default value is ?.

Inputs

Between 1 and 3 inputs.

  • data (heterogeneous) - T: The input data as Tensor.

  • ratio (optional, heterogeneous) - T1: The ratio of random dropout, with value in [0, 1). If this input was not set, or if it was set to 0, the output would be a simple copy of the input. If it’s non-zero, output will be a random dropout of the scaled input, which is typically the case during training. It is an optional value, if not specified it will default to 0.5.

  • training_mode (optional, heterogeneous) - T2: If set to true then it indicates dropout is being used for training. It is an optional value hence unless specified explicitly, it is false. If it is false, ratio is ignored and the operation mimics inference mode where nothing will be dropped from the input data and if mask is requested as output it will contain all ones.

Outputs

Between 1 and 2 outputs.

  • output (heterogeneous) - T: The output.

  • mask (optional, heterogeneous) - T3: The bit-packed output mask.

OnnxComMicrosoftBitmaskDropoutGrad#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftBitmaskDropoutGrad(*args, **kwargs)#

Version

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

BitmaskDropoutGrad

Inputs

Between 2 and 4 inputs.

  • dy (heterogeneous) - T: The gradient tensor from output.

  • mask (heterogeneous) - T3: The mask output of the dropout.

  • ratio (optional, heterogeneous) - T1: Same value as the ratio input supplied to the dropout op with value in [0, 1). If this input is not specified, a default value of 0.5 is used.

  • training_mode (optional, heterogeneous) - T2: Same value as the training_mode input supplied to the dropout op. If this input is not specified, a default value of false is used.

Outputs

  • dx (heterogeneous) - T: Gradient of the input.

OnnxComMicrosoftBitmaskDropoutGrad_1#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftBitmaskDropoutGrad_1(*args, **kwargs)#

Version

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

BitmaskDropoutGrad

Inputs

Between 2 and 4 inputs.

  • dy (heterogeneous) - T: The gradient tensor from output.

  • mask (heterogeneous) - T3: The mask output of the dropout.

  • ratio (optional, heterogeneous) - T1: Same value as the ratio input supplied to the dropout op with value in [0, 1). If this input is not specified, a default value of 0.5 is used.

  • training_mode (optional, heterogeneous) - T2: Same value as the training_mode input supplied to the dropout op. If this input is not specified, a default value of false is used.

Outputs

  • dx (heterogeneous) - T: Gradient of the input.

OnnxComMicrosoftBitmaskDropout_1#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftBitmaskDropout_1(*args, **kwargs)#

Version

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

BitmaskDropout takes an input floating-point tensor, an optional input ratio (floating-point scalar) and an optional input training_mode (boolean scalar). It produces two tensor outputs: output (floating-point tensor) and mask (optional Tensor<uint32>). If training_mode is true then the output Y will be a random dropout. Note that this Dropout scales the masked input data by the following equation, so to convert the trained model into inference mode, the user can simply not pass training_mode input or set it to false.

output = scale * data * mask,

where

scale = 1. / (1. - ratio).

This op functions in much the same was as Dropout-11 and Dropout-13 do, execpt that the mask is output as a bit-packed uint32 tensor, instead of a boolean tensor.

Attributes

  • seed: (Optional) Seed to the random generator, if not specified we will auto generate one. Default value is ?.

Inputs

Between 1 and 3 inputs.

  • data (heterogeneous) - T: The input data as Tensor.

  • ratio (optional, heterogeneous) - T1: The ratio of random dropout, with value in [0, 1). If this input was not set, or if it was set to 0, the output would be a simple copy of the input. If it’s non-zero, output will be a random dropout of the scaled input, which is typically the case during training. It is an optional value, if not specified it will default to 0.5.

  • training_mode (optional, heterogeneous) - T2: If set to true then it indicates dropout is being used for training. It is an optional value hence unless specified explicitly, it is false. If it is false, ratio is ignored and the operation mimics inference mode where nothing will be dropped from the input data and if mask is requested as output it will contain all ones.

Outputs

Between 1 and 2 outputs.

  • output (heterogeneous) - T: The output.

  • mask (optional, heterogeneous) - T3: The bit-packed output mask.

OnnxComMicrosoftBroadcastGradientArgs#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftBroadcastGradientArgs(*args, **kwargs)#

Version

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

Returns the reduction axes for computing gradients of s0 op s1 with broadcast.The ouput axes are deterministic from last to first. Output is an empty vector when no reduction is necessary for the corresponding input.

Inputs

  • a_shape (heterogeneous) - T: The 1st input shape as Tensor.

  • b_shape (heterogeneous) - T: The 2nd input shape as Tensor.

Outputs

Between 0 and 2 outputs.

  • a_axes (optional, heterogeneous) - T: The reduction axes for 1st input, last to first.

  • b_axes (optional, heterogeneous) - T: The reduction axes for 2nd input, last to first.

OnnxComMicrosoftBroadcastGradientArgs_1#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftBroadcastGradientArgs_1(*args, **kwargs)#

Version

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

Returns the reduction axes for computing gradients of s0 op s1 with broadcast.The ouput axes are deterministic from last to first. Output is an empty vector when no reduction is necessary for the corresponding input.

Inputs

  • a_shape (heterogeneous) - T: The 1st input shape as Tensor.

  • b_shape (heterogeneous) - T: The 2nd input shape as Tensor.

Outputs

Between 0 and 2 outputs.

  • a_axes (optional, heterogeneous) - T: The reduction axes for 1st input, last to first.

  • b_axes (optional, heterogeneous) - T: The reduction axes for 2nd input, last to first.

OnnxComMicrosoftCDist#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftCDist(*args, **kwargs)#

Version

  • name: CDist (GitHub)

  • domain: com.microsoft

  • since_version: 1

  • function:

  • support_level:

  • shape inference:

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

Attributes

  • metric: The distance metric to use. If a string, the distance function can be “braycurtis”, “canberra”, “chebyshev”, “cityblock”, “correlation”, “cosine”, “dice”, “euclidean”, “hamming”, “jaccard”, “jensenshannon”, “kulsinski”, “mahalanobis”, “matching”, “minkowski”, “rogerstanimoto”, “russellrao”, “seuclidean”, “sokalmichener”, “sokalsneath”, “sqeuclidean”, “wminkowski”, “yule”. Default value is ?.

Inputs

  • A (heterogeneous) - T: 2D matrix with shape (M,N)

  • B (heterogeneous) - T: 2D matrix with shape (K,N)

Outputs

  • C (heterogeneous) - T: A 2D Matrix that represents the distance between each pair of the two collections of inputs.

OnnxComMicrosoftCDist_1#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftCDist_1(*args, **kwargs)#

Version

  • name: CDist (GitHub)

  • domain: com.microsoft

  • since_version: 1

  • function:

  • support_level:

  • shape inference:

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

Attributes

  • metric: The distance metric to use. If a string, the distance function can be “braycurtis”, “canberra”, “chebyshev”, “cityblock”, “correlation”, “cosine”, “dice”, “euclidean”, “hamming”, “jaccard”, “jensenshannon”, “kulsinski”, “mahalanobis”, “matching”, “minkowski”, “rogerstanimoto”, “russellrao”, “seuclidean”, “sokalmichener”, “sokalsneath”, “sqeuclidean”, “wminkowski”, “yule”. Default value is ?.

Inputs

  • A (heterogeneous) - T: 2D matrix with shape (M,N)

  • B (heterogeneous) - T: 2D matrix with shape (K,N)

Outputs

  • C (heterogeneous) - T: A 2D Matrix that represents the distance between each pair of the two collections of inputs.

OnnxComMicrosoftComplexMul#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftComplexMul(*args, **kwargs)#

Version

  • name: ComplexMul (GitHub)

  • domain: com.microsoft

  • since_version: 1

  • function:

  • support_level:

  • shape inference:

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

Inputs

  • A (heterogeneous) - T: input_0

  • B (heterogeneous) - T: input_1

Outputs

  • C (heterogeneous) - T: output tensor

OnnxComMicrosoftComplexMulConj#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftComplexMulConj(*args, **kwargs)#

Version

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

Inputs

  • A (heterogeneous) - T: input_0

  • B (heterogeneous) - T: input_1

Outputs

  • C (heterogeneous) - T: output tensor

OnnxComMicrosoftComplexMulConj_1#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftComplexMulConj_1(*args, **kwargs)#

Version

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

Inputs

  • A (heterogeneous) - T: input_0

  • B (heterogeneous) - T: input_1

Outputs

  • C (heterogeneous) - T: output tensor

OnnxComMicrosoftComplexMul_1#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftComplexMul_1(*args, **kwargs)#

Version

  • name: ComplexMul (GitHub)

  • domain: com.microsoft

  • since_version: 1

  • function:

  • support_level:

  • shape inference:

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

Inputs

  • A (heterogeneous) - T: input_0

  • B (heterogeneous) - T: input_1

Outputs

  • C (heterogeneous) - T: output tensor

OnnxComMicrosoftConcatTraining#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftConcatTraining(*args, **kwargs)#

Version

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

Concatenate a list of tensors into a single tensor

Attributes

  • axis (required): Which axis to concat on Default value is ?.

Inputs

Between 1 and 2147483647 inputs.

  • inputs (variadic, heterogeneous) - T: List of tensors for concatenation

Outputs

Between 1 and 2 outputs.

  • concat_result (heterogeneous) - T: Concatenated tensor

  • per_input_length (optional, heterogeneous) - Tint: Vector of length of each concatenated input along the ‘axis’ dimension

OnnxComMicrosoftConcatTraining_1#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftConcatTraining_1(*args, **kwargs)#

Version

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

Concatenate a list of tensors into a single tensor

Attributes

  • axis (required): Which axis to concat on Default value is ?.

Inputs

Between 1 and 2147483647 inputs.

  • inputs (variadic, heterogeneous) - T: List of tensors for concatenation

Outputs

Between 1 and 2 outputs.

  • concat_result (heterogeneous) - T: Concatenated tensor

  • per_input_length (optional, heterogeneous) - Tint: Vector of length of each concatenated input along the ‘axis’ dimension

OnnxComMicrosoftConvGrad#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftConvGrad(*args, **kwargs)#

Version

  • name: ConvGrad (GitHub)

  • domain: com.microsoft

  • since_version: 1

  • function:

  • support_level:

  • shape inference:

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

Inputs

  • dY (heterogeneous) - T: Gradient of output Y

  • X (heterogeneous) - T: Input tensor

  • W (heterogeneous) - T: Weight tensor

Outputs

Between 0 and 3 outputs.

  • dX (optional, heterogeneous) - T: Gradient of X

  • dW (optional, heterogeneous) - T: Gradient of W

  • dB (optional, heterogeneous) - T: Gradient of B

OnnxComMicrosoftConvGrad_1#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftConvGrad_1(*args, **kwargs)#

Version

  • name: ConvGrad (GitHub)

  • domain: com.microsoft

  • since_version: 1

  • function:

  • support_level:

  • shape inference:

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

Inputs

  • dY (heterogeneous) - T: Gradient of output Y

  • X (heterogeneous) - T: Input tensor

  • W (heterogeneous) - T: Weight tensor

Outputs

Between 0 and 3 outputs.

  • dX (optional, heterogeneous) - T: Gradient of X

  • dW (optional, heterogeneous) - T: Gradient of W

  • dB (optional, heterogeneous) - T: Gradient of B

OnnxComMicrosoftConvTransposeWithDynamicPads#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftConvTransposeWithDynamicPads(*args, **kwargs)#

Version

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

Attributes

  • auto_pad:

Default value is ?.

  • dilations:

Default value is ?.

  • group:

Default value is ?.

  • kernel_shape:

Default value is ?.

  • output_padding:

Default value is ?.

  • strides:

Default value is ?.

Inputs

Between 2 and 4 inputs.

  • X (heterogeneous) - T:

  • W (heterogeneous) - T:

  • Pads (optional, heterogeneous) - tensor(int64):

  • B (optional, heterogeneous) - T:

Outputs

  • Y (heterogeneous) - T:

OnnxComMicrosoftConvTransposeWithDynamicPads_1#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftConvTransposeWithDynamicPads_1(*args, **kwargs)#

Version

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

Attributes

  • auto_pad:

Default value is ?.

  • dilations:

Default value is ?.

  • group:

Default value is ?.

  • kernel_shape:

Default value is ?.

  • output_padding:

Default value is ?.

  • strides:

Default value is ?.

Inputs

Between 2 and 4 inputs.

  • X (heterogeneous) - T:

  • W (heterogeneous) - T:

  • Pads (optional, heterogeneous) - tensor(int64):

  • B (optional, heterogeneous) - T:

Outputs

  • Y (heterogeneous) - T:

OnnxComMicrosoftCropAndResize#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftCropAndResize(*args, **kwargs)#

Version

  • name: CropAndResize (GitHub)

  • domain: com.microsoft

  • since_version: 1

  • function:

  • support_level:

  • shape inference:

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

Extracts crops from the input image tensor and resizes them using bilinear sampling or nearest neighbor sampling (possibly with aspect ratio change) to a common output size specified by crop_height and crop_width. Returns a tensor with crops from the input image at positions defined at the bounding box locations in boxes. The cropped boxes are all resized (with bilinear or nearest neighbor interpolation) to a fixed size = [crop_height, crop_width]. The result is a 4-D tensor [num_boxes, crop_height, crop_width, depth]. The resizing is corner aligned.

Attributes

  • extrapolation_value: Value used for extrapolation, when applicable. Default is 0.0f. Default value is ?.

  • mode: The pooling method. Two modes are supported: ‘bilinear’ and ‘nearest’. Default is ‘bilinear’. Default value is ?.

Inputs

  • X (heterogeneous) - T1: Input data tensor from the previous operator; 4-D feature map of shape (N, C, H, W), where N is the batch size, C is the number of channels, and H and W are the height and the width of the data.

  • rois (heterogeneous) - T1: RoIs (Regions of Interest) to pool over; rois is 2-D input of shape (num_rois, 4) given as [[y1, x1, y2, x2], …]. The RoIs’ coordinates are normalized in the coordinate system of the input image. Each coordinate set has a 1:1 correspondence with the ‘batch_indices’ input.

  • batch_indices (heterogeneous) - T2: 1-D tensor of shape (num_rois,) with each element denoting the index of the corresponding image in the batch.

  • crop_size (heterogeneous) - T2: 1-D tensor of 2 elements: [crop_height, crop_width]. All cropped image patches are resized to this size. Both crop_height and crop_width need to be positive.

Outputs

  • Y (heterogeneous) - T1: RoI pooled output, 4-D tensor of shape (num_rois, C, crop_height, crop_width). The r-th batch element Y[r-1] is a pooled feature map corresponding to the r-th RoI X[r-1].

OnnxComMicrosoftCropAndResize_1#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftCropAndResize_1(*args, **kwargs)#

Version

  • name: CropAndResize (GitHub)

  • domain: com.microsoft

  • since_version: 1

  • function:

  • support_level:

  • shape inference:

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

Extracts crops from the input image tensor and resizes them using bilinear sampling or nearest neighbor sampling (possibly with aspect ratio change) to a common output size specified by crop_height and crop_width. Returns a tensor with crops from the input image at positions defined at the bounding box locations in boxes. The cropped boxes are all resized (with bilinear or nearest neighbor interpolation) to a fixed size = [crop_height, crop_width]. The result is a 4-D tensor [num_boxes, crop_height, crop_width, depth]. The resizing is corner aligned.

Attributes

  • extrapolation_value: Value used for extrapolation, when applicable. Default is 0.0f. Default value is ?.

  • mode: The pooling method. Two modes are supported: ‘bilinear’ and ‘nearest’. Default is ‘bilinear’. Default value is ?.

Inputs

  • X (heterogeneous) - T1: Input data tensor from the previous operator; 4-D feature map of shape (N, C, H, W), where N is the batch size, C is the number of channels, and H and W are the height and the width of the data.

  • rois (heterogeneous) - T1: RoIs (Regions of Interest) to pool over; rois is 2-D input of shape (num_rois, 4) given as [[y1, x1, y2, x2], …]. The RoIs’ coordinates are normalized in the coordinate system of the input image. Each coordinate set has a 1:1 correspondence with the ‘batch_indices’ input.

  • batch_indices (heterogeneous) - T2: 1-D tensor of shape (num_rois,) with each element denoting the index of the corresponding image in the batch.

  • crop_size (heterogeneous) - T2: 1-D tensor of 2 elements: [crop_height, crop_width]. All cropped image patches are resized to this size. Both crop_height and crop_width need to be positive.

Outputs

  • Y (heterogeneous) - T1: RoI pooled output, 4-D tensor of shape (num_rois, C, crop_height, crop_width). The r-th batch element Y[r-1] is a pooled feature map corresponding to the r-th RoI X[r-1].

OnnxComMicrosoftDecoderAttention#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftDecoderAttention(*args, **kwargs)#

Version

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

This DecoderAttention supports self attention and cross attention, key and value cache, and key_padding_mask. The attention mask is not support at the moment. Some boolean parameters are passed by runtime input for generic purpose

Attributes

  • num_heads (required): Number of attention heads Default value is ?.

Inputs

  • query (heterogeneous) - T: 3D input tensor with shape (sequence_length, batch_size, hidden_size), hidden_size = num_heads * head_size

  • key (heterogeneous) - T: 3D input tensor with shape (total_sequence_length, batch_size, hidden_size)

  • q_weight (heterogeneous) - T: 2D input tensor with shape (hidden_size, hidden_size)

  • kv_weight (heterogeneous) - T: 2D input tensor with shape (hidden_size, 2 * hidden_size)

  • bias (heterogeneous) - T: 1D input tensor with shape (3 * hidden_size)

  • key_padding_mask (optional, heterogeneous) - B: 2D input tensor with shape (batch_size, total_sequence_length)

  • key_cache (optional, heterogeneous) - T: input tensor with shape (batch_size, num_heads, sequence_length or total_sequence_length, head_size)

  • value_cache (optional, heterogeneous) - T: input tensor with shape (batch_size, num_heads, sequence_length or total_sequence_length, head_size)

  • static_kv (heterogeneous) - B: If static_kv = true, cross-attention; else self-attention

  • use_past (heterogeneous) - B: If use_past = true, use cache; else no cache

  • has_layer_state (heterogeneous) - B: If has_layer_state = true, layer_state = {} or [a,b]; else layer_state = None

  • has_key_padding_mask (heterogeneous) - B: has_key_padding_mask or not

Outputs

Between 1 and 3 outputs.

  • output (heterogeneous) - T: 3D output tensor with shape (sequence_length, batch_size, hidden_size)

  • new_key_cache (optional, heterogeneous) - T: output tensor with shape (batch_size, num_heads, new sequence_length, head_size)

  • new_value_cache (optional, heterogeneous) - T: output tensor with shape (batch_size, num_heads, new sequence_length, head_size)

OnnxComMicrosoftDecoderAttention_1#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftDecoderAttention_1(*args, **kwargs)#

Version

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

This DecoderAttention supports self attention and cross attention, key and value cache, and key_padding_mask. The attention mask is not support at the moment. Some boolean parameters are passed by runtime input for generic purpose

Attributes

  • num_heads (required): Number of attention heads Default value is ?.

Inputs

  • query (heterogeneous) - T: 3D input tensor with shape (sequence_length, batch_size, hidden_size), hidden_size = num_heads * head_size

  • key (heterogeneous) - T: 3D input tensor with shape (total_sequence_length, batch_size, hidden_size)

  • q_weight (heterogeneous) - T: 2D input tensor with shape (hidden_size, hidden_size)

  • kv_weight (heterogeneous) - T: 2D input tensor with shape (hidden_size, 2 * hidden_size)

  • bias (heterogeneous) - T: 1D input tensor with shape (3 * hidden_size)

  • key_padding_mask (optional, heterogeneous) - B: 2D input tensor with shape (batch_size, total_sequence_length)

  • key_cache (optional, heterogeneous) - T: input tensor with shape (batch_size, num_heads, sequence_length or total_sequence_length, head_size)

  • value_cache (optional, heterogeneous) - T: input tensor with shape (batch_size, num_heads, sequence_length or total_sequence_length, head_size)

  • static_kv (heterogeneous) - B: If static_kv = true, cross-attention; else self-attention

  • use_past (heterogeneous) - B: If use_past = true, use cache; else no cache

  • has_layer_state (heterogeneous) - B: If has_layer_state = true, layer_state = {} or [a,b]; else layer_state = None

  • has_key_padding_mask (heterogeneous) - B: has_key_padding_mask or not

Outputs

Between 1 and 3 outputs.

  • output (heterogeneous) - T: 3D output tensor with shape (sequence_length, batch_size, hidden_size)

  • new_key_cache (optional, heterogeneous) - T: output tensor with shape (batch_size, num_heads, new sequence_length, head_size)

  • new_value_cache (optional, heterogeneous) - T: output tensor with shape (batch_size, num_heads, new sequence_length, head_size)

OnnxComMicrosoftDequantizeLinear#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftDequantizeLinear(*args, **kwargs)#

Version

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

The linear dequantization operator. It consumes a quantized data, a scale, a zero point and computes the full precision data. The dequantization formula is y = (x - x_zero_point) * x_scale. Scale and zero point must have same shape. They must be either scalar (per tensor) or 1-D tensor (per ‘axis’).

Attributes

  • axis: The axis along which same quantization parameters are applied. It’s optional.If it’s not specified, it means per-tensor quantization and input ‘x_scale’ and ‘x_zero_point’ must be scalars.If it’s specified, it means per ‘axis’ quantization and input ‘x_scale’ and ‘x_zero_point’ must be 1-D tensors. Default value is ?.

Inputs

  • x (heterogeneous) - T1: N-D quantized Input tensor to be de-quantized.

  • x_scale (heterogeneous) - T2: Scale for input ‘x’. It could be a scalar or a 1-D tensor, which means a per-tensor or per-axis quantization.If it’s a 1-D tensor, its number of elements should be equal to the dimension value of ‘axis’ dimension of input ‘x’.

  • x_zero_point (heterogeneous) - T1: Zero point for input ‘x’. It could be a scalar or a 1-D tensor, which means a per-tensor or per-axis quantization.If it’s a 1-D tensor, its number of elements should be equal to the dimension value of ‘axis’ dimension of input ‘x’.

Outputs

  • y (heterogeneous) - T2: N-D full precision output tensor. It has same shape as input ‘x’.

OnnxComMicrosoftDequantizeLinear_1#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftDequantizeLinear_1(*args, **kwargs)#

Version

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

The linear dequantization operator. It consumes a quantized data, a scale, a zero point and computes the full precision data. The dequantization formula is y = (x - x_zero_point) * x_scale. Scale and zero point must have same shape. They must be either scalar (per tensor) or 1-D tensor (per ‘axis’).

Attributes

  • axis: The axis along which same quantization parameters are applied. It’s optional.If it’s not specified, it means per-tensor quantization and input ‘x_scale’ and ‘x_zero_point’ must be scalars.If it’s specified, it means per ‘axis’ quantization and input ‘x_scale’ and ‘x_zero_point’ must be 1-D tensors. Default value is ?.

Inputs

  • x (heterogeneous) - T1: N-D quantized Input tensor to be de-quantized.

  • x_scale (heterogeneous) - T2: Scale for input ‘x’. It could be a scalar or a 1-D tensor, which means a per-tensor or per-axis quantization.If it’s a 1-D tensor, its number of elements should be equal to the dimension value of ‘axis’ dimension of input ‘x’.

  • x_zero_point (heterogeneous) - T1: Zero point for input ‘x’. It could be a scalar or a 1-D tensor, which means a per-tensor or per-axis quantization.If it’s a 1-D tensor, its number of elements should be equal to the dimension value of ‘axis’ dimension of input ‘x’.

Outputs

  • y (heterogeneous) - T2: N-D full precision output tensor. It has same shape as input ‘x’.

OnnxComMicrosoftDivGrad#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftDivGrad(*args, **kwargs)#

Version

  • name: DivGrad (GitHub)

  • domain: com.microsoft

  • since_version: 1

  • function:

  • support_level:

  • shape inference:

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

Inputs

  • dY (heterogeneous) - T: Gradient of output

  • A (heterogeneous) - T: dividend

  • B (heterogeneous) - T: divisor

Outputs

Between 0 and 2 outputs.

  • dA (optional, heterogeneous) - T: Gradient of dividend

  • dB (optional, heterogeneous) - T: Gradient of divisor

OnnxComMicrosoftDivGrad_1#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftDivGrad_1(*args, **kwargs)#

Version

  • name: DivGrad (GitHub)

  • domain: com.microsoft

  • since_version: 1

  • function:

  • support_level:

  • shape inference:

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

Inputs

  • dY (heterogeneous) - T: Gradient of output

  • A (heterogeneous) - T: dividend

  • B (heterogeneous) - T: divisor

Outputs

Between 0 and 2 outputs.

  • dA (optional, heterogeneous) - T: Gradient of dividend

  • dB (optional, heterogeneous) - T: Gradient of divisor

OnnxComMicrosoftDropoutGrad#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftDropoutGrad(*args, **kwargs)#

Version

  • name: DropoutGrad (GitHub)

  • domain: com.microsoft

  • since_version: 1

  • function:

  • support_level:

  • shape inference:

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

DropoutGrad

Inputs

Between 2 and 4 inputs.

  • dy (heterogeneous) - T: The gradient tensor from output.

  • mask (heterogeneous) - T2: The mask output of the dropout.

  • ratio (optional, heterogeneous) - T1: Same value as the ratio input supplied to the dropout op with value in [0, 1). If this input is not specified, a default value of 0.5 is used.

  • training_mode (optional, heterogeneous) - T2: Same value as the training_mode input supplied to the dropout op. If this input is not specified, a default value of false is used.

Outputs

  • dx (heterogeneous) - T: Gradient of the input.

OnnxComMicrosoftDropoutGrad_1#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftDropoutGrad_1(*args, **kwargs)#

Version

  • name: DropoutGrad (GitHub)

  • domain: com.microsoft

  • since_version: 1

  • function:

  • support_level:

  • shape inference:

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

DropoutGrad

Inputs

Between 2 and 4 inputs.

  • dy (heterogeneous) - T: The gradient tensor from output.

  • mask (heterogeneous) - T2: The mask output of the dropout.

  • ratio (optional, heterogeneous) - T1: Same value as the ratio input supplied to the dropout op with value in [0, 1). If this input is not specified, a default value of 0.5 is used.

  • training_mode (optional, heterogeneous) - T2: Same value as the training_mode input supplied to the dropout op. If this input is not specified, a default value of false is used.

Outputs

  • dx (heterogeneous) - T: Gradient of the input.

OnnxComMicrosoftDynamicQuantizeLSTM#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftDynamicQuantizeLSTM(*args, **kwargs)#

Version

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

Attributes

  • activation_alpha: Optional scaling values used by some activation functions. The values are consumed in the order of activation functions, for example (f, g, h) in LSTM. Default values are the same as of corresponding ONNX operators.For example with LeakyRelu, the default alpha is 0.01. Default value is ?.

  • activation_beta: Optional scaling values used by some activation functions. The values are consumed in the order of activation functions, for example (f, g, h) in LSTM. Default values are the same as of corresponding ONNX operators. Default value is ?.

  • activations: A list of 3 (or 6 if bidirectional) activation functions for input, output, forget, cell, and hidden. The activation functions must be one of the activation functions specified above. Optional: See the equations for default if not specified. Default value is ?.

  • clip: Cell clip threshold. Clipping bounds the elements of a tensor in the range of [-threshold, +threshold] and is applied to the input of activations. No clip if not specified. Default value is ?.

  • direction: Specify if the RNN is forward, reverse, or bidirectional. Must be one of forward (default), reverse, or bidirectional. Default value is ?.

  • hidden_size: Number of neurons in the hidden layer Default value is ?.

  • input_forget: Couple the input and forget gates if 1. Default value is ?.

Inputs

  • X (heterogeneous) - T: The input sequences packed (and potentially padded) into one 3-D tensor with the shape of [seq_length, batch_size, input_size].

  • W (heterogeneous) - T2: The weight tensor for the gates. Concatenation of W[iofc] and WB[iofc] (if bidirectional) along dimension 0. The tensor has shape [num_directions, input_size, 4*hidden_size].

  • R (heterogeneous) - T2: The recurrence weight tensor. Concatenation of R[iofc] and RB[iofc] (if bidirectional) along dimension 0. This tensor has shape [num_directions, hidden_size, 4*hidden_size].

  • B (optional, heterogeneous) - T: The bias tensor for input gate. Concatenation of [Wb[iofc], Rb[iofc]], and [WBb[iofc], RBb[iofc]] (if bidirectional) along dimension 0. This tensor has shape [num_directions, 8*hidden_size]. Optional: If not specified - assumed to be 0.

  • sequence_lens (optional, heterogeneous) - T1: Optional tensor specifying lengths of the sequences in a batch. If not specified - assumed all sequences in the batch to have length seq_length. It has shape [batch_size].

  • initial_h (optional, heterogeneous) - T: Optional initial value of the hidden. If not specified - assumed to be 0. It has shape [num_directions, batch_size, hidden_size].

  • initial_c (optional, heterogeneous) - T: Optional initial value of the cell. If not specified - assumed to be 0. It has shape [num_directions, batch_size, hidden_size].

  • P (optional, heterogeneous) - T: The weight tensor for peepholes. Concatenation of P[iof] and PB[iof] (if bidirectional) along dimension 0. It has shape [num_directions, 3*hidde_size]. Optional: If not specified - assumed to be 0.

  • W_scale (heterogeneous) - T: W’s scale. Its size is [num_directions] for per-tensor/layer quantization, or [num_directions, 4*hidden_size] for per-channel quantization on the axis input_size.

  • W_zero_point (heterogeneous) - T2: W’s zero point. Its size is [num_directions] for per-tensor/layer quantization, or [num_directions, 4*hidden_size] for per-channel quantization on the axis input_size.

  • R_scale (heterogeneous) - T: R’s scale. Its size is [num_directions] for per-tensor/layer quantization, or [num_directions, 4*hidden_size] for per-channel quantization on the axis input_size.

  • R_zero_point (heterogeneous) - T2: R’s zero point. Its size is [num_directions] for per-tensor/layer quantization, or [num_directions, 4*hidden_size] for per-channel quantization on the axis input_size.

Outputs

Between 0 and 3 outputs.

  • Y (optional, heterogeneous) - T: A tensor that concats all the intermediate output values of the hidden. It has shape [seq_length, num_directions, batch_size, hidden_size].

  • Y_h (optional, heterogeneous) - T: The last output value of the hidden. It has shape [num_directions, batch_size, hidden_size].

  • Y_c (optional, heterogeneous) - T: The last output value of the cell. It has shape [num_directions, batch_size, hidden_size].

OnnxComMicrosoftDynamicQuantizeLSTM_1#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftDynamicQuantizeLSTM_1(*args, **kwargs)#

Version

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

Attributes

  • activation_alpha: Optional scaling values used by some activation functions. The values are consumed in the order of activation functions, for example (f, g, h) in LSTM. Default values are the same as of corresponding ONNX operators.For example with LeakyRelu, the default alpha is 0.01. Default value is ?.

  • activation_beta: Optional scaling values used by some activation functions. The values are consumed in the order of activation functions, for example (f, g, h) in LSTM. Default values are the same as of corresponding ONNX operators. Default value is ?.

  • activations: A list of 3 (or 6 if bidirectional) activation functions for input, output, forget, cell, and hidden. The activation functions must be one of the activation functions specified above. Optional: See the equations for default if not specified. Default value is ?.

  • clip: Cell clip threshold. Clipping bounds the elements of a tensor in the range of [-threshold, +threshold] and is applied to the input of activations. No clip if not specified. Default value is ?.

  • direction: Specify if the RNN is forward, reverse, or bidirectional. Must be one of forward (default), reverse, or bidirectional. Default value is ?.

  • hidden_size: Number of neurons in the hidden layer Default value is ?.

  • input_forget: Couple the input and forget gates if 1. Default value is ?.

Inputs

  • X (heterogeneous) - T: The input sequences packed (and potentially padded) into one 3-D tensor with the shape of [seq_length, batch_size, input_size].

  • W (heterogeneous) - T2: The weight tensor for the gates. Concatenation of W[iofc] and WB[iofc] (if bidirectional) along dimension 0. The tensor has shape [num_directions, input_size, 4*hidden_size].

  • R (heterogeneous) - T2: The recurrence weight tensor. Concatenation of R[iofc] and RB[iofc] (if bidirectional) along dimension 0. This tensor has shape [num_directions, hidden_size, 4*hidden_size].

  • B (optional, heterogeneous) - T: The bias tensor for input gate. Concatenation of [Wb[iofc], Rb[iofc]], and [WBb[iofc], RBb[iofc]] (if bidirectional) along dimension 0. This tensor has shape [num_directions, 8*hidden_size]. Optional: If not specified - assumed to be 0.

  • sequence_lens (optional, heterogeneous) - T1: Optional tensor specifying lengths of the sequences in a batch. If not specified - assumed all sequences in the batch to have length seq_length. It has shape [batch_size].

  • initial_h (optional, heterogeneous) - T: Optional initial value of the hidden. If not specified - assumed to be 0. It has shape [num_directions, batch_size, hidden_size].

  • initial_c (optional, heterogeneous) - T: Optional initial value of the cell. If not specified - assumed to be 0. It has shape [num_directions, batch_size, hidden_size].

  • P (optional, heterogeneous) - T: The weight tensor for peepholes. Concatenation of P[iof] and PB[iof] (if bidirectional) along dimension 0. It has shape [num_directions, 3*hidde_size]. Optional: If not specified - assumed to be 0.

  • W_scale (heterogeneous) - T: W’s scale. Its size is [num_directions] for per-tensor/layer quantization, or [num_directions, 4*hidden_size] for per-channel quantization on the axis input_size.

  • W_zero_point (heterogeneous) - T2: W’s zero point. Its size is [num_directions] for per-tensor/layer quantization, or [num_directions, 4*hidden_size] for per-channel quantization on the axis input_size.

  • R_scale (heterogeneous) - T: R’s scale. Its size is [num_directions] for per-tensor/layer quantization, or [num_directions, 4*hidden_size] for per-channel quantization on the axis input_size.

  • R_zero_point (heterogeneous) - T2: R’s zero point. Its size is [num_directions] for per-tensor/layer quantization, or [num_directions, 4*hidden_size] for per-channel quantization on the axis input_size.

Outputs

Between 0 and 3 outputs.

  • Y (optional, heterogeneous) - T: A tensor that concats all the intermediate output values of the hidden. It has shape [seq_length, num_directions, batch_size, hidden_size].

  • Y_h (optional, heterogeneous) - T: The last output value of the hidden. It has shape [num_directions, batch_size, hidden_size].

  • Y_c (optional, heterogeneous) - T: The last output value of the cell. It has shape [num_directions, batch_size, hidden_size].

OnnxComMicrosoftDynamicQuantizeMatMul#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftDynamicQuantizeMatMul(*args, **kwargs)#

Version

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

Inputs

Between 3 and 5 inputs.

  • A (heterogeneous) - T1: N-dimensional matrix A

  • B (heterogeneous) - T2: N-dimensional matrix B

  • b_scale (heterogeneous) - T1: Scale of quantized input ‘B’. It could be a scalar or a 1-D tensor, which means a per-tensor or per-column quantization. If it’s a 1-D tensor, its number of elements should be equal to the number of columns of input ‘B’.

  • b_zero_point (optional, heterogeneous) - T2: Zero point tensor for input ‘B’. It’s optional and default value is 0. It could be a scalar or a 1-D tensor, which means a per-tensor or per-column quantization. If it’s a 1-D tensor, its number of elements should be equal to the number of columns of input ‘B’.

  • bias (optional, heterogeneous) - T1: 1D input tensor, whose dimension is same as B’s last dimension

Outputs

  • Y (heterogeneous) - T1: Matrix multiply results from A * B

OnnxComMicrosoftDynamicQuantizeMatMul_1#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftDynamicQuantizeMatMul_1(*args, **kwargs)#

Version

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

Inputs

Between 3 and 5 inputs.

  • A (heterogeneous) - T1: N-dimensional matrix A

  • B (heterogeneous) - T2: N-dimensional matrix B

  • b_scale (heterogeneous) - T1: Scale of quantized input ‘B’. It could be a scalar or a 1-D tensor, which means a per-tensor or per-column quantization. If it’s a 1-D tensor, its number of elements should be equal to the number of columns of input ‘B’.

  • b_zero_point (optional, heterogeneous) - T2: Zero point tensor for input ‘B’. It’s optional and default value is 0. It could be a scalar or a 1-D tensor, which means a per-tensor or per-column quantization. If it’s a 1-D tensor, its number of elements should be equal to the number of columns of input ‘B’.

  • bias (optional, heterogeneous) - T1: 1D input tensor, whose dimension is same as B’s last dimension

Outputs

  • Y (heterogeneous) - T1: Matrix multiply results from A * B

OnnxComMicrosoftEmbedLayerNormalization#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftEmbedLayerNormalization(*args, **kwargs)#

Version

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

EmbedLayerNormalization is the fusion of embedding layer in BERT model, with optional mask processing. The embedding layer takes input_ids (word IDs) and segment_ids (sentence IDs) to look up word_embedding, position_embedding, and segment_emedding; the embeddings are added then applied layer normalization using gamma and beta tensors. The last input mask is optional. If mask is provided, mask index (that is position of first 0 in mask, or number of words) will be calculated.

Attributes

  • epsilon: The epsilon value to use to avoid division by zero. Default value is ?.

Inputs

Between 7 and 9 inputs.

  • input_ids (heterogeneous) - T1: 2D words IDs with shape (batch_size, sequence_length)

  • segment_ids (optional, heterogeneous) - T1: 2D segment IDs with shape (batch_size, sequence_length)

  • word_embedding (heterogeneous) - T: 2D with shape (,hidden_size)

  • position_embedding (heterogeneous) - T: 2D with shape (, hidden_size)

  • segment_embedding (optional, heterogeneous) - T: 2D with shape (, hidden_size)

  • gamma (heterogeneous) - T: 1D gamma tensor for layer normalization with shape (hidden_size)

  • beta (heterogeneous) - T: 1D beta tensor for layer normalization with shape (hidden_size)

  • mask (optional, heterogeneous) - T1: 2D attention mask with shape (batch_size, sequence_length)

  • position_ids (optional, heterogeneous) - T1: 2D position ids with shape (batch_size, sequence_length)

Outputs

Between 2 and 3 outputs.

  • output (heterogeneous) - T: 3D output tensor with shape (batch_size, sequence_length, hidden_size)

  • mask_index (heterogeneous) - T1: 1D mask_index tensor with shape (batch_size)

  • embedding_sum (optional, heterogeneous) - T: sum of word_embedding and position_embedding without layer normalization

OnnxComMicrosoftEmbedLayerNormalization_1#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftEmbedLayerNormalization_1(*args, **kwargs)#

Version

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

EmbedLayerNormalization is the fusion of embedding layer in BERT model, with optional mask processing. The embedding layer takes input_ids (word IDs) and segment_ids (sentence IDs) to look up word_embedding, position_embedding, and segment_emedding; the embeddings are added then applied layer normalization using gamma and beta tensors. The last input mask is optional. If mask is provided, mask index (that is position of first 0 in mask, or number of words) will be calculated.

Attributes

  • epsilon: The epsilon value to use to avoid division by zero. Default value is ?.

Inputs

Between 7 and 9 inputs.

  • input_ids (heterogeneous) - T1: 2D words IDs with shape (batch_size, sequence_length)

  • segment_ids (optional, heterogeneous) - T1: 2D segment IDs with shape (batch_size, sequence_length)

  • word_embedding (heterogeneous) - T: 2D with shape (,hidden_size)

  • position_embedding (heterogeneous) - T: 2D with shape (, hidden_size)

  • segment_embedding (optional, heterogeneous) - T: 2D with shape (, hidden_size)

  • gamma (heterogeneous) - T: 1D gamma tensor for layer normalization with shape (hidden_size)

  • beta (heterogeneous) - T: 1D beta tensor for layer normalization with shape (hidden_size)

  • mask (optional, heterogeneous) - T1: 2D attention mask with shape (batch_size, sequence_length)

  • position_ids (optional, heterogeneous) - T1: 2D position ids with shape (batch_size, sequence_length)

Outputs

Between 2 and 3 outputs.

  • output (heterogeneous) - T: 3D output tensor with shape (batch_size, sequence_length, hidden_size)

  • mask_index (heterogeneous) - T1: 1D mask_index tensor with shape (batch_size)

  • embedding_sum (optional, heterogeneous) - T: sum of word_embedding and position_embedding without layer normalization

OnnxComMicrosoftExpandDims#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftExpandDims(*args, **kwargs)#

Version

  • name: ExpandDims (GitHub)

  • domain: com.microsoft

  • since_version: 1

  • function:

  • support_level:

  • shape inference:

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

ExpandDims echo operator.

Inputs

  • X (heterogeneous) - T: input

  • axis (heterogeneous) - tensor(int32): Specified axis to insert a dimension

Outputs

  • Y (heterogeneous) - T: output

OnnxComMicrosoftExpandDims_1#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftExpandDims_1(*args, **kwargs)#

Version

  • name: ExpandDims (GitHub)

  • domain: com.microsoft

  • since_version: 1

  • function:

  • support_level:

  • shape inference:

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

ExpandDims echo operator.

Inputs

  • X (heterogeneous) - T: input

  • axis (heterogeneous) - tensor(int32): Specified axis to insert a dimension

Outputs

  • Y (heterogeneous) - T: output

OnnxComMicrosoftFastGelu#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftFastGelu(*args, **kwargs)#

Version

  • name: FastGelu (GitHub)

  • domain: com.microsoft

  • since_version: 1

  • function:

  • support_level:

  • shape inference:

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

GELU (Gaussian Error Linear Unit) approximation: Y=0.5*X*(1+tanh(0.797885*X+0.035677*X*X*X)) with an optional input of bias that will be added to X before GELU.

Inputs

Between 1 and 2 inputs.

  • X (heterogeneous) - T: input tensor

  • bias (optional, heterogeneous) - T: bias tensor

Outputs

  • Y (heterogeneous) - T: output tensor

OnnxComMicrosoftFastGeluGrad#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftFastGeluGrad(*args, **kwargs)#

Version

  • name: FastGeluGrad (GitHub)

  • domain: com.microsoft

  • since_version: 1

  • function:

  • support_level:

  • shape inference:

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

FastGeluGrad

Inputs

  • dY (heterogeneous) - T: The gradient tensor from output.

  • X (heterogeneous) - T: The input tensor.

Outputs

  • dX (heterogeneous) - T: Gradient of the input.

OnnxComMicrosoftFastGeluGrad_1#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftFastGeluGrad_1(*args, **kwargs)#

Version

  • name: FastGeluGrad (GitHub)

  • domain: com.microsoft

  • since_version: 1

  • function:

  • support_level:

  • shape inference:

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

FastGeluGrad

Inputs

  • dY (heterogeneous) - T: The gradient tensor from output.

  • X (heterogeneous) - T: The input tensor.

Outputs

  • dX (heterogeneous) - T: Gradient of the input.

OnnxComMicrosoftFastGelu_1#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftFastGelu_1(*args, **kwargs)#

Version

  • name: FastGelu (GitHub)

  • domain: com.microsoft

  • since_version: 1

  • function:

  • support_level:

  • shape inference:

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

GELU (Gaussian Error Linear Unit) approximation: Y=0.5*X*(1+tanh(0.797885*X+0.035677*X*X*X)) with an optional input of bias that will be added to X before GELU.

Inputs

Between 1 and 2 inputs.

  • X (heterogeneous) - T: input tensor

  • bias (optional, heterogeneous) - T: bias tensor

Outputs

  • Y (heterogeneous) - T: output tensor

OnnxComMicrosoftFusedConv#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftFusedConv(*args, **kwargs)#

Version

  • name: FusedConv (GitHub)

  • domain: com.microsoft

  • since_version: 1

  • function:

  • support_level:

  • shape inference:

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

The fused convolution operator schema is the same as Conv besides it includes an attribute activation.

Attributes

  • activation:

Default value is ?.

  • activation_params:

Default value is ?.

  • auto_pad:

Default value is ?.

  • dilations:

Default value is ?.

  • group:

Default value is ?.

  • kernel_shape:

Default value is ?.

  • pads:

Default value is ?.

  • strides:

Default value is ?.

Inputs

Between 2 and 4 inputs.

  • X (heterogeneous) - T:

  • W (heterogeneous) - T:

  • B (optional, heterogeneous) - T:

  • Z (optional, heterogeneous) - T:

Outputs

  • Y (heterogeneous) - T:

OnnxComMicrosoftFusedConv_1#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftFusedConv_1(*args, **kwargs)#

Version

  • name: FusedConv (GitHub)

  • domain: com.microsoft

  • since_version: 1

  • function:

  • support_level:

  • shape inference:

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

The fused convolution operator schema is the same as Conv besides it includes an attribute activation.

Attributes

  • activation:

Default value is ?.

  • activation_params:

Default value is ?.

  • auto_pad:

Default value is ?.

  • dilations:

Default value is ?.

  • group:

Default value is ?.

  • kernel_shape:

Default value is ?.

  • pads:

Default value is ?.

  • strides:

Default value is ?.

Inputs

Between 2 and 4 inputs.

  • X (heterogeneous) - T:

  • W (heterogeneous) - T:

  • B (optional, heterogeneous) - T:

  • Z (optional, heterogeneous) - T:

Outputs

  • Y (heterogeneous) - T:

OnnxComMicrosoftFusedGemm#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftFusedGemm(*args, **kwargs)#

Version

  • name: FusedGemm (GitHub)

  • domain: com.microsoft

  • since_version: 1

  • function:

  • support_level:

  • shape inference:

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

The FusedGemm operator schema is the same as Gemm besides it includes attributes activation and leaky_relu_alpha.

Attributes

  • activation:

Default value is ?.

  • activation_alpha:

Default value is ?.

  • activation_beta:

Default value is ?.

  • activation_gamma:

Default value is ?.

  • alpha: Scalar multiplier for the product of input tensors A * B. Default value is ?.

  • beta: Scalar multiplier for input tensor C. Default value is ?.

  • transA: Whether A should be transposed Default value is ?.

  • transB: Whether B should be transposed Default value is ?.

Inputs

  • A (heterogeneous) - T: Input tensor A. The shape of A should be (M, K) if transA is 0, or (K, M) if transA is non-zero.

  • B (heterogeneous) - T: Input tensor B. The shape of B should be (K, N) if transB is 0, or (N, K) if transB is non-zero.

  • C (heterogeneous) - T: Input tensor C. The shape of C should be unidirectional broadcastable to (M, N).

Outputs

  • Y (heterogeneous) - T: Output tensor of shape (M, N).

OnnxComMicrosoftFusedGemm_1#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftFusedGemm_1(*args, **kwargs)#

Version

  • name: FusedGemm (GitHub)

  • domain: com.microsoft

  • since_version: 1

  • function:

  • support_level:

  • shape inference:

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

The FusedGemm operator schema is the same as Gemm besides it includes attributes activation and leaky_relu_alpha.

Attributes

  • activation:

Default value is ?.

  • activation_alpha:

Default value is ?.

  • activation_beta:

Default value is ?.

  • activation_gamma:

Default value is ?.

  • alpha: Scalar multiplier for the product of input tensors A * B. Default value is ?.

  • beta: Scalar multiplier for input tensor C. Default value is ?.

  • transA: Whether A should be transposed Default value is ?.

  • transB: Whether B should be transposed Default value is ?.

Inputs

  • A (heterogeneous) - T: Input tensor A. The shape of A should be (M, K) if transA is 0, or (K, M) if transA is non-zero.

  • B (heterogeneous) - T: Input tensor B. The shape of B should be (K, N) if transB is 0, or (N, K) if transB is non-zero.

  • C (heterogeneous) - T: Input tensor C. The shape of C should be unidirectional broadcastable to (M, N).

Outputs

  • Y (heterogeneous) - T: Output tensor of shape (M, N).

OnnxComMicrosoftFusedMatMul#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftFusedMatMul(*args, **kwargs)#

Version

  • name: FusedMatMul (GitHub)

  • domain: com.microsoft

  • since_version: 1

  • function:

  • support_level:

  • shape inference:

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

Matrix product that behaves like numpy.matmul: https://docs.scipy.org/doc/numpy-1.13.0/reference/generated/numpy.matmul.html

Attributes

  • alpha: Scalar multiplier for the product of the input tensors. Default value is ?.

  • transA: Whether A should be transposed on the last two dimensions before doing multiplication Default value is ?.

  • transB: Whether B should be transposed on the last two dimensions before doing multiplication Default value is ?.

  • transBatchA: Whether A should be transposed on the 1st dimension and batch dimensions (dim-1 to dim-rank-2) before doing multiplication Default value is ?.

  • transBatchB: Whether B should be transposed on the 1st dimension and batch dimensions (dim-1 to dim-rank-2) before doing multiplication Default value is ?.

Inputs

  • A (heterogeneous) - T: N-dimensional matrix A

  • B (heterogeneous) - T: N-dimensional matrix B

Outputs

  • Y (heterogeneous) - T: Matrix multiply results

OnnxComMicrosoftFusedMatMul_1#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftFusedMatMul_1(*args, **kwargs)#

Version

  • name: FusedMatMul (GitHub)

  • domain: com.microsoft

  • since_version: 1

  • function:

  • support_level:

  • shape inference:

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

Matrix product that behaves like numpy.matmul: https://docs.scipy.org/doc/numpy-1.13.0/reference/generated/numpy.matmul.html

Attributes

  • alpha: Scalar multiplier for the product of the input tensors. Default value is ?.

  • transA: Whether A should be transposed on the last two dimensions before doing multiplication Default value is ?.

  • transB: Whether B should be transposed on the last two dimensions before doing multiplication Default value is ?.

  • transBatchA: Whether A should be transposed on the 1st dimension and batch dimensions (dim-1 to dim-rank-2) before doing multiplication Default value is ?.

  • transBatchB: Whether B should be transposed on the 1st dimension and batch dimensions (dim-1 to dim-rank-2) before doing multiplication Default value is ?.

Inputs

  • A (heterogeneous) - T: N-dimensional matrix A

  • B (heterogeneous) - T: N-dimensional matrix B

Outputs

  • Y (heterogeneous) - T: Matrix multiply results

OnnxComMicrosoftGatherElementsGrad#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftGatherElementsGrad(*args, **kwargs)#

Version

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

GatherElementsGrad

Attributes

  • axis: Which axis to scatter on. Negative value means counting dimensions from the back. Accepted range is [-r, r-1] where r = rank(data). Default value is ?.

Inputs

  • dY (heterogeneous) - T: Tensor of rank r >=1 (same rank and shape as indices)

  • shape (heterogeneous) - I: Shape of the GatherElements input data.

  • indices (heterogeneous) - Tind: Tensor of int32/int64 indices, of r >= 1 (same rank as input). All index values are expected to be within bounds [-s, s-1] along axis of size s. It is an error if any of the index values are out of bounds.

Outputs

  • dX (heterogeneous) - T: Tensor of rank r >= 1 (same rank as input).

OnnxComMicrosoftGatherElementsGrad_1#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftGatherElementsGrad_1(*args, **kwargs)#

Version

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

GatherElementsGrad

Attributes

  • axis: Which axis to scatter on. Negative value means counting dimensions from the back. Accepted range is [-r, r-1] where r = rank(data). Default value is ?.

Inputs

  • dY (heterogeneous) - T: Tensor of rank r >=1 (same rank and shape as indices)

  • shape (heterogeneous) - I: Shape of the GatherElements input data.

  • indices (heterogeneous) - Tind: Tensor of int32/int64 indices, of r >= 1 (same rank as input). All index values are expected to be within bounds [-s, s-1] along axis of size s. It is an error if any of the index values are out of bounds.

Outputs

  • dX (heterogeneous) - T: Tensor of rank r >= 1 (same rank as input).

OnnxComMicrosoftGatherGrad#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftGatherGrad(*args, **kwargs)#

Version

  • name: GatherGrad (GitHub)

  • domain: com.microsoft

  • since_version: 1

  • function:

  • support_level:

  • shape inference:

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

Attributes

  • axis: Which axis to gather on. Negative value means counting dimensions from the back. Accepted range in [-r, r-1] Default value is ?.

Inputs

  • shape (heterogeneous) - I: Shape of the Gather input X.

  • indices (heterogeneous) - Tind: Tensor of int32/int64 indices, of any rank q.

  • dY (heterogeneous) - T: Gradient of output

Outputs

  • dX (heterogeneous) - T: Gradient of input

OnnxComMicrosoftGatherGrad_1#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftGatherGrad_1(*args, **kwargs)#

Version

  • name: GatherGrad (GitHub)

  • domain: com.microsoft

  • since_version: 1

  • function:

  • support_level:

  • shape inference:

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

Attributes

  • axis: Which axis to gather on. Negative value means counting dimensions from the back. Accepted range in [-r, r-1] Default value is ?.

Inputs

  • shape (heterogeneous) - I: Shape of the Gather input X.

  • indices (heterogeneous) - Tind: Tensor of int32/int64 indices, of any rank q.

  • dY (heterogeneous) - T: Gradient of output

Outputs

  • dX (heterogeneous) - T: Gradient of input

OnnxComMicrosoftGatherND#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftGatherND(*args, **kwargs)#

Version

  • name: GatherND (GitHub)

  • domain: com.microsoft

  • since_version: 1

  • function:

  • support_level:

  • shape inference:

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

Given data tensor of rank r >= 1, and indices tensor of rank q >= 1, gather slices of data into an output tensor of rank q - 1 + r - indices[-1]. Example 1:

data = [[0,1],[2,3]] indices = [[0,0],[1,1]] output = [0,3]

Example 2:

data = [[0,1],[2,3]] indices = [[1],[0]] output = [[2,3],[0,1]]

Example 3:

data = [[[0,1],[2,3]],[[4,5],[6,7]]] indices = [[0,1],[1,0]] output = [[2,3],[4,5]]

Example 4:

data = [[[0,1],[2,3]],[[4,5],[6,7]]] indices = [[[0,1]],[[1,0]]] output = [[[2,3]],[[4,5]]]

Inputs

  • data (heterogeneous) - T: Tensor of rank r >= 1.

  • indices (heterogeneous) - Tind: Tensor of rank q >= 1.

Outputs

  • output (heterogeneous) - T: Tensor of rank q-1+r-indices[-1].

OnnxComMicrosoftGatherNDGrad#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftGatherNDGrad(*args, **kwargs)#

Version

  • name: GatherNDGrad (GitHub)

  • domain: com.microsoft

  • since_version: 1

  • function:

  • support_level:

  • shape inference:

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

Attributes

  • batch_dims: The number of batch dims. The gather of indexing starts from dimension of data[batch_dims+1:] Default value is ?.

Inputs

  • shape (heterogeneous) - T1: The shape of source data input of GatherND.

  • indices (heterogeneous) - Tind: Tensor of rank q >= 1.

  • update (heterogeneous) - T: The gradient of the output.

Outputs

  • output (heterogeneous) - T: Tensor graident of the input.

OnnxComMicrosoftGatherNDGrad_1#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftGatherNDGrad_1(*args, **kwargs)#

Version

  • name: GatherNDGrad (GitHub)

  • domain: com.microsoft

  • since_version: 1

  • function:

  • support_level:

  • shape inference:

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

Attributes

  • batch_dims: The number of batch dims. The gather of indexing starts from dimension of data[batch_dims+1:] Default value is ?.

Inputs

  • shape (heterogeneous) - T1: The shape of source data input of GatherND.

  • indices (heterogeneous) - Tind: Tensor of rank q >= 1.

  • update (heterogeneous) - T: The gradient of the output.

Outputs

  • output (heterogeneous) - T: Tensor graident of the input.

OnnxComMicrosoftGatherND_1#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftGatherND_1(*args, **kwargs)#

Version

  • name: GatherND (GitHub)

  • domain: com.microsoft

  • since_version: 1

  • function:

  • support_level:

  • shape inference:

This version of the operator has been available since version 1 of domain com.microsoft.

Summary

Given data tensor of rank r >= 1, and indices tensor of rank q >= 1, gather slices of data into an output tensor of rank q - 1 + r - indices[-1]. Example 1:

data = [[0,1],[2,3]] indices = [[0,0],[1,1]] output = [0,3]

Example 2:

data = [[0,1],[2,3]] indices = [[1],[0]] output = [[2,3],[0,1]]

Example 3:

data = [[[0,1],[2,3]],[[4,5],[6,7]]] indices = [[0,1],[1,0]] output = [[2,3],[4,5]]

Example 4:

data = [[[0,1],[2,3]],[[4,5],[6,7]]] indices = [[[0,1]],[[1,0]]] output = [[[2,3]],[[4,5]]]

Inputs

  • data (heterogeneous) - T: Tensor of rank r >= 1.

  • indices (heterogeneous) - Tind: Tensor of rank q >= 1.

Outputs

  • output (heterogeneous) - T: Tensor of rank q-1+r-indices[-1].

OnnxComMicrosoftGelu#

class mlprodict.npy.xop_auto_import_.OnnxComMicrosoftGelu(*args, **kwargs)#

Version