module onnxrt.ops_shape.shape_result#

Inheritance diagram of mlprodict.onnxrt.ops_shape.shape_result

Short summary#

module mlprodict.onnxrt.ops_shape.shape_result

Class ShapeResult

source on GitHub

Classes#

class

truncated documentation

OnnxKind

Describes a result type.

ShapeConstraint

One constraint.

ShapeConstraintList

A list of ShapeConstraint.

ShapeResult

Contains information about shape and type of a result in an onnx graph.

Static Methods#

staticmethod

truncated documentation

broadcast

Broadcasts dimensions for an element wise operator.

Methods#

method

truncated documentation

__contains__

__eq__

usual

__eq__

Tells if two shapes are identical.

__init__

__init__

__init__

__iter__

__len__

__repr__

usual

__repr__

__repr__

Usual

append

Appends a new constraint to the list.

copy

Makes a copy of the object.

copy

Copies the object.

copy

Returns a copy for the result.

is_compatible

Tells if this shape is compatible with the given tuple.

merge

Merges this constraint with cst into this one.

merge

Merges constraints from other_results into self.

n_dims

Returns the number of dimensions if it is a tensor. Raises an exception otherwise.

resolve

Results variables in a shape using values stored in variables. It does not copy any constraints.

Documentation#

Class ShapeResult

source on GitHub

class mlprodict.onnxrt.ops_shape.shape_result.OnnxKind(value)#

Bases: enum.Enum

Describes a result type.

source on GitHub

class mlprodict.onnxrt.ops_shape.shape_result.ShapeConstraint(name, values)#

Bases: object

One constraint.

Parameters
  • name – variable name

  • values – set of possible values

source on GitHub

__eq__(other)#

usual

__hash__ = None#
__init__(name, values)#
__repr__()#

usual

copy(deep=False)#

Makes a copy of the object.

source on GitHub

merge(cst)#

Merges this constraint with cst into this one.

source on GitHub

class mlprodict.onnxrt.ops_shape.shape_result.ShapeConstraintList#

Bases: object

A list of ShapeConstraint.

source on GitHub

__contains__(cst)#
__init__()#
__iter__()#
__len__()#
__repr__()#

Return repr(self).

append(cst)#

Appends a new constraint to the list.

copy(deep=False)#

Copies the object.

source on GitHub

class mlprodict.onnxrt.ops_shape.shape_result.ShapeResult(name, shape=None, dtype=None, sparse=False, mtype=OnnxKind.Tensor, constraints=None)#

Bases: object

Contains information about shape and type of a result in an onnx graph.

Parameters
  • name – result name

  • shape – shape if the result is a tensor

  • dtype – element type if the result is a tensor

  • sparse – is the tensor sparse

  • mtype – kind of the result (see class OnnxKind)

  • constraints – list of constraints applying on variables

source on GitHub

__eq__(shape)#

Tells if two shapes are identical.

source on GitHub

__hash__ = None#
__init__(name, shape=None, dtype=None, sparse=False, mtype=OnnxKind.Tensor, constraints=None)#
__repr__()#

Usual

source on GitHub

static broadcast(sh1, sh2, name=None)#

Broadcasts dimensions for an element wise operator.

Parameters
  • sh1 – ShapeResult

  • sh2 – ShapeResult

  • name – name of the output ShapeResult

Returns

ShapeResult

source on GitHub

copy(deep=False)#

Returns a copy for the result.

source on GitHub

is_compatible(shape)#

Tells if this shape is compatible with the given tuple.

Parameters

shape – tuple

Returns

boolean

source on GitHub

merge(other_result)#

Merges constraints from other_results into self.

source on GitHub

n_dims()#

Returns the number of dimensions if it is a tensor. Raises an exception otherwise.

source on GitHub

resolve(variables)#

Results variables in a shape using values stored in variables. It does not copy any constraints.

Parameters

variables – dictionary { name: values }

Returns

new ShapeResult

source on GitHub