@Properties(inherit=tensorflowlite.class) public class TfLiteTensor extends Pointer
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
Constructor and Description |
---|
TfLiteTensor()
Default native constructor.
|
TfLiteTensor(long size)
Native array allocator.
|
TfLiteTensor(Pointer p)
Pointer cast constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
allocation_type()
How memory is mapped
kTfLiteMmapRo: Memory mapped read only.
|
TfLiteTensor |
allocation_type(int setter) |
Pointer |
allocation()
An opaque pointer to a tflite::MMapAllocation
|
TfLiteTensor |
allocation(Pointer setter) |
int |
buffer_handle()
An integer buffer handle that can be handled by
delegate . |
TfLiteTensor |
buffer_handle(int setter) |
long |
bytes()
The number of bytes required to store the data of this Tensor.
|
TfLiteTensor |
bytes(long setter) |
boolean |
data_is_stale()
If the delegate uses its own buffer (e.g.
|
TfLiteTensor |
data_is_stale(boolean setter) |
TfLitePtrUnion |
data()
A union of data pointers.
|
TfLiteTensor |
data(TfLitePtrUnion setter) |
TfLiteDelegate |
delegate()
The delegate which knows how to handle
buffer_handle . |
TfLiteTensor |
delegate(TfLiteDelegate setter) |
TfLiteIntArray |
dims_signature()
Optional.
|
TfLiteTensor |
dims_signature(TfLiteIntArray setter) |
TfLiteIntArray |
dims()
A pointer to a structure representing the dimensionality interpretation
that the buffer should have.
|
TfLiteTensor |
dims(TfLiteIntArray setter) |
TfLiteTensor |
getPointer(long i) |
boolean |
is_variable()
True if the tensor is a variable.
|
TfLiteTensor |
is_variable(boolean setter) |
BytePointer |
name()
Null-terminated name of this tensor.
|
TfLiteTensor |
name(BytePointer setter) |
TfLiteQuantizationParams |
params()
Quantization information.
|
TfLiteTensor |
params(TfLiteQuantizationParams setter) |
TfLiteTensor |
position(long position) |
TfLiteQuantization |
quantization()
Quantization information.
|
TfLiteTensor |
quantization(TfLiteQuantization setter) |
TfLiteSparsity |
sparsity()
Parameters used to encode a sparse tensor.
|
TfLiteTensor |
sparsity(TfLiteSparsity setter) |
int |
type()
The data type specification for data stored in
data . |
TfLiteTensor |
type(int setter) |
address, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, getDirectBufferAddress, getPointer, getPointer, getPointer, hashCode, interruptDeallocatorThread, isNull, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetAddress, offsetof, offsetof, parseBytes, physicalBytes, physicalBytesInaccurate, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, sizeof, sizeof, toString, totalBytes, totalCount, totalPhysicalBytes, withDeallocator, zero
public TfLiteTensor()
public TfLiteTensor(long size)
Pointer.position(long)
.public TfLiteTensor(Pointer p)
Pointer(Pointer)
.public TfLiteTensor position(long position)
public TfLiteTensor getPointer(long i)
getPointer
in class Pointer
@Cast(value="TfLiteType") public int type()
data
. This affects
what member of data
union should be used.public TfLiteTensor type(int setter)
@ByRef public TfLitePtrUnion data()
type
.public TfLiteTensor data(TfLitePtrUnion setter)
public TfLiteIntArray dims()
dims
and the element datatype size should be equal to bytes
below.public TfLiteTensor dims(TfLiteIntArray setter)
@ByRef public TfLiteQuantizationParams params()
public TfLiteTensor params(TfLiteQuantizationParams setter)
@Cast(value="TfLiteAllocationType") public int allocation_type()
public TfLiteTensor allocation_type(int setter)
@Cast(value="size_t") public long bytes()
public TfLiteTensor bytes(long setter)
public TfLiteTensor allocation(Pointer setter)
@Cast(value="const char*") public BytePointer name()
public TfLiteTensor name(BytePointer setter)
public TfLiteDelegate delegate()
buffer_handle
.
WARNING: This is an experimental interface that is subject to change.public TfLiteTensor delegate(TfLiteDelegate setter)
@Cast(value="TfLiteBufferHandle") public int buffer_handle()
delegate
.
The value is valid only when delegate is not null.
WARNING: This is an experimental interface that is subject to change.public TfLiteTensor buffer_handle(int setter)
@Cast(value="bool") public boolean data_is_stale()
delegate->CopyFromBufferHandle
can be called to copy the data from
delegate buffer.
WARNING: This is an experimental interface that is subject to change.public TfLiteTensor data_is_stale(boolean setter)
public TfLiteTensor is_variable(boolean setter)
@ByRef public TfLiteQuantization quantization()
public TfLiteTensor quantization(TfLiteQuantization setter)
public TfLiteSparsity sparsity()
public TfLiteTensor sparsity(TfLiteSparsity setter)
@Const public TfLiteIntArray dims_signature()
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.public TfLiteTensor dims_signature(TfLiteIntArray setter)
Copyright © 2025. All rights reserved.