constants
torch_to_nnef.nemo_tract.constants
Constants and small helpers for NeMo Tract wrappers.
This module centralizes shared string constants and tiny predicates used across wrappers to keep the main logic files focused.
axis_kind_to_symbol
Return a normalized symbol for an axis kind using full names.
Newer Tract versions accept multi-letter symbols, so prefer clear names (e.g., BATCH, TIME, STREAM) instead of single letters.
make_axis_symbol
Produce a readable, namespaced axis symbol.
- Batch axis: namespaced as
INPUT{SEP}BATCH(per-input), not a globalBATCH; whereSEPisNEMO_INPUT_SYMBOL_SEPARATOR. - Known kinds (e.g., TIME, STREAM, LENGTH): use full kind name and
namespace by input (e.g.,
AUDIO_SIGNAL{SEP}TIME) to avoid accidental cross-input collisions. - Unknown kinds: fall back to a generic numbered dim also namespaced by
input (e.g.,
AUDIO_SIGNAL__DIM0).