simple_map.h#

namespace onnx_light

Alias that makes onnx-light headers compatible with code that references ONNX_LIGHT_NAMESPACE (the macro used in the standard onnx package).

Set to ONNX_LIGHT_NAMESPACE so both names resolve to the same namespace.

Symbol-visibility attribute for the public onnx-light C++ API.

Defined as empty because onnx-light does not require explicit __declspec(dllexport) or __attribute__((visibility("default"))) annotations — visibility is controlled at the shared-library level. The macro is provided so that vendored ONNX headers that decorate their declarations with ONNX_API compile without modification.

Namespace alias so that ONNX C++ code (and consumers such as onnxruntime) that refers to the literal onnx namespace — rather than the ONNX_NAMESPACE macro — resolves to the onnx-light namespace. The standard onnx package lives in namespace onnx; onnx-light uses onnx_light (via ONNX_LIGHT_NAMESPACE), so this alias keeps onnx-light a true drop-in. It is only introduced when the onnx-light namespace differs from onnx.

namespace onnx_kernels
struct Map#
#include <simple_map.h>

Map — minimal runtime map used by backend test cases and reference kernel implementations for operators that consume or produce map(K, V) typed graph edges (e.g. CastMap, DictVectorizer, ZipMap).

Companion to :cpp:struct:Sequence: where Sequence carries an ordered list of tensors sharing a common element type, Map carries a key-value mapping represented as two parallel 1-D tensors (one for keys, one for values). This matches the ONNX MapProto semantics (a list of key/value pairs) but uses the lightweight Tensor representation already used by the runtime.

The struct owns its underlying Tensor members: copying or destroying the Map copies or destroys them too.

Public Functions

Map() = default#
inline Map(std::string n, Tensor k, Tensor v)#
inline int64_t size() const noexcept#

Number of entries in the map.

inline bool empty() const noexcept#

true when the map contains no entries.

Public Members

std::string name#

Optional name of the map (input/output name in the test model). May be left empty for intermediate values.

int32_t key_type = 0#

Key data type (e.g. DataType::INT64 or DataType::STRING).

int32_t value_type = 0#

Value data type (e.g. DataType::FLOAT, DataType::STRING).

Tensor keys#

1-D tensor of keys.

Tensor values#

1-D tensor of values (same length as keys).