diff options
author | 2018-08-29 08:58:27 -0700 | |
---|---|---|
committer | 2018-08-29 09:07:49 -0700 | |
commit | 97fb9a9c7c72c405a790eea698a91654d5184fed (patch) | |
tree | de458ca70534a20174fc0fc93465da416e0f9d20 /tensorflow/contrib/lite/nnapi_delegate.cc | |
parent | 0f443619fb13fcd5c34cb7d8c867b64339afdcfc (diff) |
Disable rtti for (most) TFLite targets on Android
PiperOrigin-RevId: 210729533
Diffstat (limited to 'tensorflow/contrib/lite/nnapi_delegate.cc')
-rw-r--r-- | tensorflow/contrib/lite/nnapi_delegate.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tensorflow/contrib/lite/nnapi_delegate.cc b/tensorflow/contrib/lite/nnapi_delegate.cc index 38f3e9881b..8090c413d8 100644 --- a/tensorflow/contrib/lite/nnapi_delegate.cc +++ b/tensorflow/contrib/lite/nnapi_delegate.cc @@ -191,8 +191,10 @@ TfLiteStatus addTensorOperands(tflite::Interpreter* interpreter, // TODO(aselle): Based on Michael's suggestion, limiting this to read // only memory if (tensor->allocation_type == kTfLiteMmapRo) { - if (const NNAPIAllocation* alloc = dynamic_cast<const NNAPIAllocation*>( - static_cast<const Allocation*>(tensor->allocation))) { + if (static_cast<const Allocation*>(tensor->allocation)->type() == + Allocation::Type::kNNAPI) { + const NNAPIAllocation* alloc = + static_cast<const NNAPIAllocation*>(tensor->allocation); RETURN_ERROR_IF_NN_FAILED( ANeuralNetworksModel_setOperandValueFromMemory( nn_model, next_id, alloc->memory(), |