Class TensorsInfo
Definition
- Assembly:
- Tizen.MachineLearning.Inference.dll
The TensorsInfo class manages each Tensor information such as Name, Type and Dimension.
public class TensorsInfo : IDisposable
- Inheritance
-
objectTensorsInfo
- Implements
-
System.IDisposable
Constructors
View SourceTensorsInfo()
Creates a TensorsInfo instance.
Declaration
public TensorsInfo()
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Thrown when the feature is not supported. |
Properties
View SourceCount
Get the number of Tensor information which is added.
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
int |
Methods
View SourceAddTensorInfo(string, TensorType, int[])
Add a Tensor information to the TensorsInfo instance. Note that we support up to 16 tensors in TensorsInfo.
Declaration
public 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
public 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. |
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. |
~TensorsInfo()
Destroys the TensorsInfo resource.
Declaration
protected ~TensorsInfo()
GetDimension(int)
Gets the tensor dimension with given index.
Declaration
public 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. |
GetTensorName(int)
Gets the tensor name with given index.
Declaration
public 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. |
GetTensorsData()
Creates a TensorsData instance based on informations of TensorsInfo
Declaration
public 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. |
GetTensorType(int)
Gets the tensor type with given index.
Declaration
public 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. |
SetDimension(int, int[])
Sets the tensor dimension with given index and dimension.
Declaration
public 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. |
SetTensorName(int, string)
Sets the tensor name with given index.
Declaration
public 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. |
SetTensorType(int, TensorType)
Sets the tensor type with given index and its type.
Declaration
public 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. |