@Properties(inherit=tvm_runtime.class) public class DLTensor extends Pointer
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter| Constructor and Description |
|---|
DLTensor()
Default native constructor.
|
DLTensor(long size)
Native array allocator.
|
DLTensor(Pointer p)
Pointer cast constructor.
|
| Modifier and Type | Method and Description |
|---|---|
long |
byte_offset()
\brief The offset in bytes to the beginning pointer to data
|
DLTensor |
byte_offset(long setter) |
DLContext |
ctx()
\brief The device context of the tensor
|
DLTensor |
ctx(DLContext setter) |
Pointer |
data()
\brief The opaque data pointer points to the allocated data.
|
DLTensor |
data(Pointer setter) |
DLDataType |
dtype()
\brief The data type of the pointer
|
DLTensor |
dtype(DLDataType setter) |
DLTensor |
getPointer(long i) |
int |
ndim()
\brief Number of dimensions
|
DLTensor |
ndim(int setter) |
DLTensor |
position(long position) |
LongPointer |
shape()
\brief The shape of the tensor
|
DLTensor |
shape(LongPointer setter) |
LongPointer |
strides()
\brief strides of the tensor (in number of elements, not bytes)
can be NULL, indicating tensor is compact and row-majored.
|
DLTensor |
strides(LongPointer setter) |
address, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, getPointer, getPointer, getPointer, hashCode, isNull, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetAddress, offsetof, offsetof, parseBytes, physicalBytes, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, sizeof, sizeof, toString, totalBytes, totalCount, totalPhysicalBytes, withDeallocator, zeropublic DLTensor()
public DLTensor(long size)
Pointer.position(long).public DLTensor(Pointer p)
Pointer(Pointer).public DLTensor getPointer(long i)
getPointer in class Pointerpublic Pointer data()
{.c}
static inline size_t GetDataSize(const DLTensor* t) {
size_t size = 1;
for (tvm_index_t i = 0; i < t->ndim; ++i) {
size *= t->shape[i];
}
size *= (t->dtype.bits * t->dtype.lanes + 7) / 8;
return size;
}
public int ndim()
public DLTensor ndim(int setter)
@ByRef public DLDataType dtype()
public DLTensor dtype(DLDataType setter)
@Cast(value="int64_t*") public LongPointer shape()
public DLTensor shape(LongPointer setter)
@Cast(value="int64_t*") public LongPointer strides()
public DLTensor strides(LongPointer setter)
@Cast(value="uint64_t") public long byte_offset()
public DLTensor byte_offset(long setter)
Copyright © 2021. All rights reserved.