diff options
author | 2018-02-02 10:01:40 -0800 | |
---|---|---|
committer | 2018-02-02 11:00:08 -0800 | |
commit | b38575ea9b12534e9c63833782a46e43e1c9a8af (patch) | |
tree | 37a2b699d5d2f02330648908b6fb7089106cc403 /tensorflow/contrib/lite/kernels/kernel_util.h | |
parent | 9cfdf520d997e73011ee7bd5a183ced622a913aa (diff) |
Show that we must over reallocate after resizing dynamic tensors.
PiperOrigin-RevId: 184296680
Diffstat (limited to 'tensorflow/contrib/lite/kernels/kernel_util.h')
-rw-r--r-- | tensorflow/contrib/lite/kernels/kernel_util.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tensorflow/contrib/lite/kernels/kernel_util.h b/tensorflow/contrib/lite/kernels/kernel_util.h index 3cfa72615a..28f53b9fbb 100644 --- a/tensorflow/contrib/lite/kernels/kernel_util.h +++ b/tensorflow/contrib/lite/kernels/kernel_util.h @@ -65,7 +65,10 @@ inline bool IsDynamicTensor(TfLiteTensor* tensor) { // Sets tensor to dynamic. inline void SetTensorToDynamic(TfLiteTensor* tensor) { - tensor->allocation_type = kTfLiteDynamic; + if (tensor->allocation_type != kTfLiteDynamic) { + tensor->allocation_type = kTfLiteDynamic; + tensor->data.raw = nullptr; + } } // Calculates the multiplication factor for a quantized convolution (or |