onnx.mapping#
This module defines the correspondance between onnx numerical types and numpy numerical types. This information can be accessed through attribute TENSOR_TYPE_MAP or through the functions defined in onnx.helper.
TensorDtypeMap#
- class onnx.mapping.TensorDtypeMap(np_dtype, storage_dtype, name)#
TENSOR_TYPE_MAP#
import pprint
from onnx.mapping import TENSOR_TYPE_MAP
pprint.pprint(TENSOR_TYPE_MAP)
{1: TensorDtypeMap(np_dtype=dtype('float32'), storage_dtype=1, name='TensorProto.FLOAT'),
2: TensorDtypeMap(np_dtype=dtype('uint8'), storage_dtype=6, name='TensorProto.UINT8'),
3: TensorDtypeMap(np_dtype=dtype('int8'), storage_dtype=6, name='TensorProto.INT8'),
4: TensorDtypeMap(np_dtype=dtype('uint16'), storage_dtype=6, name='TensorProto.UINT16'),
5: TensorDtypeMap(np_dtype=dtype('int16'), storage_dtype=6, name='TensorProto.INT16'),
6: TensorDtypeMap(np_dtype=dtype('int32'), storage_dtype=6, name='TensorProto.INT32'),
7: TensorDtypeMap(np_dtype=dtype('int64'), storage_dtype=7, name='TensorProto.INT64'),
8: TensorDtypeMap(np_dtype=dtype('O'), storage_dtype=8, name='TensorProto.STRING'),
9: TensorDtypeMap(np_dtype=dtype('bool'), storage_dtype=6, name='TensorProto.BOOL'),
10: TensorDtypeMap(np_dtype=dtype('float16'), storage_dtype=4, name='TensorProto.FLOAT16'),
11: TensorDtypeMap(np_dtype=dtype('float64'), storage_dtype=11, name='TensorProto.DOUBLE'),
12: TensorDtypeMap(np_dtype=dtype('uint32'), storage_dtype=12, name='TensorProto.UINT32'),
13: TensorDtypeMap(np_dtype=dtype('uint64'), storage_dtype=13, name='TensorProto.UINT64'),
14: TensorDtypeMap(np_dtype=dtype('complex64'), storage_dtype=1, name='TensorProto.COMPLEX64'),
15: TensorDtypeMap(np_dtype=dtype('complex128'), storage_dtype=11, name='TensorProto.COMPLEX128'),
16: TensorDtypeMap(np_dtype=dtype('float32'), storage_dtype=4, name='TensorProto.BFLOAT16')}
Opset Version#
- onnx.defs.get_all_schemas_with_history() List[onnx.onnx_cpp2py_export.defs.OpSchema] #
Return the schema of all existing operators and all versions.
Operators and Functions Schemas#
- onnx.defs.get_schema(*args, **kwargs)#
Overloaded function.
get_schema(op_type: str, max_inclusive_version: int, domain: str = ‘’) -> onnx.onnx_cpp2py_export.defs.OpSchema
Return the schema of the operator op_type and for a specific version.
get_schema(op_type: str, domain: str = ‘’) -> onnx.onnx_cpp2py_export.defs.OpSchema
Return the schema of the operator op_type and for a specific version.
Internal module#
Schema submodule
- class onnx.onnx_cpp2py_export.defs.OpSchema#
Schema of an operator.
- class AttrType#
Members:
FLOAT
INT
STRING
TENSOR
GRAPH
FLOATS
INTS
STRINGS
TENSORS
GRAPHS
SPARSE_TENSOR
SPARSE_TENSORS
TYPE_PROTO
TYPE_PROTOS
- property name#
- get_context_dependent_function(self: onnx.onnx_cpp2py_export.defs.OpSchema, arg0: bytes, arg1: List[bytes]) bytes #
- exception onnx.onnx_cpp2py_export.defs.SchemaError#
- onnx.onnx_cpp2py_export.defs.get_all_schemas() List[onnx.onnx_cpp2py_export.defs.OpSchema] #
Return the schema of all existing operators for the latest version.
- onnx.onnx_cpp2py_export.defs.get_all_schemas_with_history() List[onnx.onnx_cpp2py_export.defs.OpSchema] #
Return the schema of all existing operators and all versions.
- onnx.onnx_cpp2py_export.defs.get_schema(*args, **kwargs)#
Overloaded function.
get_schema(op_type: str, max_inclusive_version: int, domain: str = ‘’) -> onnx.onnx_cpp2py_export.defs.OpSchema
Return the schema of the operator op_type and for a specific version.
get_schema(op_type: str, domain: str = ‘’) -> onnx.onnx_cpp2py_export.defs.OpSchema
Return the schema of the operator op_type and for a specific version.