op_types

Utility functions to categorize onnx ops.

Functions

is_binary_op

Returns whether the given op is a binary operator or not.

is_control_flow_op

Returns whether the given op type is of Control Flow category or not.

is_conversion_op

Returns whether the given op type is of Conversion category or not.

is_copy_op

Returns whether the given op is a copy operator or not.

is_default_quantizable_op_by_ort

Returns if ORT quantizes the op type by default.

is_fusible_reduction_op

Returns whether the given op type is of reduction category and fusible by the compiler.

is_generator_op

Returns whether the given op type is of Generator category or not.

is_irregular_mem_access_op

Returns whether the given op type is of Irreggular mem access category or not.

is_linear_op

Returns whether the given op type is of Linear category or not.

is_modifier_op

Returns whether the given op type is of Modifier category or not.

is_multiclass_op

Returns whether the given op type is of Multiclass category or not.

is_non_reshape_copy_op

Returns whether the given op is a non-reshape copy op or not.

is_normalization_op

Returns whether the given op type is of Normalization category or not.

is_pointwise_or_elementwise_op

Returns whether the given op type is of Pointwise or Elementwise category or not.

is_pooling_or_window_op

Returns whether the given op type is of Pooling/Window category or not.

is_recurrent_op

Returns whether the given op type is of Recurrent category or not.

is_selection_op

Returns whether the given op type is of Selection category or not.

is_sequence_op

Returns whether the given op type is of Sequence category or not.

is_shape_op

Returns whether the given op type is of Shape category or not.

is_unary_op

Returns whether the given op is a unary operator or not.

is_binary_op(op_type)

Returns whether the given op is a binary operator or not.

Parameters:

op_type (str) –

is_control_flow_op(op_type)

Returns whether the given op type is of Control Flow category or not.

Parameters:

op_type (str) –

is_conversion_op(op_type)

Returns whether the given op type is of Conversion category or not.

Parameters:

op_type (str) –

is_copy_op(op_type)

Returns whether the given op is a copy operator or not.

Parameters:

op_type (str) –

is_default_quantizable_op_by_ort(op_type)

Returns if ORT quantizes the op type by default.

Note. Subject to change with different ORT versions. Note. Users can use nodes_to_quantize and/or op_types_to_quantize arguments to quantize non-default operations. Reference: https://github.com/microsoft/onnxruntime/blob/main/onnxruntime/python/tools/quantization/registry.py

Parameters:

op_type (str) –

is_fusible_reduction_op(op_type)

Returns whether the given op type is of reduction category and fusible by the compiler.

Parameters:

op_type (str) –

is_generator_op(op_type)

Returns whether the given op type is of Generator category or not.

Parameters:

op_type (str) –

is_irregular_mem_access_op(op_type)

Returns whether the given op type is of Irreggular mem access category or not.

Parameters:

op_type (str) –

is_linear_op(op_type)

Returns whether the given op type is of Linear category or not.

Parameters:

op_type (str) –

is_modifier_op(op_type)

Returns whether the given op type is of Modifier category or not.

Parameters:

op_type (str) –

is_multiclass_op(op_type)

Returns whether the given op type is of Multiclass category or not.

Parameters:

op_type (str) –

is_non_reshape_copy_op(op_type)

Returns whether the given op is a non-reshape copy op or not.

Parameters:

op_type (str) –

is_normalization_op(op_type)

Returns whether the given op type is of Normalization category or not.

Parameters:

op_type (str) –

is_pointwise_or_elementwise_op(op_type)

Returns whether the given op type is of Pointwise or Elementwise category or not.

This considers only the fusible types.

Parameters:

op_type (str) –

is_pooling_or_window_op(op_type)

Returns whether the given op type is of Pooling/Window category or not.

Parameters:

op_type (str) –

is_recurrent_op(op_type)

Returns whether the given op type is of Recurrent category or not.

Parameters:

op_type (str) –

is_selection_op(op_type)

Returns whether the given op type is of Selection category or not.

Parameters:

op_type (str) –

is_sequence_op(op_type)

Returns whether the given op type is of Sequence category or not.

Parameters:

op_type (str) –

is_shape_op(op_type)

Returns whether the given op type is of Shape category or not.

Parameters:

op_type (str) –

is_unary_op(op_type)

Returns whether the given op is a unary operator or not.

Parameters:

op_type (str) –