From ea1422d47b0ba5736ccda19d4bbcabc51c93b70a Mon Sep 17 00:00:00 2001 From: Reuben Morais Date: Mon, 17 Jun 2019 08:42:18 -0300 Subject: [PATCH] Document vector/tensor copy functions --- native_client/tflitemodelstate.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/native_client/tflitemodelstate.cc b/native_client/tflitemodelstate.cc index 9af0ae86..8c61a83f 100644 --- a/native_client/tflitemodelstate.cc +++ b/native_client/tflitemodelstate.cc @@ -170,6 +170,8 @@ TFLiteModelState::init(const char* model_path, return DS_ERR_OK; } +// Copy contents of vec into the tensor with index tensor_idx. +// If vec.size() < num_elements, set the remainder of the tensor values to zero. void TFLiteModelState::copy_vector_to_tensor(const vector& vec, int tensor_idx, @@ -185,6 +187,7 @@ TFLiteModelState::copy_vector_to_tensor(const vector& vec, } } +// Copy num_elements elements from the tensor with index tensor_idx into vec void TFLiteModelState::copy_tensor_to_vector(int tensor_idx, int num_elements,