tflite-micro/tensorflow/lite/micro/kernels
David Davis 8f1f3b2623
WHILE operator input/output copy fix (#3633)
@tensorflow/micro

Remove extraneous tensor copy operation after first invocation of condition subgraph.

Move copy of operator inputs to outputs, such that it occurs before the first invocation of the condition subgraph. This preserves the operator inputs when one or more of them is the output of DECODE, and alternate decompression memory is in use. This is because the output of DECODE is for immediate consumption by the next operator in the graph (WHILE), yet it is possible for the WHILE subgraph invocations to share memory with the original DECODE output.

Update the unit test for multiple invocations of the condition and body subgraphs.

When copying tensors between operator inputs/outputs and subgraph inputs/outputs, check if the source and destination tensors share memory.

bug=fixes #3632
2026-07-20 17:58:59 +00:00
..
arc_mli Typo in code (#3447) 2026-02-11 20:34:42 +00:00
ceva Typo in code (#3447) 2026-02-11 20:34:42 +00:00
cmsis_nn Re-enable 3D x 2D BatchMatMul dimension collapse for adj_x=true (#3599) 2026-07-08 15:32:05 +00:00
ethos_u [Doc] Fix typos (#3446) 2026-02-11 17:18:49 +00:00
test_data_generation [CI] Fix build (#3194) 2025-09-19 20:48:22 +00:00
testdata Clean-up unused bzl load (#3576) 2026-05-26 22:55:55 +00:00
xtensa Ensure int64 accumulation for bias-less 16x8 ops in TFLM kernels (#3598) 2026-06-16 23:58:19 +00:00
activation_utils.h
activations.cc Add int16 support to RELU (#2727) 2025-03-21 21:20:40 +00:00
activations.h Add int16 support to RELU (#2727) 2025-03-21 21:20:40 +00:00
activations_common.cc Add int16 support to RELU (#2727) 2025-03-21 21:20:40 +00:00
activations_test.cc Refactor t2-6 (#3373) 2026-01-30 17:36:53 +00:00
add.cc
add.h
add_common.cc
add_n.cc fixes (#3342) 2026-01-24 17:10:55 -08:00
add_n_test.cc Refactor t2-6 (#3373) 2026-01-30 17:36:53 +00:00
add_test.cc Refactor t2-6 (#3373) 2026-01-30 17:36:53 +00:00
arg_min_max.cc
arg_min_max_test.cc Refactor t2-6 (#3373) 2026-01-30 17:36:53 +00:00
assign_variable.cc feat(compression): allocate resource variables in persistent buffer (#3013) 2024-12-16 16:48:04 +00:00
batch_matmul.cc Re-enable 3D x 2D BatchMatMul dimension collapse for adj_x=true (#3599) 2026-07-08 15:32:05 +00:00
batch_matmul.h Fix quant specific op registration for some ops (#2770) 2025-02-07 03:02:49 +00:00
batch_matmul_common.cc Fix quant specific op registration for some ops (#2770) 2025-02-07 03:02:49 +00:00
batch_matmul_test.cc Re-enable 3D x 2D BatchMatMul dimension collapse for adj_x=true (#3599) 2026-07-08 15:32:05 +00:00
batch_to_space_nd.cc
batch_to_space_nd_test.cc Refactor t2-6 (#3373) 2026-01-30 17:36:53 +00:00
broadcast_args.cc
broadcast_args_test.cc Refactor t2-6 (#3373) 2026-01-30 17:36:53 +00:00
broadcast_to.cc Add const-tensor checks (#3141) 2025-08-08 03:58:51 +00:00
broadcast_to_test.cc Refactor t2-6 (#3373) 2026-01-30 17:36:53 +00:00
BUILD [T2] Refactor Group 9z: Compression (#3393) 2026-02-03 17:50:04 +00:00
call_once.cc
call_once_test.cc [T2] Refactor Group 7 (#3374) 2026-02-02 17:49:11 +00:00
cast.cc Return error on wrong tensor type for CAST (#3248) 2025-11-10 09:25:39 -08:00
cast_test.cc [T2] Refactor Group 7 (#3374) 2026-02-02 17:49:11 +00:00
ceil.cc
ceil_test.cc [T2] Refactor Group 7 (#3374) 2026-02-02 17:49:11 +00:00
circular_buffer.cc Add Reset support to CircularBuffer op (#3618) 2026-07-08 21:34:43 +00:00
circular_buffer.h
circular_buffer_common.cc
circular_buffer_flexbuffers_generated_data.cc
circular_buffer_flexbuffers_generated_data.h
circular_buffer_test.cc Add Reset support to CircularBuffer op (#3618) 2026-07-08 21:34:43 +00:00
comparisons.cc Add 16bit support for unpack, transpose and comparisons operators (#3028) 2025-03-17 16:44:48 +00:00
comparisons_test.cc [T2] Refactor Group 7 (#3374) 2026-02-02 17:49:11 +00:00
concatenation.cc feat(compression): implement tensor decompression in op concatenation (#3014) 2024-12-16 17:46:34 +00:00
concatenation_test.cc [T2] Refactor Group 7 (#3374) 2026-02-02 17:49:11 +00:00
conv.cc Ensure int64 accumulation for bias-less 16x8 ops in TFLM kernels (#3598) 2026-06-16 23:58:19 +00:00
conv.h feat(compression): implement tensor decompression in op conv (#3015) 2024-12-16 20:01:05 +00:00
conv_common.cc Fix missing includes for printf (#3023) 2024-12-19 00:21:00 +00:00
conv_test.cc Typo in code (#3447) 2026-02-11 20:34:42 +00:00
conv_test.h [T2] Refactor Group 9z: Compression (#3393) 2026-02-03 17:50:04 +00:00
conv_test_common.cc [T2] Refactor Group 9z: Compression (#3393) 2026-02-03 17:50:04 +00:00
cumsum.cc
cumsum_test.cc [T2] Refactor Group 7 (#3374) 2026-02-02 17:49:11 +00:00
decode.cc Support for DECODE operator (#3213) 2025-11-19 14:14:53 -08:00
decode_state.cc Support for DECODE operator (#3188) 2025-10-31 21:56:21 +00:00
decode_state.h Support for DECODE operator (#3188) 2025-10-31 21:56:21 +00:00
decode_state_huffman.cc Solve compiler errors in decode op (#3284) 2026-01-12 08:50:34 +01:00
decode_state_huffman.h Solve compiler errors in decode op (#3284) 2026-01-12 08:50:34 +01:00
decode_state_huffman_test.cc Typo in code (#3447) 2026-02-11 20:34:42 +00:00
decode_state_lut.cc Solve compiler errors in decode op (#3284) 2026-01-12 08:50:34 +01:00
decode_state_lut.h Support for DECODE operator (#3132) 2025-10-17 09:36:56 -07:00
decode_state_lut_test.cc [T2] Refactor Group 8: Decode (#3375) 2026-02-03 17:50:27 +00:00
decode_state_prune.cc Solve compiler errors in decode op (#3284) 2026-01-12 08:50:34 +01:00
decode_state_prune.h Support for DECODE operator (#3162) 2025-10-23 09:31:22 -07:00
decode_state_prune_test.cc [T2] Refactor Group 8: Decode (#3375) 2026-02-03 17:50:27 +00:00
decode_test.cc Typo in code (#3447) 2026-02-11 20:34:42 +00:00
decode_test_helpers.h [T2] Refactor Group 8: Decode (#3375) 2026-02-03 17:50:27 +00:00
decompress.cc feat(compression): add decompression library (#2996) 2024-12-10 01:51:56 +00:00
decompress.h feat(compression): add decompression library (#2996) 2024-12-10 01:51:56 +00:00
decompress_common.cc feat(compression): add decompression library (#2996) 2024-12-10 01:51:56 +00:00
decompress_test.cc [T2] Refactor Group 8: Decode (#3375) 2026-02-03 17:50:27 +00:00
depth_to_space.cc
depth_to_space_test.cc [T2] Refactor Group 9 (#3376) 2026-02-02 17:49:36 +00:00
depthwise_conv.cc feat(compression): implement tensor decompression in op depthwise conv (#3017) 2024-12-16 23:16:35 +00:00
depthwise_conv.h
depthwise_conv_common.cc Fix missing includes for printf (#3023) 2024-12-19 00:21:00 +00:00
depthwise_conv_test.cc Typo in code (#3447) 2026-02-11 20:34:42 +00:00
dequantize.cc
dequantize.h
dequantize_common.cc
dequantize_test.cc [T2] Refactor Group 9 (#3376) 2026-02-02 17:49:36 +00:00
detection_postprocess.cc
detection_postprocess_flexbuffers_generated_data.cc
detection_postprocess_flexbuffers_generated_data.h
detection_postprocess_test.cc [T2] Refactor Group 9 (#3376) 2026-02-02 17:49:36 +00:00
div.cc
div_test.cc [T2] Refactor Group 9 (#3376) 2026-02-02 17:49:36 +00:00
dynamic_update_slice.cc Porting Dynamic_Update_Slice operator from TFLite (#3246) 2025-11-10 09:22:59 -08:00
dynamic_update_slice.h Porting Dynamic_Update_Slice operator from TFLite (#3246) 2025-11-10 09:22:59 -08:00
dynamic_update_slice_test.cc [T2] Refactor Group 9 (#3376) 2026-02-02 17:49:36 +00:00
elementwise.cc
elementwise_test.cc Refactor t2-10 (#3377) 2026-01-30 17:37:47 +00:00
elu.cc
elu_test.cc Refactor t2-10 (#3377) 2026-01-30 17:37:47 +00:00
embedding_lookup.cc
embedding_lookup_test.cc Refactor t2-10 (#3377) 2026-01-30 17:37:47 +00:00
ethosu.cc
ethosu.h
exp.cc
exp_test.cc Refactor t2-10 (#3377) 2026-01-30 17:37:47 +00:00
expand_dims.cc Add const-tensor checks (#3141) 2025-08-08 03:58:51 +00:00
expand_dims_test.cc Refactor t2-10 (#3377) 2026-01-30 17:37:47 +00:00
fill.cc Add const-tensor checks (#3141) 2025-08-08 03:58:51 +00:00
fill_test.cc [T2] Refactor Group 11 (#3378) 2026-02-02 17:50:01 +00:00
floor.cc
floor_div.cc
floor_div_test.cc [T2] Refactor Group 11 (#3378) 2026-02-02 17:50:01 +00:00
floor_mod.cc
floor_mod_test.cc [T2] Refactor Group 11 (#3378) 2026-02-02 17:50:01 +00:00
floor_test.cc [T2] Refactor Group 11 (#3378) 2026-02-02 17:50:01 +00:00
fully_connected.cc Ensure int64 accumulation for bias-less 16x8 ops in TFLM kernels (#3598) 2026-06-16 23:58:19 +00:00
fully_connected.h feat(compression): implement tensor decompression in op fully_connected (#3006) 2024-12-13 04:47:55 +00:00
fully_connected_common.cc Add 16bit support for unpack, transpose and comparisons operators (#3028) 2025-03-17 16:44:48 +00:00
fully_connected_test.cc [T2] Refactor Group 9z: Compression (#3393) 2026-02-03 17:50:04 +00:00
gather.cc
gather_nd.cc
gather_nd_test.cc Refactor t2-12 (#3379) 2026-01-30 17:38:14 +00:00
gather_test.cc Refactor t2-12 (#3379) 2026-01-30 17:38:14 +00:00
hard_swish.cc
hard_swish.h
hard_swish_common.cc
hard_swish_test.cc Refactor t2-12 (#3379) 2026-01-30 17:38:14 +00:00
if.cc
if_test.cc Refactor t2-12 (#3379) 2026-01-30 17:38:14 +00:00
kernel_runner.cc feat(compression): extend interpreter to handle compressed tensors (#3002) 2024-12-10 22:59:08 +00:00
kernel_runner.h Support for DECODE operator (#3213) 2025-11-19 14:14:53 -08:00
kernel_util.cc WHILE operator input/output copy fix (#3633) 2026-07-20 17:58:59 +00:00
kernel_util.h feat(compression): implement tensor decompression in op fully_connected (#3006) 2024-12-13 04:47:55 +00:00
l2_pool_2d.cc
l2_pool_2d_test.cc Refactor t2-13 (#3380) 2026-01-30 23:27:34 +00:00
l2norm.cc
l2norm_test.cc Refactor t2-13 (#3380) 2026-01-30 23:27:34 +00:00
leaky_relu.cc
leaky_relu.h
leaky_relu_common.cc
leaky_relu_test.cc Refactor t2-13 (#3380) 2026-01-30 23:27:34 +00:00
log_softmax.cc
log_softmax_test.cc Refactor t2-13 (#3380) 2026-01-30 23:27:34 +00:00
logical.cc
logical.h
logical_common.cc
logical_test.cc Refactor t2-14 (#3381) 2026-01-30 18:13:09 +00:00
logistic.cc
logistic.h
logistic_common.cc
logistic_test.cc Refactor t2-14 (#3381) 2026-01-30 18:13:09 +00:00
lstm_eval.cc Typo in code (#3447) 2026-02-11 20:34:42 +00:00
lstm_eval.h Typo in code (#3447) 2026-02-11 20:34:42 +00:00
lstm_eval_common.cc Typo in code (#3447) 2026-02-11 20:34:42 +00:00
lstm_eval_test.cc Typo in code (#3447) 2026-02-11 20:34:42 +00:00
lstm_eval_test.h Refactor t2-14 (#3381) 2026-01-30 18:13:09 +00:00
lstm_shared.h Typo in code (#3447) 2026-02-11 20:34:42 +00:00
Makefile.inc Porting Dynamic_Update_Slice operator from TFLite (#3246) 2025-11-10 09:22:59 -08:00
maximum_minimum.cc CMSIS-NN Min Max int8 support (#2753) 2025-02-05 01:33:16 +00:00
maximum_minimum.h CMSIS-NN Min Max int8 support (#2753) 2025-02-05 01:33:16 +00:00
maximum_minimum_test.cc [T2] Refactor Group 15 (#3382) 2026-01-30 18:13:27 +00:00
micro_ops.h Porting Reduce_All reference operator porting from TFLite to TFLM (#3269) 2026-01-08 10:34:29 -08:00
micro_tensor_utils.cc
micro_tensor_utils.h
mirror_pad.cc
mirror_pad_test.cc [T2] Refactor Group 15 (#3382) 2026-01-30 18:13:27 +00:00
mul.cc
mul.h
mul_common.cc
mul_test.cc [T2] Refactor Group 15 (#3382) 2026-01-30 18:13:27 +00:00
neg.cc
neg_test.cc [T2] Refactor Group 15 (#3382) 2026-01-30 18:13:27 +00:00
pack.cc PACK/UNPACK update (#3175) 2025-08-20 23:08:50 +00:00
pack_test.cc [T2] Refactor Group 15 (#3382) 2026-01-30 18:13:27 +00:00
pad.cc add deps (#3093) 2025-04-15 13:53:55 -07:00
pad.h Add support for CMSIS-NN int8 transpose and padding operators (#2757) 2025-03-20 22:27:29 +00:00
pad_common.cc Use consistent const-tensor checks (#3139) 2025-08-02 03:28:21 +00:00
pad_test.cc [T2] Refactor Group 15 (#3382) 2026-01-30 18:13:27 +00:00
pooling.cc
pooling.h
pooling_common.cc Added checks to ensure input, output quantization params are same. (#3056) 2025-04-04 17:16:17 +00:00
pooling_test.cc [T2] Refactor Group 15 (#3382) 2026-01-30 18:13:27 +00:00
prelu.cc PRelu Int16x8 Ref C support (#3191) 2025-09-09 14:55:34 +00:00
prelu.h
prelu_common.cc PRelu Int16x8 Ref C support (#3191) 2025-09-09 14:55:34 +00:00
prelu_test.cc [T2] Refactor Group 15 (#3382) 2026-01-30 18:13:27 +00:00
quantization_util_test.cc [T2] Refactor Group 16 (#3383) 2026-02-02 17:50:50 +00:00
quantize.cc
quantize.h
quantize_common.cc
quantize_test.cc [T2] Refactor Group 16 (#3383) 2026-02-02 17:50:50 +00:00
read_variable.cc
README.md
reduce.cc Porting Reduce_All reference operator porting from TFLite to TFLM (#3269) 2026-01-08 10:34:29 -08:00
reduce.h Refactor: Use scratch buffers for reduce kernel (#3281) 2026-01-16 17:21:16 +00:00
reduce_common.cc Refactor: Use scratch buffers for reduce kernel (#3281) 2026-01-16 17:21:16 +00:00
reduce_test.cc Typo in code (#3447) 2026-02-11 20:34:42 +00:00
reshape.cc
reshape.h
reshape_common.cc
reshape_test.cc [T2] Refactor Group 16 (#3383) 2026-02-02 17:50:50 +00:00
resize_bilinear.cc Use consistent const-tensor checks (#3139) 2025-08-02 03:28:21 +00:00
resize_bilinear_test.cc [T2] Refactor Group 16 (#3383) 2026-02-02 17:50:50 +00:00
resize_nearest_neighbor.cc Updated the CREF code of the resize nearest neighbor operator to use the half_pixel_centers attribute from params. (#3279) 2026-02-10 15:23:00 +00:00
resize_nearest_neighbor_test.cc [T2] Refactor Group 16 (#3383) 2026-02-02 17:50:50 +00:00
reverse.cc Porting Reverse_V2 operator from TFLite (#3123) 2025-07-10 15:47:37 -04:00
reverse_test.cc [T2] Refactor Group 16 (#3383) 2026-02-02 17:50:50 +00:00
round.cc
round_test.cc [T2] Refactor Group 16 (#3383) 2026-02-02 17:50:50 +00:00
select.cc
select_test.cc Refactor t2-17 (#3384) 2026-01-30 18:13:44 +00:00
shape.cc
shape_test.cc Refactor t2-17 (#3384) 2026-01-30 18:13:44 +00:00
slice.cc
slice_test.cc Refactor t2-17 (#3384) 2026-01-30 18:13:44 +00:00
softmax.cc
softmax.h
softmax_common.cc
softmax_test.cc Refactor t2-17 (#3384) 2026-01-30 18:13:44 +00:00
space_to_batch_nd.cc
space_to_batch_nd_test.cc Refactor t2-17 (#3384) 2026-01-30 18:13:44 +00:00
space_to_depth.cc
space_to_depth_test.cc Refactor t2-17 (#3384) 2026-01-30 18:13:44 +00:00
split.cc Use consistent const-tensor checks (#3139) 2025-08-02 03:28:21 +00:00
split_test.cc [T2] Refactor Group 18 (#3385) 2026-01-30 18:26:38 +00:00
split_v.cc Use consistent const-tensor checks (#3139) 2025-08-02 03:28:21 +00:00
split_v_test.cc [T2] Refactor Group 18 (#3385) 2026-01-30 18:26:38 +00:00
squared_difference.cc
squared_difference_test.cc [T2] Refactor Group 18 (#3385) 2026-01-30 18:26:38 +00:00
squeeze.cc
squeeze_test.cc [T2] Refactor Group 18 (#3385) 2026-01-30 18:26:38 +00:00
strided_slice.cc
strided_slice.h
strided_slice_common.cc Add const-tensor checks (#3141) 2025-08-08 03:58:51 +00:00
strided_slice_test.cc [T2] Refactor Group 18 (#3385) 2026-01-30 18:26:38 +00:00
sub.cc Add INT32 support to SUB (#3037) 2025-06-04 16:34:13 +00:00
sub.h
sub_common.cc Add INT32 support to SUB (#3037) 2025-06-04 16:34:13 +00:00
sub_test.cc [T2] Refactor Group 18 (#3385) 2026-01-30 18:26:38 +00:00
svdf.cc
svdf.h
svdf_common.cc
svdf_test.cc [T2] Refactor Group 18 (#3385) 2026-01-30 18:26:38 +00:00
tanh.cc
tanh_test.cc [T2] Refactor Group 19 (#3386) 2026-02-02 17:51:09 +00:00
transpose.cc add deps (#3093) 2025-04-15 13:53:55 -07:00
transpose.h Add support for CMSIS-NN int8 transpose and padding operators (#2757) 2025-03-20 22:27:29 +00:00
transpose_common.cc Add const-tensor checks (#3141) 2025-08-08 03:58:51 +00:00
transpose_conv.cc Added activation function for CREF code of transpose_conv operator. (#3278) 2026-02-10 15:23:45 +00:00
transpose_conv.h feat(compression): implement tensor decompression in op transpose conv (#3018) 2024-12-16 21:42:02 +00:00
transpose_conv_test.cc [T2] Refactor Group 9z: Compression (#3393) 2026-02-03 17:50:04 +00:00
transpose_test.cc [T2] Refactor Group 19 (#3386) 2026-02-02 17:51:09 +00:00
unidirectional_sequence_lstm.cc
unidirectional_sequence_lstm.h
unidirectional_sequence_lstm_test.cc [T2] Refactor Group 19 (#3386) 2026-02-02 17:51:09 +00:00
unpack.cc PACK/UNPACK update (#3175) 2025-08-20 23:08:50 +00:00
unpack_test.cc [T2] Refactor Group 19 (#3386) 2026-02-02 17:51:09 +00:00
var_handle.cc
while.cc WHILE operator input/output copy fix (#3633) 2026-07-20 17:58:59 +00:00
while_test.cc WHILE operator input/output copy fix (#3633) 2026-07-20 17:58:59 +00:00
zeros_like.cc
zeros_like_test.cc [T2] Refactor Group 19 (#3386) 2026-02-02 17:51:09 +00:00

Info

  • Porting Ops from Lite to Micro explains, step-by-step, the code changes necessary to port an op from lite to micro, and the process of submitting them for review and acceptance by the project.