int nRet = -1;
ml_tensors_info_h hTensorsInfoHandle = NULL;
ml_tensors_info_h hCloneTensorsInfoHandle = NULL;
+ ml_tensor_dimension inputTensorDimension;
+ ml_tensor_dimension outputTensorDimension;
+ ml_tensor_type_e eGetTensorType = -1;
+ unsigned int nSetCount = 1;
+ unsigned int nGetCount = 0;
+
+ inputTensorDimension[0] = 10;
+ inputTensorDimension[1] = 1;
+ inputTensorDimension[2] = 1;
+ inputTensorDimension[3] = 1;
nRet = ml_tensors_info_create (&hTensorsInfoHandle);
PRINT_RESULT(ML_ERROR_NONE, nRet, "ml_tensors_info_create", NnStreamerGetError(nRet));
PRINT_RESULT_CLEANUP(ML_ERROR_NONE, nRet, "ml_tensors_info_create", NnStreamerGetError(nRet),ml_tensors_info_destroy (hTensorsInfoHandle));
CHECK_HANDLE_CLEANUP(hCloneTensorsInfoHandle, "ml_tensors_info_create",ml_tensors_info_destroy (hTensorsInfoHandle));
+ nRet = ml_tensors_info_set_count (hTensorsInfoHandle, nSetCount);
+ PRINT_RESULT_CLEANUP(ML_ERROR_NONE, nRet, "ml_tensors_info_set_count", NnStreamerGetError(nRet),ml_tensors_info_destroy (hCloneTensorsInfoHandle);ml_tensors_info_destroy (hTensorsInfoHandle));
+ nRet = ml_tensors_info_set_tensor_type (hTensorsInfoHandle, 0, ML_TENSOR_TYPE_UINT8);
+ PRINT_RESULT_CLEANUP(ML_ERROR_NONE, nRet, "ml_tensors_info_set_tensor_type", NnStreamerGetError(nRet),ml_tensors_info_destroy (hCloneTensorsInfoHandle);ml_tensors_info_destroy (hTensorsInfoHandle));
+ nRet = ml_tensors_info_set_tensor_dimension (hTensorsInfoHandle, 0, inputTensorDimension);
+ PRINT_RESULT_CLEANUP(ML_ERROR_NONE, nRet, "ml_tensors_info_set_tensor_dimension", NnStreamerGetError(nRet),ml_tensors_info_destroy (hCloneTensorsInfoHandle);ml_tensors_info_destroy (hTensorsInfoHandle));
+
nRet = ml_tensors_info_clone (hCloneTensorsInfoHandle, hTensorsInfoHandle);
PRINT_RESULT_CLEANUP(ML_ERROR_NONE, nRet, "ml_tensors_info_clone", NnStreamerGetError(nRet),ml_tensors_info_destroy (hCloneTensorsInfoHandle);ml_tensors_info_destroy (hTensorsInfoHandle));
+ nRet = ml_tensors_info_get_count (hCloneTensorsInfoHandle, &nGetCount);
+ PRINT_RESULT_CLEANUP(ML_ERROR_NONE, nRet, "ml_tensors_info_get_count", NnStreamerGetError(nRet),ml_tensors_info_destroy (hCloneTensorsInfoHandle);ml_tensors_info_destroy (hTensorsInfoHandle));
+ PRINT_RESULT_CLEANUP(nSetCount, nGetCount, "ml_tensors_info_get_count", NnStreamerGetError(nRet),ml_tensors_info_destroy (hCloneTensorsInfoHandle);ml_tensors_info_destroy (hTensorsInfoHandle));
+
+ nRet = ml_tensors_info_get_tensor_type (hCloneTensorsInfoHandle, 0, &eGetTensorType);
+ PRINT_RESULT_CLEANUP(ML_ERROR_NONE, nRet, "ml_tensors_info_get_tensor_type", NnStreamerGetError(nRet),ml_tensors_info_destroy (hCloneTensorsInfoHandle);ml_tensors_info_destroy (hTensorsInfoHandle));
+ PRINT_RESULT_CLEANUP(ML_TENSOR_TYPE_UINT8, eGetTensorType, "ml_tensors_info_get_tensor_type", NnStreamerGetError(nRet),ml_tensors_info_destroy (hCloneTensorsInfoHandle);ml_tensors_info_destroy (hTensorsInfoHandle));
+
+ nRet = ml_tensors_info_get_tensor_dimension (hCloneTensorsInfoHandle, 0, outputTensorDimension);
+ PRINT_RESULT_CLEANUP(ML_ERROR_NONE, nRet, "ml_tensors_info_get_tensor_dimension", NnStreamerGetError(nRet),ml_tensors_info_destroy (hCloneTensorsInfoHandle);ml_tensors_info_destroy (hTensorsInfoHandle));
+ PRINT_RESULT_CLEANUP(inputTensorDimension[0], outputTensorDimension[0], "ml_tensors_info_get_tensor_dimension", NnStreamerGetError(nRet),ml_tensors_info_destroy (hCloneTensorsInfoHandle);ml_tensors_info_destroy (hTensorsInfoHandle));
+ PRINT_RESULT_CLEANUP(inputTensorDimension[1], outputTensorDimension[1], "ml_tensors_info_get_tensor_dimension", NnStreamerGetError(nRet),ml_tensors_info_destroy (hCloneTensorsInfoHandle);ml_tensors_info_destroy (hTensorsInfoHandle));
+ PRINT_RESULT_CLEANUP(inputTensorDimension[2], outputTensorDimension[2], "ml_tensors_info_get_tensor_dimension", NnStreamerGetError(nRet),ml_tensors_info_destroy (hCloneTensorsInfoHandle);ml_tensors_info_destroy (hTensorsInfoHandle));
+ PRINT_RESULT_CLEANUP(inputTensorDimension[3], outputTensorDimension[3], "ml_tensors_info_get_tensor_dimension", NnStreamerGetError(nRet),ml_tensors_info_destroy (hCloneTensorsInfoHandle);ml_tensors_info_destroy (hTensorsInfoHandle));
+
nRet = ml_tensors_info_destroy (hCloneTensorsInfoHandle);
PRINT_RESULT_NORETURN(ML_ERROR_NONE, nRet, "ml_tensors_info_destroy", NnStreamerGetError(nRet));
{
IS_SUPPORT_FEATURE;
ml_tensors_info_h in_info, out_info;
+ guint count = 0;
+ ml_tensor_dimension in_dim, out_dim;
+ ml_tensor_type_e type = ML_TENSOR_TYPE_UNKNOWN;
status = ml_tensors_info_create (&in_info);
assert_eq (status, ML_ERROR_NONE);
status = ml_tensors_info_create (&out_info);
assert_eq (status, ML_ERROR_NONE);
+ in_dim[0] = 5;
+ in_dim[1] = 1;
+ in_dim[2] = 1;
+ in_dim[3] = 1;
+
+ status = ml_tensors_info_set_count (in_info, 1);
+ assert_eq (status, ML_ERROR_NONE);
+ status = ml_tensors_info_set_tensor_type (in_info, 0, ML_TENSOR_TYPE_UINT8);
+ assert_eq (status, ML_ERROR_NONE);
+ status = ml_tensors_info_set_tensor_dimension (in_info, 0, in_dim);
+ assert_eq (status, ML_ERROR_NONE);
+
status = ml_tensors_info_clone (out_info, in_info);
assert_eq (status, ML_ERROR_NONE);
+ status = ml_tensors_info_get_count (out_info, &count);
+ assert_eq (status, ML_ERROR_NONE);
+ assert_eq (count, 1U);
+
+ status = ml_tensors_info_get_tensor_type (out_info, 0, &type);
+ assert_eq (status, ML_ERROR_NONE);
+ assert_eq (type, ML_TENSOR_TYPE_UINT8);
+
+ status = ml_tensors_info_get_tensor_dimension (out_info, 0, out_dim);
+ assert_eq (status, ML_ERROR_NONE);
+ assert_eq (in_dim[0], out_dim[0]);
+ assert_eq (in_dim[1], out_dim[1]);
+ assert_eq (in_dim[2], out_dim[2]);
+ assert_eq (in_dim[3], out_dim[3]);
+
status = ml_tensors_info_destroy (in_info);
assert_eq (status, ML_ERROR_NONE);
status = ml_tensors_info_destroy (out_info);