Custom Op - Channels Last

Channels Last Custom Ops

qonnx.custom_op.channels_last.base_wrapped_op

class qonnx.custom_op.channels_last.base_wrapped_op.ChannelsLastWrappedOp(onnx_node: NodeProto, onnx_opset_version: int = 1)

Bases: CustomOp

execute_node(context, graph)

Execute this CustomOp instance, given the execution context and ONNX graph.

infer_node_datatype(model)

Set the DataType annotations corresponding to the outputs of this node.

verify_node()

Verifies that all attributes the node needs are there and that particular attributes are set correctly. Also checks if the number of inputs is equal to the expected number.

qonnx.custom_op.channels_last.base_wrapped_op.to_channels_first_args(ndim)

Returns the tuple of parameters to transpose a channels last tensor to a channels first one. :param ndim: Number of dimensions of the tensor to be transposed.

qonnx.custom_op.channels_last.base_wrapped_op.to_channels_last_args(ndim)

Returns the tuple of parameters to transpose a channels first tensor to a channels last one. :param ndim: Number of dimensions of the tensor to be transposed.

qonnx.custom_op.channels_last.batch_normalization

class qonnx.custom_op.channels_last.batch_normalization.BatchNormalization_v1(onnx_node: NodeProto, onnx_opset_version: int = 1)

Bases: ChannelsLastWrappedOp

get_nodeattr_types()

Returns a dict of permitted attributes for node, where: ret_dict[attribute_name] = (dtype, require, default_value, <allowed_values>) - dtype indicates which member of the ONNX AttributeProto will be utilized - require indicates whether this attribute is required - default_val indicates the default value that will be used if the attribute is not set - <allowed_values> (if specified) indicates that this attribute can only be set to one of the values in the set <allowed_values>. If not specified, all values permitted by dtype are allowed.

make_shape_compatible_op(model)

Returns a standard ONNX op which is compatible with this CustomOp for performing shape inference.

verify_node()

Verifies that all attributes the node needs are there and that particular attributes are set correctly. Also checks if the number of inputs is equal to the expected number.

class qonnx.custom_op.channels_last.batch_normalization.BatchNormalization_v14(onnx_node: NodeProto, onnx_opset_version: int = 1)

Bases: BatchNormalization_v9

class qonnx.custom_op.channels_last.batch_normalization.BatchNormalization_v9(onnx_node: NodeProto, onnx_opset_version: int = 1)

Bases: BatchNormalization_v1

qonnx.custom_op.channels_last.conv

class qonnx.custom_op.channels_last.conv.Conv_v1(onnx_node: NodeProto, onnx_opset_version: int = 1)

Bases: ChannelsLastWrappedOp

get_nodeattr_types()

Returns a dict of permitted attributes for node, where: ret_dict[attribute_name] = (dtype, require, default_value, <allowed_values>) - dtype indicates which member of the ONNX AttributeProto will be utilized - require indicates whether this attribute is required - default_val indicates the default value that will be used if the attribute is not set - <allowed_values> (if specified) indicates that this attribute can only be set to one of the values in the set <allowed_values>. If not specified, all values permitted by dtype are allowed.

make_shape_compatible_op(model)

Returns a standard ONNX op which is compatible with this CustomOp for performing shape inference.

verify_node()

Verifies that all attributes the node needs are there and that particular attributes are set correctly. Also checks if the number of inputs is equal to the expected number.

qonnx.custom_op.channels_last.max_pool

class qonnx.custom_op.channels_last.max_pool.MaxPool_v1(onnx_node: NodeProto, onnx_opset_version: int = 1)

Bases: ChannelsLastWrappedOp

get_nodeattr_types()

Returns a dict of permitted attributes for node, where: ret_dict[attribute_name] = (dtype, require, default_value, <allowed_values>) - dtype indicates which member of the ONNX AttributeProto will be utilized - require indicates whether this attribute is required - default_val indicates the default value that will be used if the attribute is not set - <allowed_values> (if specified) indicates that this attribute can only be set to one of the values in the set <allowed_values>. If not specified, all values permitted by dtype are allowed.

make_shape_compatible_op(model)

Returns a standard ONNX op which is compatible with this CustomOp for performing shape inference.

verify_node()

Verifies that all attributes the node needs are there and that particular attributes are set correctly. Also checks if the number of inputs is equal to the expected number.

class qonnx.custom_op.channels_last.max_pool.MaxPool_v10(onnx_node: NodeProto, onnx_opset_version: int = 1)

Bases: MaxPool_v1