ONE - On-device Neural Engine
|
Decribe how to build a matrix from a tensor. More...
#include <MatrixCodec.h>
Public Member Functions | |
virtual | ~MatrixEncoder ()=default |
virtual MatrixShape | shape (const TensorShape &shape) const =0 |
virtual TensorIndex | value (const MatrixIndex &index) const =0 |
Decribe how to build a matrix from a tensor.
Let us assume that "enc" is a matrix encoder.
Given a tensor "inp" and its shape "inp.shape", "enc" builds a matrix "out" as follows:
for each valid matrix index (referred to as matrix_idx below) for enc.shape(inp.shape) out.at(matrix_index) = inp.at(enc.value(matrix_index))
Definition at line 42 of file MatrixCodec.h.
|
virtualdefault |
|
pure virtual |
|
pure virtual |
Implemented in loco::PermutingEncoder< Domain::Matrix >.