module onnxrt.ops_cpu.op_reshape#

Inheritance diagram of mlprodict.onnxrt.ops_cpu.op_reshape

Short summary#

module mlprodict.onnxrt.ops_cpu.op_reshape

Runtime operator.

source on GitHub

Classes#

class

truncated documentation

CommonReshape

Reshape_13

Reshape_14

Reshape ======= Reshape the input tensor similar to numpy.reshape. First input is the data tensor, second input is a shape …

Reshape_14

Reshape ======= Reshape the input tensor similar to numpy.reshape. First input is the data tensor, second input is a shape …

Reshape_5

Functions#

function

truncated documentation

reshape_reference_implementation

Properties#

property

truncated documentation

args_default

Returns the list of arguments as well as the list of parameters with the default values (close to the signature). …

args_default

Returns the list of arguments as well as the list of parameters with the default values (close to the signature). …

args_default

Returns the list of arguments as well as the list of parameters with the default values (close to the signature). …

args_default

Returns the list of arguments as well as the list of parameters with the default values (close to the signature). …

args_default

Returns the list of arguments as well as the list of parameters with the default values (close to the signature). …

args_default_modified

Returns the list of modified parameters.

args_default_modified

Returns the list of modified parameters.

args_default_modified

Returns the list of modified parameters.

args_default_modified

Returns the list of modified parameters.

args_default_modified

Returns the list of modified parameters.

args_mandatory

Returns the list of optional arguments.

args_mandatory

Returns the list of optional arguments.

args_mandatory

Returns the list of optional arguments.

args_mandatory

Returns the list of optional arguments.

args_mandatory

Returns the list of optional arguments.

args_optional

Returns the list of optional arguments.

args_optional

Returns the list of optional arguments.

args_optional

Returns the list of optional arguments.

args_optional

Returns the list of optional arguments.

args_optional

Returns the list of optional arguments.

atts_value

Returns all parameters in a dictionary.

atts_value

Returns all parameters in a dictionary.

atts_value

Returns all parameters in a dictionary.

atts_value

Returns all parameters in a dictionary.

atts_value

Returns all parameters in a dictionary.

Methods#

method

truncated documentation

__init__

__init__

__init__

__init__

__init__

_run

_run

_run

_run

_run

Documentation#

Runtime operator.

source on GitHub

class mlprodict.onnxrt.ops_cpu.op_reshape.CommonReshape(onnx_node, desc=None, expected_attributes=None, **options)#

Bases: OpRun

__init__(onnx_node, desc=None, expected_attributes=None, **options)#
_run(data, shape, attributes=None, verbose=0, fLOG=None)#

Should be overwritten.

source on GitHub

mlprodict.onnxrt.ops_cpu.op_reshape.Reshape#

alias of Reshape_14

class mlprodict.onnxrt.ops_cpu.op_reshape.Reshape_13(onnx_node, desc=None, expected_attributes=None, **options)#

Bases: Reshape_5

class mlprodict.onnxrt.ops_cpu.op_reshape.Reshape_14(onnx_node, desc=None, **options)#

Bases: CommonReshape

Reshape#

Reshape the input tensor similar to numpy.reshape. First input is the data tensor, second input is a shape tensor which specifies the output shape. It outputs the reshaped tensor. At most one dimension of the new shape can be -1. In this case, the value is inferred from the size of the tensor and the remaining dimensions. A dimension could also be 0, in which case the actual dimension value is unchanged (i.e. taken from the input tensor). If ‘allowzero’ is set, and the new shape includes 0, the dimension will be set explicitly to zero (i.e. not taken from input tensor). Shape (second input) could be an empty shape, which means converting to a scalar. The input tensor’s shape and the output tensor’s shape are required to have the same number of elements.

If the attribute ‘allowzero’ is set, it is invalid for the specified shape to contain both a zero value and -1, as the value of the dimension corresponding to -1 cannot be determined uniquely.

Attributes

  • allowzero: (Optional) By default, when any value in the ‘shape’ input is equal to zero the corresponding dimension value is copied from the input tensor dynamically. allowzero=1 indicates that if any value in the ‘shape’ input is set to zero, the zero value is honored, similar to NumPy. Default value is nameallowzeroi0typeINT (INT)

Inputs

  • data (heterogeneous)T: An input tensor.

  • shape (heterogeneous)tensor(int64): Specified shape for output.

Outputs

  • reshaped (heterogeneous)T: Reshaped data.

Type Constraints

  • T tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(string), tensor(bool), tensor(complex64), tensor(complex128): Constrain input and output types to all tensor types.

Version

Onnx name: Reshape

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

Runtime implementation: Reshape

__init__(onnx_node, desc=None, **options)#
class mlprodict.onnxrt.ops_cpu.op_reshape.Reshape_5(onnx_node, desc=None, expected_attributes=None, **options)#

Bases: CommonReshape

__init__(onnx_node, desc=None, expected_attributes=None, **options)#