concat
torch_to_nnef.op.aten.concat
dstack
Map PyTorch: 'aten:dstack' to NNEF (concat(axis=2)).
dstack stacks tensors along the third axis (depth). Torch
promotes 1-D / 2-D inputs to 3-D before reaching the aten op, so
we only see rank>=3 inputs here.
hstack
Map PyTorch: 'aten:hstack' to NNEF (concat(axis=1)).
roll
Map PyTorch: 'aten:roll' to NNEF.
PyTorch normalizes shifts modulo the dim size; tract does not, and
the slice/concat decomposition we emit produces an empty slice for
shift=0 or |shift|>=dim_size, which tract misorders into a
doubled-shape output. We reproduce PyTorch's normalization here:
- Drop any (shift, dim) pair where the normalized shift is 0 (no-op).
- Replace each remaining shift with
shift % dim_sizeso the slice indices stay in(0, dim_size).
If every pair normalizes away, the entire op is a graph identity. we remap the output node to the input.