Log.Info(NNStreamer.TAG, "TensorsInfo is created");
_infoList = new List<TensorInfo>();
}
Log.Info(NNStreamer.TAG, "TensorsInfo is created");
_infoList = new List<TensorInfo>();
}
/// <since_tizen> 6 </since_tizen>
public void AddTensorInfo(TensorType type, int[] dimension)
{
/// <since_tizen> 6 </since_tizen>
public void AddTensorInfo(TensorType type, int[] dimension)
{
/// <since_tizen> 6 </since_tizen>
public void AddTensorInfo(string name, TensorType type, int[] dimension)
{
/// <since_tizen> 6 </since_tizen>
public void AddTensorInfo(string name, TensorType type, int[] dimension)
{
int idx = _infoList.Count;
if (idx >= Tensor.SizeLimit) {
throw new IndexOutOfRangeException("Max size of the tensors is " + Tensor.SizeLimit);
int idx = _infoList.Count;
if (idx >= Tensor.SizeLimit) {
throw new IndexOutOfRangeException("Max size of the tensors is " + Tensor.SizeLimit);
ret = Interop.Util.SetTensorsCount(_handle, _infoList.Count);
NNStreamer.CheckException(ret, "unable to set the number of tensors");
ret = Interop.Util.SetTensorsCount(_handle, _infoList.Count);
NNStreamer.CheckException(ret, "unable to set the number of tensors");
ret = Interop.Util.SetTensorType(_handle, idx, type);
NNStreamer.CheckException(ret, "fail to set TensorsInfo type");
ret = Interop.Util.SetTensorType(_handle, idx, type);
NNStreamer.CheckException(ret, "fail to set TensorsInfo type");
/// <since_tizen> 6 </since_tizen>
public void SetTensorName(int idx, string name)
{
/// <since_tizen> 6 </since_tizen>
public void SetTensorName(int idx, string name)
{
/// <param name="idx">The index of the tensor.</param>
/// <returns>The tensor name.</returns>
/// <exception cref="IndexOutOfRangeException">Thrown when the index is greater than the number of Tensor.</exception>
/// <param name="idx">The index of the tensor.</param>
/// <returns>The tensor name.</returns>
/// <exception cref="IndexOutOfRangeException">Thrown when the index is greater than the number of Tensor.</exception>
/// <since_tizen> 6 </since_tizen>
public void SetTensorType(int idx, TensorType type)
{
/// <since_tizen> 6 </since_tizen>
public void SetTensorType(int idx, TensorType type)
{
/// <returns>The tensor type</returns>
/// <exception cref="IndexOutOfRangeException">Thrown when the index is greater than the number of Tensor.</exception>
/// <exception cref="ArgumentException">Thrown when the method failed due to an invalid parameter.</exception>
/// <returns>The tensor type</returns>
/// <exception cref="IndexOutOfRangeException">Thrown when the index is greater than the number of Tensor.</exception>
/// <exception cref="ArgumentException">Thrown when the method failed due to an invalid parameter.</exception>
/// <since_tizen> 6 </since_tizen>
public void SetDimension(int idx, int[] dimension)
{
/// <since_tizen> 6 </since_tizen>
public void SetDimension(int idx, int[] dimension)
{
/// <returns>The tensor dimension.</returns>
/// <exception cref="IndexOutOfRangeException">Thrown when the index is greater than the number of Tensor.</exception>
/// <exception cref="ArgumentException">Thrown when the method failed due to an invalid parameter.</exception>
/// <returns>The tensor dimension.</returns>
/// <exception cref="IndexOutOfRangeException">Thrown when the index is greater than the number of Tensor.</exception>
/// <exception cref="ArgumentException">Thrown when the method failed due to an invalid parameter.</exception>
if (_handle == IntPtr.Zero)
{
Log.Info(NNStreamer.TAG, "_handle is IntPtr.Zero\n" + " GetTensorsInfoHandle() is called");
if (_handle == IntPtr.Zero)
{
Log.Info(NNStreamer.TAG, "_handle is IntPtr.Zero\n" + " GetTensorsInfoHandle() is called");
ret = Interop.Util.CreateTensorsData(_handle, out tensorsData_h);
NNStreamer.CheckException(ret, "unable to create the tensorsData object");
ret = Interop.Util.CreateTensorsData(_handle, out tensorsData_h);
NNStreamer.CheckException(ret, "unable to create the tensorsData object");
if (ret != NNStreamerError.None)
{
Log.Error(NNStreamer.TAG, "failed to destroy TensorsInfo object");
if (ret != NNStreamerError.None)
{
Log.Error(NNStreamer.TAG, "failed to destroy TensorsInfo object");