1- /* Copyright 2023 The TensorFlow Authors. All Rights Reserved.
1+ /* Copyright 2025 The TensorFlow Authors. All Rights Reserved.
22
33Licensed under the Apache License, Version 2.0 (the "License");
44you may not use this file except in compliance with the License.
@@ -12,6 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212See the License for the specific language governing permissions and
1313limitations under the License.
1414==============================================================================*/
15+ #include " tensorflow/lite/micro/kernels/strided_slice.h"
16+
1517#include < cstdint>
1618
1719#include " tensorflow/lite/c/builtin_op_data.h"
@@ -82,6 +84,12 @@ void TestStridedSliceFloat(int* input_shape, int* begin_shape, int* end_shape,
8284 CreateTensor (strides_data, strides_dims),
8385 CreateTensor (output_data, output_dims),
8486 };
87+ // begin must be a const tensor
88+ tensors[kStridedSliceBeginTensor ].allocation_type = kTfLiteMmapRo ;
89+ // end must be a const tensor
90+ tensors[kStridedSliceEndTensor ].allocation_type = kTfLiteMmapRo ;
91+ // strides must be a const tensor
92+ tensors[kStridedSliceStridesTensor ].allocation_type = kTfLiteMmapRo ;
8593
8694 ValidateStridedSliceGoldens (tensors, tensors_size, expected_output,
8795 output_data, ElementCount (*output_dims),
@@ -116,6 +124,12 @@ void TestStridedSliceQuantized(int* input_shape, int* begin_shape,
116124 CreateTensor (strides_data, strides_dims),
117125 CreateQuantizedTensor (output_data, output_dims, 1.0 , zero_point),
118126 };
127+ // begin must be a const tensor
128+ tensors[kStridedSliceBeginTensor ].allocation_type = kTfLiteMmapRo ;
129+ // end must be a const tensor
130+ tensors[kStridedSliceEndTensor ].allocation_type = kTfLiteMmapRo ;
131+ // strides must be a const tensor
132+ tensors[kStridedSliceStridesTensor ].allocation_type = kTfLiteMmapRo ;
119133
120134 ValidateStridedSliceGoldens (tensors, tensors_size, expected_output,
121135 output_data, ElementCount (*output_dims),
0 commit comments