Class TensorsData
Definition
- Assembly:
- Tizen.MachineLearning.Inference.dll
The TensorsData class sets and gets the buffer data for each Tensor.
public class TensorsData : IDisposable
- Inheritance
-
objectTensorsData
- Implements
-
System.IDisposable
Properties
View SourceCount
Gets the number of Tensor in TensorsData class
Declaration
public int Count { get; }
Property Value
| Type | Description |
|---|---|
| int |
Exceptions
| Type | Condition |
|---|---|
| System.NotSupportedException | Thrown when the feature is not supported. |
TensorsInfo
Gets the tensors information.
Declaration
public TensorsInfo TensorsInfo { get; }
Property Value
| Type | Description |
|---|---|
| TensorsInfo | The TensorsInfo instance |
Exceptions
| Type | Condition |
|---|---|
| System.NotSupportedException | Thrown when the feature is not supported. |
Methods
View SourceAllocate(TensorsInfo)
Allocates a new TensorsData instance with the given tensors information.
Declaration
public 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. |
Dispose()
Releases any unmanaged resources used by this object.
Declaration
public void Dispose()
Dispose(bool)
Releases any unmanaged resources used by this object. Can also dispose any other disposable objects.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | disposing | If true, disposes any disposable objects. If false, does not dispose disposable objects. |
~TensorsData()
Destructor of the TensorsData instance
Declaration
protected ~TensorsData()
GetTensorData(int)
Gets a tensor data to given index.
Declaration
public 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. |
SetTensorData(int, byte[])
Sets a tensor data to given index.
Declaration
public 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. |