.xshape._onnx_helper

experimental_experiment.xshape._onnx_helper.element_wise_binary_op_types() Set[str][source]

Returns the list of element-wise operators.

<<<

import pprint
from experimental_experiment.xshape._onnx_helper import (
    element_wise_binary_op_types,
)

pprint.pprint(element_wise_binary_op_types())

>>>

    {'Div', 'Mod', 'Add', 'Sub', 'Mul', 'And', 'Or', 'Xor'}
experimental_experiment.xshape._onnx_helper.element_wise_op_cmp_types() Set[str][source]

Returns the list of element-wise operators doing comparisons.

<<<

import pprint
from experimental_experiment.xshape._onnx_helper import element_wise_op_cmp_types

pprint.pprint(element_wise_op_cmp_types())

>>>

    {'Less', 'LessOrEqual', 'Greater', 'Equal', 'GreaterOrEqual'}
experimental_experiment.xshape._onnx_helper.enumerate_subgraphs(graph: GraphProto) Iterator[GraphProto][source]

Enumerates all inputs from a node including all the hidden inputs from subgraphs.

experimental_experiment.xshape._onnx_helper.overwrite_shape_in_model_proto(model: ModelProto, n_in: int | None = None) ModelProto[source]

Removes inferred shapes. Overwrites input shapes to make them all dynamic. n_in indicates the number of inputs for which the shape must be rewritten.

experimental_experiment.xshape._onnx_helper.str_tensor_proto_type() str[source]

Returns the following string:

<<<

from experimental_experiment.xshape._onnx_helper import str_tensor_proto_type

print(str_tensor_proto_type())

>>>

    0:UNDEFINED, 1:FLOAT, 2:UINT8, 3:INT8, 4:UINT16, 5:INT16, 6:INT32, 7:INT64, 8:STRING, 9:BOOL, 10:FLOAT16, 11:DOUBLE, 12:UINT32, 13:UINT64, 14:COMPLEX64, 15:COMPLEX128, 16:BFLOAT16, 17:FLOAT8E4M3FN, 18:FLOAT8E4M3FNUZ, 19:FLOAT8E5M2, 20:FLOAT8E5M2FNUZ, 21:UINT4, 22:INT4, 23:FLOAT4E2M1, 24:FLOAT8E8M0
experimental_experiment.xshape._onnx_helper.unary_like_op_types() Set[str][source]

Returns the list of unary like operators. They do not change the shape. They may change the type.

<<<

import pprint
from experimental_experiment.xshape._onnx_helper import unary_like_op_types

pprint.pprint(unary_like_op_types())

>>>

    {'Abs',
     'Acos',
     'Acosh',
     'Asin',
     'Asinh',
     'Atan',
     'Atanh',
     'BitShift',
     'Cast',
     'CastLike',
     'Ceil',
     'Celu',
     'Clip',
     'Cos',
     'Cosh',
     'DequantizeLinear',
     'DynamicQuantizeLinear',
     'Elu',
     'Erf',
     'Exp',
     'IsInf',
     'Log',
     'LogSoftmax',
     'Neg',
     'Not',
     'PRelu',
     'QuantizeLinear',
     'Reciprocal',
     'Relu',
     'Round',
     'Selu',
     'Sigmoid',
     'Sign',
     'Sin',
     'Sinh',
     'Softmax',
     'SoftmaxCrossEntropyLoss',
     'Softplus',
     'Softsign',
     'Sqrt',
     'Tan',
     'Tanh',
     'ThresholdRelu'}