diff options
author | 2018-03-08 13:39:54 -0800 | |
---|---|---|
committer | 2018-03-08 13:45:19 -0800 | |
commit | 8c9a9b371d619ba35f7eae598a2eea045659738a (patch) | |
tree | 70ee7d729516141aea0abc693b199810143781b5 /tensorflow/contrib/lite/util.h | |
parent | ebf554ff77bc46bfdd9b424bc44b62f803100b33 (diff) |
[TF Lite] Provide a fast path for Interpreter::SetTensorParametersReadOnly.
The fast path kicks in if shape matches tensor.dims and type matches
tensor.type.
In this case, the interpreter is not invalidated and AllocateTensors need not
be called after a call to SetTensorParametersReadOnly.
PiperOrigin-RevId: 188380596
Diffstat (limited to 'tensorflow/contrib/lite/util.h')
-rw-r--r-- | tensorflow/contrib/lite/util.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tensorflow/contrib/lite/util.h b/tensorflow/contrib/lite/util.h index 50e4fb839e..f505d82a11 100644 --- a/tensorflow/contrib/lite/util.h +++ b/tensorflow/contrib/lite/util.h @@ -29,6 +29,10 @@ namespace tflite { // Converts a `std::vector` to a `TfLiteIntArray`. TfLiteIntArray* ConvertVectorToTfLiteIntArray(const std::vector<int>& input); +// Checks whether a `TfLiteIntArray` and `std::vector` have matching elements. +bool EqualVectorAndTfLiteIntArray(const TfLiteIntArray* a, + const std::vector<int>& b); + } // namespace tflite #endif // TENSORFLOW_CONTRIB_LITE_UTIL_H_ |