[tensor] increase NNS_TENSOR_RANK_LIMIT
authorYelin Jeong <yelini.jeong@samsung.com>
Tue, 27 Dec 2022 09:46:11 +0000 (18:46 +0900)
committerSangjung Woo <again4you@gmail.com>
Thu, 6 Apr 2023 02:18:17 +0000 (11:18 +0900)
This patch increases NNS_TENSOR_RANK_LIMIT to 8

Signed-off-by: Yelin Jeong <yelini.jeong@samsung.com>
gst/nnstreamer/include/nnstreamer_plugin_api_util.h
gst/nnstreamer/include/tensor_typedef.h
gst/nnstreamer/nnstreamer_plugin_api_util_impl.c

index 1b13777..fe871b0 100644 (file)
@@ -274,7 +274,7 @@ gst_tensor_dimension_is_valid (const tensor_dim dim);
 /**
  * @brief Parse tensor dimension parameter string
  * @return The Rank. 0 if error.
- * @param dimstr The dimension string in the format of d1:d2:d3:d4, d1:d2:d3, d1:d2, or d1, where dN is a positive integer and d1 is the innermost dimension; i.e., dim[d4][d3][d2][d1];
+ * @param dimstr The dimension string in the format of d1:...:d8, d1:d2:d3, d1:d2, or d1, where dN is a positive integer and d1 is the innermost dimension; i.e., dim[d8][d7][d6][d5][d4][d3][d2][d1];
  * @param dim dimension to be filled.
  */
 extern guint
@@ -283,7 +283,7 @@ gst_tensor_parse_dimension (const gchar * dimstr, tensor_dim dim);
 /**
  * @brief Get dimension string from given tensor dimension.
  * @param dim tensor dimension
- * @return Formatted string of given dimension (d1:d2:d3:d4).
+ * @return Formatted string of given dimension (d1:d2:d3:d4:d5:d6:d7:d8).
  * @note The returned value should be freed with g_free()
  */
 extern gchar *
index 5fab6cf..0870990 100644 (file)
@@ -31,7 +31,7 @@
 #include <stddef.h>
 #include <stdint.h>
 
-#define NNS_TENSOR_RANK_LIMIT  (4)
+#define NNS_TENSOR_RANK_LIMIT  (8)
 #define NNS_TENSOR_SIZE_LIMIT  (16)
 #define NNS_TENSOR_SIZE_LIMIT_STR      "16"
 #define NNS_TENSOR_SIZE_EXTRA_LIMIT (200)
index c377552..506ce49 100644 (file)
@@ -860,10 +860,10 @@ gst_tensor_dimension_is_valid (const tensor_dim dim)
     if (dim[i] == 0) {
       gchar *dim_str = gst_tensor_get_dimension_string (dim);
       nns_logd
-          ("Failed to validate tensor dimension. Given dimension: %s. The dimension string should be in the form of d1:d2:d3:d4, d1:d2:d3, d1:d2, or d1. Here, dN is a positive integer.",
+          ("Failed to validate tensor dimension. Given dimension: %s. The dimension string should be in the form of d1:...:d8, d1:d2:d3:d4, d1:d2:d3, d1:d2, or d1. Here, dN is a positive integer.",
           dim_str);
       _nnstreamer_error_write
-          ("Failed to validate tensor dimension. Given dimension: %s. The dimension string should be in the form of d1:d2:d3:d4, d1:d2:d3, d1:d2, or d1. Here, dN is a positive integer.",
+          ("Failed to validate tensor dimension. Given dimension: %s. The dimension string should be in the form of d1:...:d8, d1:d2:d3:d4, d1:d2:d3, d1:d2, or d1. Here, dN is a positive integer.",
           dim_str);
       g_free (dim_str);
       return FALSE;
@@ -876,7 +876,7 @@ gst_tensor_dimension_is_valid (const tensor_dim dim)
 /**
  * @brief Parse tensor dimension parameter string
  * @return The Rank. 0 if error.
- * @param dimstr The dimension string in the format of d1:d2:d3:d4, d1:d2:d3, d1:d2, or d1, where dN is a positive integer and d1 is the innermost dimension; i.e., dim[d4][d3][d2][d1];
+ * @param dimstr The dimension string in the format of d1:...:d8, d1:d2:d3, d1:d2, or d1, where dN is a positive integer and d1 is the innermost dimension; i.e., dim[d8][d7][d6][d5][d4][d3][d2][d1];
  * @param dim dimension to be filled.
  */
 guint
@@ -919,7 +919,7 @@ gst_tensor_parse_dimension (const gchar * dimstr, tensor_dim dim)
 /**
  * @brief Get dimension string from given tensor dimension.
  * @param dim tensor dimension
- * @return Formatted string of given dimension (d1:d2:d3:d4).
+ * @return Formatted string of given dimension (d1:d2:d3:d4:d5:d6:d7:d8).
  * @note The returned value should be freed with g_free()
  */
 gchar *