Movatterモバイル変換


[0]ホーム

URL:


ContentsMenuExpandLight modeDark modeAuto light/dark, in light modeAuto light/dark, in dark modeSkip to content
onnx-array-api 0.3.1 documentation
Logo
onnx-array-api 0.3.1 documentation

Contents

More

Back to top

npx.npx_numpy_tensors

EagerNumpyTensor

classonnx_array_api.npx.npx_numpy_tensors.EagerNumpyTensor(tensor:ndarray)[source]

Defines a value for a specific backend.

JitNumpyTensor

classonnx_array_api.npx.npx_numpy_tensors.JitNumpyTensor(tensor:ndarray)[source]

Defines a value for a specific backend.

NumpyTensor

classonnx_array_api.npx.npx_numpy_tensors.NumpyTensor(tensor:ndarray)[source]

Default backend based ononnx_array_api.reference.ExtendedReferenceEvaluator().

Parameters:
  • input_names – input names

  • onx – onnx model

classEvaluator(tensor_class:type,input_names:List[str],onx:ModelProto,f:Callable)[source]

Wraps classonnx_array_api.reference.ExtendedReferenceEvaluatorto have a signature closer to python function.

Parameters:
  • tensor_class – class tensor such asNumpyTensor

  • input_names – input names

  • onx – onnx model

  • f – unused except in error messages

run(*inputs:List[NumpyTensor])List[NumpyTensor][source]

Executes the function.

Parameters:

inputs – function inputs

Returns:

outputs

classmethodcreate_function(input_names:List[str],onx:ModelProto,f:Callable)Callable[source]

Creates a python function calling the onnx backendused by this class.

Parameters:

onx – onnx model

Returns:

python function

propertydims

Returns the dimensions of the tensor.First dimension is the batch dimension if the tensorhas more than one dimension. It is always left undefined.

propertydtype:DType

Returns the element type of this tensor.

classmethodget_ir_version(ir_version)[source]

Updates the IR version.This method should be overloaded.By default, it returns ir_version.

classmethodget_opsets(opsets)[source]

Updates the opsets for a given backend.This method should be overloaded.By default, it returns opsets.

propertykey:Any

Unique key for a tensor of the same type.

propertyndim

Returns the number of dimensions (rank).

numpy()[source]

Returns the array converted into a numpy array.

propertyshape:Tuple[int,...]

Returns the shape of the tensor.

propertytensor_type:TensorType

Returns the tensor type of this tensor.

tensor_type_dims(name:str)TensorType[source]

Returns the tensor type of this tensor.This property is used to define a key used to cache a jitted function.Same keys keys means same ONNX graph.Different keys usually means same ONNX graph but differentinput shapes.

Parameters:

name – name of the constraint

propertyvalue:ndarray

Returns the value of this tensor as a numpy array.

On this page

[8]ページ先頭

©2009-2025 Movatter.jp