#[repr(C)]pub struct TfLiteTensor {Show 15 fields
pub type_: TfLiteType,
pub data: TfLitePtrUnion,
pub dims: *mut TfLiteIntArray,
pub params: TfLiteQuantizationParams,
pub allocation_type: TfLiteAllocationType,
pub bytes: usize,
pub allocation: *const c_void,
pub name: *const c_char,
pub delegate: *mut TfLiteDelegate,
pub buffer_handle: TfLiteBufferHandle,
pub data_is_stale: bool,
pub is_variable: bool,
pub quantization: TfLiteQuantization,
pub sparsity: *mut TfLiteSparsity,
pub dims_signature: *const TfLiteIntArray,
}Fields§
§type_: TfLiteTypeThe data type specification for data stored in data. This affects
what member of data union should be used.
data: TfLitePtrUnionA union of data pointers. The appropriate type should be used for a typed
tensor based on type.
dims: *mut TfLiteIntArrayA 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.
params: TfLiteQuantizationParamsQuantization information.
allocation_type: TfLiteAllocationTypeHow memory is mapped kTfLiteMmapRo: Memory mapped read only. i.e. weights kTfLiteArenaRw: Arena allocated read write memory (i.e. temporaries, outputs).
bytes: usizeThe 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.
allocation: *const c_voidAn opaque pointer to a tflite::MMapAllocation
name: *const c_charNull-terminated name of this tensor.
delegate: *mut TfLiteDelegateThe delegate which knows how to handle buffer_handle.
WARNING: This is an experimental interface that is subject to change.
buffer_handle: TfLiteBufferHandleAn integer buffer handle that can be handled by delegate.
The value is valid only when delegate is not null.
WARNING: This is an experimental interface that is subject to change.
data_is_stale: boolIf the delegate uses its own buffer (e.g. GPU memory), the delegate is
responsible to set data_is_stale to true.
delegate->CopyFromBufferHandle can be called to copy the data from
delegate buffer.
WARNING: This is an experimental interface that is subject to change.
is_variable: boolTrue if the tensor is a variable.
quantization: TfLiteQuantizationQuantization information. Replaces params field above.
sparsity: *mut TfLiteSparsityParameters used to encode a sparse tensor. This is optional. The field is NULL if a tensor is dense.
WARNING: This is an experimental interface that is subject to change.
dims_signature: *const TfLiteIntArrayOptional. Encodes shapes with unknown dimensions with -1. This field is
only populated when unknown dimensions exist in a read-write tensor (i.e.
an input or output tensor). (e.g. dims contains [1, 1, 1, 3] and
dims_signature contains [1, -1, -1, 3]). If no unknown dimensions exist
then dims_signature is either null, or set to an empty array. Note that
this field only exists when TF_LITE_STATIC_MEMORY is not defined.
Trait Implementations§
Source§impl Clone for TfLiteTensor
impl Clone for TfLiteTensor
Source§fn clone(&self) -> TfLiteTensor
fn clone(&self) -> TfLiteTensor
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more