onnx_light.onnx.helper#

Functions

get_attribute_value(attr)

Returns the attribute value whatever the type is.

make_attribute(key, value[, doc_string, ...])

Makes an AttributeProto based on the value type.

make_attribute_ref(name, attr_type[, doc_string])

Makes an AttributeProto holding a reference to the parent " function's attribute of given name and type.

make_empty_tensor_value_info(name)

Creates an empty tensor value info.

make_function(domain, fname, inputs, ...[, ...])

Constructs a FunctionProto.

make_graph(nodes, name, inputs, outputs[, ...])

Constructs a GraphProto

make_map(name, key_type, keys, values)

Make a Map with specified key-value pair arguments.

make_map_type_proto(key_type, value_type)

Makes a map TypeProto.

make_model(graph[, ir_version, ...])

Constructs a ModelProto

make_node(op_type, inputs, outputs[, name, ...])

Constructs a NodeProto.

make_operatorsetid(domain, version)

Construct an OperatorSetIdProto.

make_opsetid(domain, version)

Constructs an OperatorSetIdProto.

make_optional(name, elem_type, value)

Make an Optional with specified value arguments.

make_optional_type_proto(inner_type_proto)

Makes an optional TypeProto.

make_sequence(name, elem_type, values)

Make a Sequence with specified value arguments.

make_sequence_type_proto(inner_type_proto)

Makes a sequence TypeProto.

make_sparse_tensor(values, indices, dims)

Construct a SparseTensorProto

make_sparse_tensor_type_proto(elem_type, shape)

Makes a SparseTensor TypeProto based on the data type and shape.

make_sparse_tensor_value_info(name, ...[, ...])

Makes a SparseTensor ValueInfoProto based on the data type and shape.

make_tensor(name, data_type, dims, vals[, raw])

Makes a TensorProto with specified arguments.

make_tensor_sequence_value_info(name, ...[, ...])

Makes a Sequence[Tensors] ValueInfoProto based on the data type and shape.

make_tensor_type_proto(elem_type, shape[, ...])

Makes a Tensor TypeProto based on the data type and shape.

make_tensor_value_info(name, elem_type, shape)

Makes a ValueInfoProto based on the data type and shape.

make_value_info(name, type_proto[, doc_string])

Makes a ValueInfoProto with the given type_proto.

set_metadata_props(proto, dict_value)

Sets metadata_props.

set_model_props(model, dict_value)

Sets metadata_props.

tensor_dtype_to_field(tensor_dtype)

Converts a TensorProto's data_type to corresponding field name for storage.

tensor_dtype_to_np_dtype(tensor_dtype)

Converts a TensorProto's data_type to corresponding numpy dtype.

Classes

TensorDtypeMap(np_dtype, storage_dtype, name)