Specifications#

Type Mappings#

NP_TYPE_TO_TENSOR_TYPE#

<<<

import pprint
from onnx.mapping import NP_TYPE_TO_TENSOR_TYPE

pprint.pprint(NP_TYPE_TO_TENSOR_TYPE)

>>>

    {dtype('bool'): 9,
     dtype('uint8'): 2,
     dtype('int8'): 3,
     dtype('uint16'): 4,
     dtype('int16'): 5,
     dtype('float32'): 1,
     dtype('int32'): 6,
     dtype('int64'): 7,
     dtype('float16'): 10,
     dtype('uint32'): 12,
     dtype('uint64'): 13,
     dtype('float64'): 11,
     dtype('complex64'): 14,
     dtype('complex128'): 15,
     dtype('O'): 8}

OP_SET_ID_VERSION_MAP#

<<<

import pprint
from onnx.helper import OP_SET_ID_VERSION_MAP

pprint.pprint(OP_SET_ID_VERSION_MAP)

>>>

    {('ai.onnx', 1): 3,
     ('ai.onnx', 5): 3,
     ('ai.onnx', 6): 3,
     ('ai.onnx', 7): 3,
     ('ai.onnx', 8): 3,
     ('ai.onnx', 9): 4,
     ('ai.onnx', 10): 5,
     ('ai.onnx', 11): 6,
     ('ai.onnx', 12): 7,
     ('ai.onnx', 13): 7,
     ('ai.onnx', 14): 7,
     ('ai.onnx', 15): 8,
     ('ai.onnx', 16): 8,
     ('ai.onnx', 17): 8,
     ('ai.onnx.ml', 1): 3,
     ('ai.onnx.ml', 2): 6,
     ('ai.onnx.ml', 3): 8,
     ('ai.onnx.preview.training', 1): 7,
     ('ai.onnx.training', 1): 7}

OPTIONAL_ELEMENT_TYPE_TO_FIELD#

<<<

import pprint
from onnx.mapping import OPTIONAL_ELEMENT_TYPE_TO_FIELD

pprint.pprint(OPTIONAL_ELEMENT_TYPE_TO_FIELD)

>>>

    {1: 'tensor_value',
     2: 'sparse_tensor_value',
     3: 'sequence_value',
     4: 'map_value',
     5: 'optional_value'}

STORAGE_ELEMENT_TYPE_TO_FIELD#

<<<

import pprint
from onnx.mapping import STORAGE_ELEMENT_TYPE_TO_FIELD

pprint.pprint(STORAGE_ELEMENT_TYPE_TO_FIELD)

>>>

    {1: 'tensor_values',
     2: 'sparse_tensor_values',
     3: 'sequence_values',
     4: 'map_values',
     5: 'optional_value'}

STORAGE_TENSOR_TYPE_TO_FIELD#

<<<

import pprint
from onnx.mapping import STORAGE_TENSOR_TYPE_TO_FIELD

pprint.pprint(STORAGE_TENSOR_TYPE_TO_FIELD)

>>>

    {1: 'float_data',
     4: 'int32_data',
     6: 'int32_data',
     7: 'int64_data',
     8: 'string_data',
     9: 'int32_data',
     11: 'double_data',
     12: 'uint64_data',
     13: 'uint64_data',
     14: 'float_data',
     15: 'double_data'}

TENSOR_TYPE_TO_NP_TYPE#

<<<

import pprint
from onnx.mapping import TENSOR_TYPE_TO_NP_TYPE

pprint.pprint(TENSOR_TYPE_TO_NP_TYPE)

>>>

    {1: dtype('float32'),
     2: dtype('uint8'),
     3: dtype('int8'),
     4: dtype('uint16'),
     5: dtype('int16'),
     6: dtype('int32'),
     7: dtype('int64'),
     8: dtype('O'),
     9: dtype('bool'),
     10: dtype('float16'),
     11: dtype('float64'),
     12: dtype('uint32'),
     13: dtype('uint64'),
     14: dtype('complex64'),
     15: dtype('complex128'),
     16: dtype('float32')}

TENSOR_TYPE_TO_STORAGE_TENSOR_TYPE#

<<<

import pprint
from onnx.mapping import TENSOR_TYPE_TO_STORAGE_TENSOR_TYPE

pprint.pprint(TENSOR_TYPE_TO_STORAGE_TENSOR_TYPE)

>>>

    {1: 1,
     2: 6,
     3: 6,
     4: 6,
     5: 6,
     6: 6,
     7: 7,
     8: 8,
     9: 6,
     10: 4,
     11: 11,
     12: 12,
     13: 13,
     14: 1,
     15: 11,
     16: 4}

Opset Version#

onnx.defs.onnx_opset_version() int#
onnx.defs.get_all_schemas_with_history() List[onnx.onnx_cpp2py_export.defs.OpSchema]#

Operators and Functions Schemas#

onnx.defs.get_function_ops() List[OpSchema]#
onnx.defs.get_schema(*args, **kwargs)#

Overloaded function.

  1. get_schema(op_type: str, max_inclusive_version: int, domain: str = ‘’) -> onnx.onnx_cpp2py_export.defs.OpSchema

  2. get_schema(op_type: str, domain: str = ‘’) -> onnx.onnx_cpp2py_export.defs.OpSchema

Internal module#

Schema submodule

exception onnx.onnx_cpp2py_export.defs.SchemaError#
onnx.onnx_cpp2py_export.defs.get_all_schemas() List[onnx.onnx_cpp2py_export.defs.OpSchema]#
onnx.onnx_cpp2py_export.defs.get_all_schemas_with_history() List[onnx.onnx_cpp2py_export.defs.OpSchema]#
onnx.onnx_cpp2py_export.defs.get_schema(*args, **kwargs)#

Overloaded function.

  1. get_schema(op_type: str, max_inclusive_version: int, domain: str = ‘’) -> onnx.onnx_cpp2py_export.defs.OpSchema

  2. get_schema(op_type: str, domain: str = ‘’) -> onnx.onnx_cpp2py_export.defs.OpSchema

onnx.onnx_cpp2py_export.defs.has_schema(op_type: str, domain: str = '') bool#
onnx.onnx_cpp2py_export.defs.schema_version_map() Dict[str, Tuple[int, int]]#