From 363e59b6cd0cb4a198fb87a515af42c62ca3489d Mon Sep 17 00:00:00 2001 From: Junsang Mo Date: Wed, 16 Oct 2019 20:40:21 +0900 Subject: [PATCH] [CodeClean]remove duplicates in TFLiteCore::getTensorDim make a variable for interpreter->tensor (tensor_idx)->dims. replace interpreter->tensor (tensor_idx)->dims with the variable. Signed-off-by: Junsang Mo --- ext/nnstreamer/tensor_filter/tensor_filter_tensorflow_lite_core.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/nnstreamer/tensor_filter/tensor_filter_tensorflow_lite_core.cc b/ext/nnstreamer/tensor_filter/tensor_filter_tensorflow_lite_core.cc index dd185ff..4dbe8a3 100644 --- a/ext/nnstreamer/tensor_filter/tensor_filter_tensorflow_lite_core.cc +++ b/ext/nnstreamer/tensor_filter/tensor_filter_tensorflow_lite_core.cc @@ -269,12 +269,12 @@ TFLiteCore::setOutputTensorProp () int TFLiteCore::getTensorDim (int tensor_idx, tensor_dim dim) { - int len = interpreter->tensor (tensor_idx)->dims->size; + TfLiteIntArray *tensor_dims = interpreter->tensor (tensor_idx)->dims; + int len = tensor_dims->size; g_assert (len <= NNS_TENSOR_RANK_LIMIT); /* the order of dimension is reversed at CAPS negotiation */ - std::reverse_copy (interpreter->tensor (tensor_idx)->dims->data, - interpreter->tensor (tensor_idx)->dims->data + len, dim); + std::reverse_copy (tensor_dims->data, tensor_dims->data + len, dim); /* fill the remnants with 1 */ for (int i = len; i < NNS_TENSOR_RANK_LIMIT; ++i) { -- 2.7.4