From: Yelin Jeong Date: Tue, 27 Dec 2022 09:46:11 +0000 (+0900) Subject: [tensor] increase NNS_TENSOR_RANK_LIMIT X-Git-Tag: accepted/tizen/unified/20230413.123717~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dd7f7b47d59887eb4b1eed4aece2bc7fde8d5edb;p=platform%2Fupstream%2Fnnstreamer.git [tensor] increase NNS_TENSOR_RANK_LIMIT This patch increases NNS_TENSOR_RANK_LIMIT to 8 Signed-off-by: Yelin Jeong --- diff --git a/gst/nnstreamer/include/nnstreamer_plugin_api_util.h b/gst/nnstreamer/include/nnstreamer_plugin_api_util.h index 1b13777..fe871b0 100644 --- a/gst/nnstreamer/include/nnstreamer_plugin_api_util.h +++ b/gst/nnstreamer/include/nnstreamer_plugin_api_util.h @@ -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 * diff --git a/gst/nnstreamer/include/tensor_typedef.h b/gst/nnstreamer/include/tensor_typedef.h index 5fab6cf..0870990 100644 --- a/gst/nnstreamer/include/tensor_typedef.h +++ b/gst/nnstreamer/include/tensor_typedef.h @@ -31,7 +31,7 @@ #include #include -#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) diff --git a/gst/nnstreamer/nnstreamer_plugin_api_util_impl.c b/gst/nnstreamer/nnstreamer_plugin_api_util_impl.c index c377552..506ce49 100644 --- a/gst/nnstreamer/nnstreamer_plugin_api_util_impl.c +++ b/gst/nnstreamer/nnstreamer_plugin_api_util_impl.c @@ -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 *