module onnxrt.ops_cpu.op_expand#

Inheritance diagram of mlprodict.onnxrt.ops_cpu.op_expand

Short summary#

module mlprodict.onnxrt.ops_cpu.op_expand

Runtime operator.

source on GitHub

Classes#

class

truncated documentation

CommonExpand

Expand_13

Expand ====== Broadcast the input tensor following the given shape and the broadcast rule. The broadcast rule is similar …

Expand_13

Expand ====== Broadcast the input tensor following the given shape and the broadcast rule. The broadcast rule is similar …

Functions#

function

truncated documentation

common_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_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_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.

Methods#

method

truncated documentation

__init__

__init__

__init__

_infer_shapes

_infer_shapes

_infer_shapes

_infer_sizes

_infer_sizes

_infer_sizes

_infer_types

_infer_types

_infer_types

_run

_run

_run

Documentation#

Runtime operator.

source on GitHub

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

Bases: mlprodict.onnxrt.ops_cpu._op.OpRun

Parameters
  • onnx_nodeonnx node

  • desc – internal representation

  • expected_attributes – expected attributes for this node

  • options – runtime options

source on GitHub

__init__(onnx_node, desc=None, expected_attributes=None, **options)#
Parameters
  • onnx_nodeonnx node

  • desc – internal representation

  • expected_attributes – expected attributes for this node

  • options – runtime options

source on GitHub

_infer_shapes(data, shape)#

Should be overwritten.

source on GitHub

_infer_sizes(*args, **kwargs)#

Should be overwritten.

source on GitHub

_infer_types(data, shape)#

Should be overwritten.

source on GitHub

_run(data, shape)#

Should be overwritten.

source on GitHub

mlprodict.onnxrt.ops_cpu.op_expand.Expand#

alias of mlprodict.onnxrt.ops_cpu.op_expand.Expand_13

class mlprodict.onnxrt.ops_cpu.op_expand.Expand_13(onnx_node, desc=None, **options)#

Bases: mlprodict.onnxrt.ops_cpu.op_expand.CommonExpand

Broadcast the input tensor following the given shape and the broadcast rule. The broadcast rule is similar to numpy.array(input) * numpy.ones(shape): Dimensions are right alignment; Two corresponding dimension must have the same value, or one of them is equal to 1. Also, this operator is similar to numpy.broadcast_to(input, shape), but the major difference is numpy.broadcast_to() does not allow shape to be smaller than input.size(). It is possible that the output.shape is not equal to shape, when some dimensions in shape is equal to 1, or the shape.ndim < input.shape.ndim.

Inputs

  • input (heterogeneous)T: Input tensor

  • shape (heterogeneous)tensor(int64): A 1-D tensor indicates the shape you want to expand to, following the broadcast rule

Outputs

  • output (heterogeneous)T: Output tensor

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 tensors.

Version

Onnx name: Expand

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

Runtime implementation: Expand

Parameters
  • onnx_nodeonnx node

  • desc – internal representation

  • expected_attributes – expected attributes for this node

  • options – runtime options

source on GitHub

__init__(onnx_node, desc=None, **options)#
Parameters
  • onnx_nodeonnx node

  • desc – internal representation

  • expected_attributes – expected attributes for this node

  • options – runtime options

source on GitHub