module onnxrt.ops_shape.shape_result
#
Short summary#
module mlprodict.onnxrt.ops_shape.shape_result
Class ShapeResult
Classes#
class |
truncated documentation |
---|---|
Describes a result type. |
|
One constraint. |
|
A list of ShapeConstraint. |
|
Contains information about shape and type of a result in an onnx graph. |
Static Methods#
staticmethod |
truncated documentation |
---|---|
Broadcasts dimensions for an element wise operator. |
Methods#
method |
truncated documentation |
---|---|
usual |
|
Tells if two shapes are identical. |
|
usual |
|
Usual |
|
Appends a new constraint to the list. |
|
Makes a copy of the object. |
|
Copies the object. |
|
Returns a copy for the result. |
|
Tells if this shape is compatible with the given tuple. |
|
Merges this constraint with cst into this one. |
|
Merges constraints from other_results into self. |
|
Returns the number of dimensions if it is a tensor. Raises an exception otherwise. |
|
Results variables in a shape using values stored in variables. It does not copy any constraints. |
Documentation#
Class ShapeResult
- class mlprodict.onnxrt.ops_shape.shape_result.OnnxKind(value)#
Bases:
enum.Enum
Describes a result type.
- class mlprodict.onnxrt.ops_shape.shape_result.ShapeConstraint(name, values)#
Bases:
object
One constraint.
- Parameters
name – variable name
values – set of possible values
- __eq__(other)#
usual
- __hash__ = None#
- __init__(name, values)#
- __repr__()#
usual
- copy(deep=False)#
Makes a copy of the object.
- merge(cst)#
Merges this constraint with cst into this one.
- class mlprodict.onnxrt.ops_shape.shape_result.ShapeConstraintList#
Bases:
object
A list of ShapeConstraint.
- __contains__(cst)#
- __init__()#
- __iter__()#
- __len__()#
- __repr__()#
Return repr(self).
- append(cst)#
Appends a new constraint to the list.
- copy(deep=False)#
Copies the object.
- 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
- __eq__(shape)#
Tells if two shapes are identical.
- __hash__ = None#
- __init__(name, shape=None, dtype=None, sparse=False, mtype=OnnxKind.Tensor, constraints=None)#
- __repr__()#
Usual
- 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
- copy(deep=False)#
Returns a copy for the result.
- is_compatible(shape)#
Tells if this shape is compatible with the given tuple.
- Parameters
shape – tuple
- Returns
boolean
- merge(other_result)#
Merges constraints from other_results into self.
- n_dims()#
Returns the number of dimensions if it is a tensor. Raises an exception otherwise.
- 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