Merge pull request #45277 from foss-for-synopsys-dwc-arc-processors:arc_mli_utils_fix

PiperOrigin-RevId: 345434707
Change-Id: I39a6570b0f454519e0a53ed885bb1428b6df9b0e
This commit is contained in:
TensorFlower Gardener 2020-12-03 06:08:34 -08:00
commit dbb41a3f72

View File

@ -96,7 +96,11 @@ inline void ConvertToMliQuantParamsPerChannel(const TfLiteTensor* tfT,
template <typename datatype>
inline void MliTensorAttachBuffer(const TfLiteEvalTensor* tfT,
mli_tensor* mliT) {
mliT->data = static_cast<void*>(tflite::micro::GetTensorData<datatype>(tfT));
// "const_cast" here used to attach const data buffer to the initially
// non-const mli_tensor. This is required by current implementation of MLI
// backend and planned for redesign due to this and some other aspects.
mliT->data = const_cast<void*>(
static_cast<const void*>(tflite::micro::GetTensorData<datatype>(tfT)));
}
inline void ConvertToMliTensor(const TfLiteTensor* tfT, mli_tensor* mliT) {