module onnxrt.ops_cpu.op_trilu#

Inheritance diagram of mlprodict.onnxrt.ops_cpu.op_trilu

Short summary#

module mlprodict.onnxrt.ops_cpu.op_trilu

Runtime operator.

source on GitHub

Classes#

class

truncated documentation

Trilu

Trilu ===== Given a 2-D matrix or batches of 2-D matrices, returns the upper or lower triangular part of the tensor(s). …

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_trilu.Trilu(onnx_node, desc=None, **options)#

Bases: OpRun

Given a 2-D matrix or batches of 2-D matrices, returns the upper or lower triangular part of the tensor(s). The attribute “upper” determines whether the upper or lower part is retained. If set to true, the upper triangular matrix is retained. Lower triangular matrix is retained otherwise. Default value for the “upper” attribute is true. Trilu takes one input tensor of shape [*, N, M], where * is zero or more batch dimensions. The upper triangular part consists of the elements on and above the given diagonal (k). The lower triangular part consists of elements on and below the diagonal. All other elements in the matrix are set to zero. If k = 0, the triangular part on and above/below the main diagonal is retained. If upper is set to true, a positive k retains the upper triangular matrix excluding the main diagonal and (k-1) diagonals above it. A negative k value retains the main diagonal and |k| diagonals below it. If upper is set to false, a positive k retains the lower triangular matrix including the main diagonal and k diagonals above it. A negative k value excludes the main diagonal and (|k|-1) diagonals below it.

Attributes

  • upper: Boolean. Indicates whether upper or lower part of matrix is retained. Default is true. Default value is nameupperi1typeINT (INT)

Inputs

Between 1 and 2 inputs.

  • input (heterogeneous)T: Input tensor of rank 2 or higher.

  • k (optional, heterogeneous)tensor(int64): A 0-D tensor containing a single value corresponding to the number diagonals above or below the main diagonal to exclude or include. Default value is 0 if it’s not specified.

Outputs

  • output (heterogeneous)T: Output tensor of the same type and shape as the input 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 tensor types.

Version

Onnx name: Trilu

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

Runtime implementation: Trilu

__init__(onnx_node, desc=None, **options)#
_run(*inputs, 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