[Util] extended dim of 0-initialized
authorJaeyun Jung <jy1210.jung@samsung.com>
Thu, 16 Nov 2023 12:27:41 +0000 (21:27 +0900)
committerjaeyun-jung <39614140+jaeyun-jung@users.noreply.github.com>
Fri, 17 Nov 2023 04:43:50 +0000 (13:43 +0900)
We implemented 0-init dimension in nnstreamer.
If dim value at index of old rank limit (4) is not 0, it is extended.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
c/src/ml-api-inference-internal.c

index f525dff..fdcb8ed 100644 (file)
@@ -58,15 +58,16 @@ convert_ml_tensor_type_from (tensor_type type)
 static gboolean
 gst_info_is_extended (const GstTensorsInfo * gst_info)
 {
-  int i, j;
+  GstTensorInfo *_info;
+  guint i;
+
   for (i = 0; i < gst_info->num_tensors; i++) {
-    GstTensorInfo *_gst_tensor_info =
-        gst_tensors_info_get_nth_info ((GstTensorsInfo *) gst_info, i);
-    for (j = ML_TENSOR_RANK_LIMIT_PREV; j < NNS_TENSOR_RANK_LIMIT; j++) {
-      if (_gst_tensor_info->dimension[j] > 1)
-        return TRUE;
-    }
+    _info = gst_tensors_info_get_nth_info ((GstTensorsInfo *) gst_info, i);
+
+    if (_info->dimension[ML_TENSOR_RANK_LIMIT_PREV] > 0)
+      return TRUE;
   }
+
   return FALSE;
 }