diff options
author | 2018-05-11 19:38:48 -0700 | |
---|---|---|
committer | 2018-05-11 19:41:29 -0700 | |
commit | 52e2698ac969a0f82c6ce901f80f04818ca8ac4e (patch) | |
tree | 5b89fa879c61cac2f3b64d5edbf405ad616edde5 /tensorflow/contrib/lite/kernels/resize_bilinear.cc | |
parent | 84b5938aaee991d6909e16e56c66bf88e8843fbb (diff) |
Making GetInput from kernel_util.h return a pointer to const data.
PiperOrigin-RevId: 196340200
Diffstat (limited to 'tensorflow/contrib/lite/kernels/resize_bilinear.cc')
-rw-r--r-- | tensorflow/contrib/lite/kernels/resize_bilinear.cc | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/tensorflow/contrib/lite/kernels/resize_bilinear.cc b/tensorflow/contrib/lite/kernels/resize_bilinear.cc index 9e3e19c09a..e4bd0f5b85 100644 --- a/tensorflow/contrib/lite/kernels/resize_bilinear.cc +++ b/tensorflow/contrib/lite/kernels/resize_bilinear.cc @@ -36,8 +36,10 @@ constexpr int kInputTensor = 0; constexpr int kSizeTensor = 1; constexpr int kOutputTensor = 0; -TfLiteStatus ResizeOutputTensor(TfLiteContext* context, TfLiteTensor* input, - TfLiteTensor* size, TfLiteTensor* output) { +TfLiteStatus ResizeOutputTensor(TfLiteContext* context, + const TfLiteTensor* input, + const TfLiteTensor* size, + TfLiteTensor* output) { TfLiteIntArray* output_size = TfLiteIntArrayCreate(4); output_size->data[0] = input->dims->data[0]; const int32* size_data = GetTensorData<int32>(size); @@ -51,8 +53,8 @@ TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) { TF_LITE_ENSURE_EQ(context, NumInputs(node), 2); TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1); - TfLiteTensor* input = GetInput(context, node, kInputTensor); - TfLiteTensor* size = GetInput(context, node, kSizeTensor); + const TfLiteTensor* input = GetInput(context, node, kInputTensor); + const TfLiteTensor* size = GetInput(context, node, kSizeTensor); TfLiteTensor* output = GetOutput(context, node, kOutputTensor); // TODO(ahentz): Our current implementations rely on the inputs being 4D. @@ -78,9 +80,9 @@ TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { auto* params = reinterpret_cast<TfLiteResizeBilinearParams*>(node->builtin_data); - TfLiteTensor* input = GetInput(context, node, kInputTensor); + const TfLiteTensor* input = GetInput(context, node, kInputTensor); TfLiteTensor* output = GetOutput(context, node, kOutputTensor); - TfLiteTensor* size = GetInput(context, node, kSizeTensor); + const TfLiteTensor* size = GetInput(context, node, kSizeTensor); if (IsDynamicTensor(output)) { TF_LITE_ENSURE_OK(context, |