{
GstTensorsInfo *info;
int i = 0;
- int value[8] = { 1, 1, 4, 1, 1, 1, 1, 1 }; /** loss, accuracy, val_loss, val_accuracy */
+
g_return_if_fail (trainer != NULL);
info = &trainer->output_meta;
trainer->output_ranks[0] = 4;
trainer->output_configured = TRUE;
- for (i = 0; i < NNS_TENSOR_RANK_LIMIT; i++)
- info->info[0].dimension[i] = value[i];
+ info->info[0].dimension[0] = 1;
+ info->info[0].dimension[1] = 1;
+ info->info[0].dimension[2] = 4; /** loss, accuracy, val_loss, val_accuracy */
+ info->info[0].dimension[3] = 1;
+
+ for (i = 4; i < NNS_TENSOR_RANK_LIMIT; i++)
+ info->info[0].dimension[i] = 0;
info->num_tensors = 1;
}
GST_DEBUG_CATEGORY_STATIC (gst_tensor_transform_debug);
#define GST_CAT_DEFAULT gst_tensor_transform_debug
#define CAPS_STRING GST_TENSOR_CAP_DEFAULT ";" GST_TENSORS_CAP_MAKE ("{ static, flexible }")
-#define REGEX_DIMCHG_OPTION "^([0-7]):([0-7])$"
+#define REGEX_DIMCHG_OPTION "^([0-9]|1[0-5]):([0-9]|1[0-5])$"
#define REGEX_TYPECAST_OPTION "(^[u]?int(8|16|32|64)$|^float(16|32|64)$)"
#define REGEX_TRANSPOSE_OPTION "^(?:([0-2]):(?!.*\\1)){3}3$"
#define REGEX_STAND_OPTION "^(default|dc-average)(:([u]?int(8|16|32|64)|float(16|32|64)))?(,per-channel:(true|false))?$"
static GEnumValue mode_types[] = {
{GTT_DIMCHG, "Mode for changing tensor dimensions, "
"option=FROM_DIM:TO_DIM (with a regex, " REGEX_DIMCHG_OPTION
- ", where NNS_TENSOR_RANK_LIMIT is 8)",
+ ", where NNS_TENSOR_RANK_LIMIT is 16)",
"dimchg"},
{GTT_TYPECAST, "Mode for casting type of tensor, "
"option=" REGEX_TYPECAST_OPTION, "typecast"},
#include <stddef.h>
#include <stdint.h>
-#define NNS_TENSOR_RANK_LIMIT (8)
+#define NNS_TENSOR_RANK_LIMIT (16)
#define NNS_TENSOR_RANK_LIMIT_PREV (4)
#define NNS_TENSOR_SIZE_LIMIT (16)
#define NNS_TENSOR_SIZE_LIMIT_STR "16"
}
/**
- * @brief Test for tensor meta info (dimension rank mismatched).
- */
-TEST (commonMetaInfo, convertMetaInvalidParam03_n)
-{
- GstTensorMetaInfo meta;
- GstTensorInfo info;
- guint i;
- gboolean ret;
-
- gst_tensor_meta_info_init (&meta);
- meta.type = _NNS_UINT16;
- meta.format = _NNS_TENSOR_FORMAT_STATIC;
- /* rank > NNS_TENSOR_RANK_LIMIT */
- for (i = 0; i < NNS_TENSOR_RANK_LIMIT + 3; i++)
- meta.dimension[i] = 2;
-
- ret = gst_tensor_meta_info_convert (&meta, &info);
- EXPECT_FALSE (ret);
-}
-
-/**
* @brief Test for aggregation utils (clear data).
*/
TEST (commonAggregationUtil, clearData)
set.num_tensors = 1;
set.info[0].type = _NNS_INT8;
for (i = 0; i < NNS_TENSOR_RANK_LIMIT; ++i) {
- set.info[0].dimension[i] = 10-i;
+ set.info[0].dimension[i] = (NNS_TENSOR_RANK_LIMIT * 2) - i;
}
}
h = gst_harness_new ("tensor_transform");
ASSERT_TRUE (NULL != h);
- /* It should be in the form of ^([0-3]):([0-3]) */
- g_object_set (h->element, "mode", GTT_DIMCHG, "option", "10:11", NULL);
+ /* It should be in the form of ^([0-9]|1[0-5]):([0-9]|1[0-5]) */
+ g_object_set (h->element, "mode", GTT_DIMCHG, "option", "20:21", NULL);
g_object_get (h->element, "option", &str, NULL);
EXPECT_TRUE (str == NULL);
h = gst_harness_new ("tensor_transform");
ASSERT_TRUE (NULL != h);
- /* It should be in the form of ^([0-3]):([0-3]) */
+ /* It should be in the form of ^([0-9]|1[0-5]):([0-9]|1[0-5]) */
g_object_set (h->element, "mode", GTT_DIMCHG, "option", "1,2", NULL);
g_object_get (h->element, "option", &str, NULL);
h = gst_harness_new ("tensor_transform");
ASSERT_TRUE (NULL != h);
- /* It should be in the form of ^([0-3]):([0-3]) */
+ /* It should be in the form of ^([0-9]|1[0-5]):([0-9]|1[0-5]) */
g_object_set (h->element, "mode", GTT_DIMCHG, "option", "0:2,1:3", NULL);
g_object_get (h->element, "option", &str, NULL);