Class TensorsInfo
Definition
- Assembly:
- Tizen.MachineLearning.Inference.dll
The TensorsInfo class manages each Tensor information such as Name, Type and Dimension.
C#Copypublic class TensorsInfo : IDisposable
- Inheritance
-
objectTensorsInfo
- Implements
-
System.IDisposable
Constructors
Declaration
C#Copypublic TensorsInfo()
Exceptions
| Type | Condition |
|---|---|
| System.NotSupportedException | Thrown when the feature is not supported. |
Properties
Declaration
C#Copypublic int Count { get; }
Property Value
| Type | Description |
|---|---|
| int |
Methods
AddTensorInfo(string, TensorType, int[])
Add a Tensor information to the TensorsInfo instance. Note that we support up to 16 tensors in TensorsInfo.
Declaration
C#Copypublic void AddTensorInfo(string name, TensorType type, int[] dimension)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Name of Tensor. |
| TensorType | type | Data element type of Tensor. |
| int[] | dimension | Dimension of Tensor. Note that we support up to 4th ranks. |
Exceptions
| Type | Condition |
|---|---|
| System.IndexOutOfRangeException | Thrown when the number of Tensor already exceeds the size limits (i.e. Tensor.SlzeLimit) |
| System.ArgumentException | Thrown when the method failed due to an invalid parameter. |
| System.NotSupportedException | Thrown when the feature is not supported. |
AddTensorInfo(TensorType, int[])
Add a Tensor information to the TensorsInfo instance. Note that we support up to 16 tensors in TensorsInfo.
Declaration
C#Copypublic void AddTensorInfo(TensorType type, int[] dimension)
Parameters
| Type | Name | Description |
|---|---|---|
| TensorType | type | Data element type of Tensor. |
| int[] | dimension | Dimension of Tensor. Note that we support up to 4th ranks. |
Exceptions
| Type | Condition |
|---|---|
| System.IndexOutOfRangeException | Thrown when the number of Tensor already exceeds the size limits (i.e. Tensor.SlzeLimit) |
| 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 ~TensorsInfo()
Declaration
C#Copypublic int[] GetDimension(int idx)
Parameters
| Type | Name | Description |
|---|---|---|
| int | idx | The index of the tensor. |
Returns
| Type | Description |
|---|---|
| int[] | The tensor dimension. |
Exceptions
| Type | Condition |
|---|---|
| System.IndexOutOfRangeException | Thrown when the index is greater than the number of Tensor. |
| System.ArgumentException | Thrown when the method failed due to an invalid parameter. |
| System.NotSupportedException | Thrown when the feature is not supported. |
Declaration
C#Copypublic string GetTensorName(int idx)
Parameters
| Type | Name | Description |
|---|---|---|
| int | idx | The index of the tensor. |
Returns
| Type | Description |
|---|---|
| string | The tensor name. |
Exceptions
| Type | Condition |
|---|---|
| System.IndexOutOfRangeException | Thrown when the index is greater than the number of Tensor. |
| System.NotSupportedException | Thrown when the feature is not supported. |
Declaration
C#Copypublic TensorsData GetTensorsData()
Returns
| Type | Description |
|---|---|
| TensorsData | TensorsData instance |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | Thrown when the method failed due to TensorsInfo's information is invalid. |
| System.NotSupportedException | Thrown when the feature is not supported. |
Declaration
C#Copypublic TensorType GetTensorType(int idx)
Parameters
| Type | Name | Description |
|---|---|---|
| int | idx | The index of the tensor. |
Returns
| Type | Description |
|---|---|
| TensorType | The tensor type |
Exceptions
| Type | Condition |
|---|---|
| System.IndexOutOfRangeException | Thrown when the index is greater than the number of Tensor. |
| 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 SetDimension(int idx, int[] dimension)
Parameters
| Type | Name | Description |
|---|---|---|
| int | idx | The index of the tensor to be updated. |
| int[] | dimension | The tensor dimension to be set. |
Exceptions
| Type | Condition |
|---|---|
| System.IndexOutOfRangeException | Thrown when the index is greater than the number of Tensor. |
| 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 SetTensorName(int idx, string name)
Parameters
| Type | Name | Description |
|---|---|---|
| int | idx | The index of the tensor to be updated. |
| string | name | The tensor name to be set. |
Exceptions
| Type | Condition |
|---|---|
| System.IndexOutOfRangeException | Thrown when the index is greater than the number of Tensor. |
| 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 SetTensorType(int idx, TensorType type)
Parameters
| Type | Name | Description |
|---|---|---|
| int | idx | The index of the tensor to be updated. |
| TensorType | type | The tensor type to be set. |
Exceptions
| Type | Condition |
|---|---|
| System.IndexOutOfRangeException | Thrown when the index is greater than the number of Tensor. |
| System.ArgumentException | Thrown when the method failed due to an invalid parameter. |
| System.NotSupportedException | Thrown when the feature is not supported. |