Scan¶

Scan can be used to iterate over one or more scan_input tensors, constructing zero or more scan_output tensors. It combines ideas from general recurrences, functional programming constructs such as scan, fold, map, and zip, and is intended to enable generalizations of RNN-like constructs for sequenc…

Abstract Signature:

Scan(initial_state_and_scan_inputs, body, num_scan_inputs: int, scan_input_axes: List[int], scan_input_directions: List[int], scan_output_axes: List[int], scan_output_directions: List[int])

Keras

API: keras.ops.scan
Strategy: Direct Mapping

TensorFlow

API: tf.scan
Strategy: Direct Mapping

Flax NNX

API: nnx.transforms.iteration.scan
Strategy: Direct Mapping