module onnxrt.ops_cpu.op_constant_of_shape#

Inheritance diagram of mlprodict.onnxrt.ops_cpu.op_constant_of_shape

Short summary#

module mlprodict.onnxrt.ops_cpu.op_constant_of_shape

Runtime operator.

source on GitHub

Classes#

class

truncated documentation

ConstantOfShape

ConstantOfShape =============== Generate a tensor with given value and shape. Attributes

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_modified

Returns the list of modified parameters.

args_mandatory

Returns the list of optional arguments.

args_optional

Returns the list of optional arguments.

atts_value

Returns all parameters in a dictionary.

Methods#

method

truncated documentation

__init__

_run

to_python

Documentation#

Runtime operator.

source on GitHub

class mlprodict.onnxrt.ops_cpu.op_constant_of_shape.ConstantOfShape(onnx_node, desc=None, **options)#

Bases: OpRun

Generate a tensor with given value and shape.

Attributes

  • value: (Optional) The value of the output elements.Should be a one-element tensor. If not specified, it defaults to a tensor of value 0 and datatype float32 default value cannot be automatically retrieved (TENSOR)

Inputs

  • input (heterogeneous)T1: 1D tensor. The shape of the expected output tensor. If empty tensor is given, the output would be a scalar. All values must be >= 0.

Outputs

  • output (heterogeneous)T2: Output tensor of shape specified by ‘input’.If attribute ‘value’ is specified, the value and datatype of the output tensor is taken from ‘value’.If attribute ‘value’ is not specified, the value in the output defaults to 0, and the datatype defaults to float32.

Type Constraints

  • T1 tensor(int64): Constrain input types.

  • T2 tensor(float16), tensor(float), tensor(double), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(bool): Constrain output types to be numerics.

Version

Onnx name: ConstantOfShape

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

Runtime implementation: ConstantOfShape

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

Should be overwritten.

source on GitHub

to_python(inputs)#

Returns a python code equivalent to this operator.

Parameters:

inputs – inputs name

Returns:

imports, python code, both as strings

source on GitHub