An apparatus for encoding two or more tensors, the apparatus comprising at least one processor, memory including computer program code, the memory and the computer program code configured to, with the at least one processor, cause the apparatus to perform at least the following:
- processing the two or more tensors having respective dimensions so that the dimensions of said two or more tensors have the same number;
- identifying which axis of each individual tensor is swappable to result in concatenable tensors around an axis of concatenation;
- reshaping the tensors so that the dimensions are modified based on the swapped axis;
- concatenating the tensors around the axis of concatenation to result in a concatenated tensor;
- compressing the concatenated tensor;
- generating syntax structures for carrying concatenation and axis swapping information;
- and
- generating a bitstream by combining the syntax structures and the compressed concatenated tensor.