Class TensorsData
Definition
- Assembly:
- Tizen.MachineLearning.Inference.dll
The TensorsData class sets and gets the buffer data for each Tensor.
C#Copypublic class TensorsData : IDisposable
- Inheritance
-
objectTensorsData
- Implements
-
System.IDisposable
Properties
Declaration
C#Copypublic int Count { get; }
Property Value
| Type | Description |
|---|---|
| int |
Exceptions
| Type | Condition |
|---|---|
| System.NotSupportedException | Thrown when the feature is not supported. |
Declaration
C#Copypublic TensorsInfo TensorsInfo { get; }
Property Value
| Type | Description |
|---|---|
| TensorsInfo | The TensorsInfo instance |
Exceptions
| Type | Condition |
|---|---|
| System.NotSupportedException | Thrown when the feature is not supported. |
Methods
Allocate(TensorsInfo)
Allocates a new TensorsData instance with the given tensors information.
Declaration
C#Copypublic static TensorsData Allocate(TensorsInfo info)
Parameters
| Type | Name | Description |
|---|---|---|
| TensorsInfo | info | TensorsInfo object which has Tensor information |
Returns
| Type | Description |
|---|---|
| TensorsData | The TensorsInfo instance |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | Thrown when the method failed due to an invalid parameter. |
| System.NotSupportedException | Thrown when the feature is not supported. |
Declaration
C#Copypublic void Dispose()
Dispose(bool)
Releases any unmanaged resources used by this object. Can also dispose any other disposable objects.
Declaration
C#Copyprotected virtual void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | disposing | If true, disposes any disposable objects. If false, does not dispose disposable objects. |
Declaration
C#Copyprotected ~TensorsData()
Declaration
C#Copypublic byte[] GetTensorData(int index)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | The index of the tensor. |
Returns
| Type | Description |
|---|---|
| byte[] | Raw tensor data |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | Thrown when the method failed due to an invalid parameter. |
| System.NotSupportedException | Thrown when the feature is not supported. |
Declaration
C#Copypublic void SetTensorData(int index, byte[] buffer)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | The index of the tensor. |
| byte[] | buffer | Raw tensor data to be set. |
Exceptions
| Type | Condition |
|---|---|
| System.NotSupportedException | Thrown when the feature is not supported. |
| System.ArgumentException | Thrown when the data is not valid. |