[CodeClean] test and comments
authorYelin Jeong <yelini.jeong@samsung.com>
Fri, 8 Sep 2023 07:13:40 +0000 (16:13 +0900)
committerjaeyun-jung <39614140+jaeyun-jung@users.noreply.github.com>
Mon, 11 Sep 2023 10:09:27 +0000 (19:09 +0900)
Fix test and comments.
- Remove useless initialization
- Change comment and docs

Signed-off-by: Yelin Jeong <yelini.jeong@samsung.com>
ext/nnstreamer/tensor_filter/tensor_filter_snap.cc
gst/nnstreamer/elements/gsttensor_transform.md
gst/nnstreamer/include/nnstreamer_plugin_api_util.h
gst/nnstreamer/nnstreamer_plugin_api_util_impl.c
tests/test_models/models/passthrough.py

index 1e5a2f2..f43980b 100644 (file)
@@ -927,7 +927,7 @@ tensor_filter_snap::parse_dimension (const std::vector<int> &shape, tensor_dim d
 
   rank = shape.size ();
   if (rank > NNS_TENSOR_RANK_LIMIT) {
-    /* supposed max rank is less than 4 (NNS_TENSOR_RANK_LIMIT) */
+    /* supposed max rank is less than 16 (NNS_TENSOR_RANK_LIMIT) */
     snap_loge ("The rank is invalid (%lu).", rank);
     return false;
   }
index 7d3e787..887aa00 100644 (file)
@@ -33,7 +33,7 @@ title: tensor_transform
   - Enum "gtt_mode_type" Default: -1, "unknown"
     - (0): dimchg
       - A mode for changing tensor dimensions
-      - An option should be provided as option=FROM_DIM:TO_DIM (with a regex, ^([0-3]):([0-3])$, where NNS_TENSOR_RANK_LIMIT is 4).
+      - An option should be provided as option=FROM_DIM:TO_DIM (with a regex, ^([0-9]|1[0-5]):([0-9]|1[0-5])$, where NNS_TENSOR_RANK_LIMIT is 16).
       - Example: Move 1st dim to 2nd dim (i.e., [a][H][W][C] ==> [a][C][H][W])
 
         ```bash
index a010b94..d496b24 100644 (file)
@@ -300,7 +300,7 @@ gst_tensor_dimension_get_rank (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:...: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 dimstr The dimension string in the format of d1:...:d16, d1:d2:d3, d1:d2, or d1, where dN is a positive integer and d1 is the innermost dimension; i.e., dim[d16]...[d1];
  * @param dim dimension to be filled.
  */
 extern guint
@@ -309,7 +309,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:d5:d6:d7:d8).
+ * @return Formatted string of given dimension (d1:d2:d3:...:d15:d16).
  * @note The returned value should be freed with g_free()
  */
 extern gchar *
index ad9e63b..d9aa7cb 100644 (file)
@@ -1048,7 +1048,7 @@ gst_tensor_dimension_get_rank (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:...: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 dimstr The dimension string in the format of d1:...:d16, d1:d2:d3, d1:d2, or d1, where dN is a positive integer and d1 is the innermost dimension; i.e., dim[d16]...[d1];
  * @param dim dimension to be filled.
  */
 guint
@@ -1092,7 +1092,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:d5:d6:d7:d8).
+ * @return Formatted string of given dimension (d1:d2:d3:...:d15:d16).
  * @note The returned value should be freed with g_free()
  */
 gchar *
index af94d0c..a8d60e4 100644 (file)
@@ -13,11 +13,6 @@ import nnstreamer_python as nns
 D1 = 3
 D2 = 280
 D3 = 40
-D4 = 1
-D5 = 1
-D6 = 1
-D7 = 1
-D8 = 1
 
 
 ##
@@ -26,8 +21,8 @@ class CustomFilter(object):
     ##
     # @brief  The constructor for custom filter: passthrough
     def __init__(self, *args):
-        self.input_dims = [nns.TensorShape([D1, D2, D3, D4, D5, D6, D7, D8], np.uint8)]
-        self.output_dims = [nns.TensorShape([D1, D2, D3, D4, D5, D6, D7, D8], np.uint8)]
+        self.input_dims = [nns.TensorShape([D1, D2, D3], np.uint8)]
+        self.output_dims = [nns.TensorShape([D1, D2, D3], np.uint8)]
 
     ##
     # @brief  python callback: getInputDim