diff options
author | 2018-03-22 10:21:39 -0700 | |
---|---|---|
committer | 2018-03-22 10:24:11 -0700 | |
commit | 010e3e401cef883aa0fff334d3f5e56a88e3f5e4 (patch) | |
tree | 56e685d0b9a0b92bdb20a545164137e4e68ff6d5 | |
parent | aeb9f62e237ae1274482acca2fa09db34aef42d4 (diff) |
Mark tensor as const in a function that does not mutate a tensor.
PiperOrigin-RevId: 190085757
-rw-r--r-- | tensorflow/contrib/lite/kernels/kernel_util.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tensorflow/contrib/lite/kernels/kernel_util.h b/tensorflow/contrib/lite/kernels/kernel_util.h index 21da1daff7..2f407b5da3 100644 --- a/tensorflow/contrib/lite/kernels/kernel_util.h +++ b/tensorflow/contrib/lite/kernels/kernel_util.h @@ -53,13 +53,13 @@ inline TfLiteTensor* GetOptionalInputTensor(TfLiteContext* context, } // Determines whether tensor is constant. -inline bool IsConstantTensor(TfLiteTensor* tensor) { +inline bool IsConstantTensor(const TfLiteTensor* tensor) { return tensor->allocation_type == kTfLiteMmapRo; } // Determines whether tensor is dynamic. Note that a tensor can be non-const and // not dynamic. This function specifically checks for a dynamic tensor. -inline bool IsDynamicTensor(TfLiteTensor* tensor) { +inline bool IsDynamicTensor(const TfLiteTensor* tensor) { return tensor->allocation_type == kTfLiteDynamic; } |