TfLiteTensor
C++A tensor in the interpreter system which is a wrapper around a buffer of data including a dimensionality (or NULL if not currently defined).
struct TfLiteTensorA tensor in the interpreter system which is a wrapper around a buffer of data including a dimensionality (or NULL if not currently defined). NOTE: This flag is opt-in only at compile time.
Specific reduced TfLiteTensor struct for TF Micro runtime. This struct contains only the minimum fields required to initialize and prepare a micro inference graph. The fields in this struct have been ordered from largest-to-smallest for optimal struct sizeof.
This struct does not use:
- allocation
- buffer_handle
- data_is_stale
- delegate
- dims_signature
- name
- sparsity
quantization
C++TODO(b/155784997): Consider consolidating these quantization fields: Quantization information.
TfLiteQuantization quantizationTODO(b/155784997): Consider consolidating these quantization fields: Quantization information. Replaces params field above.
params
C++Quantization information.
TfLiteQuantizationParams paramsQuantization information.
data
C++A union of data pointers.
TfLitePtrUnion dataA union of data pointers. The appropriate type should be used for a typed tensor based on type.
dims
C++A pointer to a structure representing the dimensionality interpretation that the buffer should have.
TfLiteIntArray * dimsA pointer to a structure representing the dimensionality interpretation that the buffer should have. NOTE: the product of elements of dims and the element datatype size should be equal to bytes below.
bytes
C++The number of bytes required to store the data of this Tensor.
size_t bytesThe number of bytes required to store the data of this Tensor. I.e. (bytes of each element) * dims[0] * … * dims[n-1]. For example, if type is kTfLiteFloat32 and dims = {3, 2} then bytes = sizeof(float) * 3 * 2 = 4 * 3 * 2 = 24.
type
C++The data type specification for data stored in data.
TfLiteType typeThe data type specification for data stored in data. This affects what member of data union should be used.
How memory is mapped kTfLiteMmapRo: Memory mapped read only.
TfLiteAllocationType allocation_typeHow memory is mapped kTfLiteMmapRo: Memory mapped read only. i.e. weights kTfLiteArenaRw: Arena allocated read write memory (i.e. temporaries, outputs).
is_variable
C++True if the tensor is a variable.
bool is_variableTrue if the tensor is a variable.