Interface ITensorData
An interface that represents a device-dependent representation of the data in a tensor.
Inherited Members
Namespace: Unity.Sentis
Assembly: Unity.Sentis.dll
Syntax
public interface ITensorData : IDisposable
Properties
backendType
On what backend are the data elements stored.
Declaration
BackendType backendType { get; }
Property Value
Type | Description |
---|---|
BackendType |
maxCapacity
The maximum count of the stored data elements.
Declaration
int maxCapacity { get; }
Property Value
Type | Description |
---|---|
int |
Methods
Clone()
Returns a deep copy of the internal storage.
Declaration
ITensorData Clone()
Returns
Type | Description |
---|---|
ITensorData | Cloned internal storage. |
CompleteAllPendingOperations()
Blocking call to make sure that internal data is correctly written to and available for CPU read back.
Declaration
void CompleteAllPendingOperations()
DownloadAsync<T>(int)
Awaitable contiguous block of data from internal storage.
Declaration
Awaitable<NativeArray<T>> DownloadAsync<T>(int dstCount) where T : unmanaged
Parameters
Type | Name | Description |
---|---|---|
int | dstCount | The number of elements to download. |
Returns
Type | Description |
---|---|
Awaitable<NativeArray<T>> | A awaitable native array of downloaded elements. |
Type Parameters
Name | Description |
---|---|
T | The data type of the elements. |
Download<T>(int)
Returns a contiguous block of data from internal storage.
Declaration
NativeArray<T> Download<T>(int dstCount) where T : unmanaged
Parameters
Type | Name | Description |
---|---|---|
int | dstCount | The number of elements to download. |
Returns
Type | Description |
---|---|
NativeArray<T> | A native array of downloaded elements. |
Type Parameters
Name | Description |
---|---|
T | The data type of the elements. |
IsReadbackRequestDone()
Checks if asynchronous readback request is done.
Declaration
bool IsReadbackRequestDone()
Returns
Type | Description |
---|---|
bool | Whether async readback is successful. |
ReadbackRequest()
Schedules asynchronous readback of the internal data.
Declaration
void ReadbackRequest()
Upload<T>(NativeArray<T>, int)
Uploads a contiguous block of tensor data to internal storage.
Declaration
void Upload<T>(NativeArray<T> data, int srcCount) where T : unmanaged
Parameters
Type | Name | Description |
---|---|---|
NativeArray<T> | data | The data to upload. |
int | srcCount | The number of elements to upload. |
Type Parameters
Name | Description |
---|---|
T | The type of data to upload. |