SequenceIndicesLayer
✖
SequenceIndicesLayer
represents a net layer that produces a list of indices for an input sequence.
Details and Options

- SequenceIndicesLayer[…] takes a sequence of arrays and outputs a sequence of integers of the same length.
- SequenceIndicesLayer is typically used inside NetChain, NetGraph, etc.
- The following optional parameter can be included:
-
"Maximum" Infinity maximum index to output - SequenceIndicesLayer["Maximum"max] corresponds to the function Min[max,Range[Length[#]]]&.
- The input and output ports of the net represented by SequenceIndicesLayer[] are:
-
"Input" a sequence of n arrays "Output" a sequence of n arrays - SequenceIndicesLayer["Input"shape] allows the shape of the input to be specified. Possible forms for shape include:
-
n a sequence of n numbers "Varying" a sequence of numbers of varying length {len,d1,d2,…} sequence of len arrays of dimensions d1×d2×… {"Varying",d1,d2,…} varying number of arrays of dimensions d1×d2×… - Options[SequenceIndicesLayer] gives the list of default options to construct the layer. Options[SequenceIndicesLayer[…]] gives the list of default options to evaluate the layer on some data.
- Information[SequenceIndicesLayer[…]] gives a report about the layer.
- Information[SequenceIndicesLayer[…],prop] gives the value of the property prop of SequenceIndicesLayer[…]. Possible properties are the same as for NetGraph.
Examples
open allclose allBasic Examples (1)Summary of the most common use cases
Create a SequenceIndicesLayer that expects a sequence of vectors of size 3:

https://wolfram.com/xid/08t85c5q3vx8tya-87km7g

Apply the layer to a sequence of vectors:

https://wolfram.com/xid/08t85c5q3vx8tya-2pkt8a

Scope (2)Survey of the scope of standard use cases
Ports (2)
Create a SequenceIndicesLayer that expects a length-3 sequence of 2x2 matrices:

https://wolfram.com/xid/08t85c5q3vx8tya-ffymn6

Apply the layer to a sequence:

https://wolfram.com/xid/08t85c5q3vx8tya-pu4p9f

Create a SequenceIndicesLayer that expects a sequence of real numbers:

https://wolfram.com/xid/08t85c5q3vx8tya-eckrfu

Thread the layer across a batch of inputs:

https://wolfram.com/xid/08t85c5q3vx8tya-kb3a3

Options (1)Common values & functionality for each option
"Maximum" (1)
Create a SequenceIndicesLayer that returns a maximum index of 3:

https://wolfram.com/xid/08t85c5q3vx8tya-6fq0gd

Apply the layer to a sequence:

https://wolfram.com/xid/08t85c5q3vx8tya-esf7qn

Possible Issues (1)Common pitfalls and unexpected behavior
SequenceIndicesLayer cannot accept symbolic inputs:

https://wolfram.com/xid/08t85c5q3vx8tya-ggaxyd


https://wolfram.com/xid/08t85c5q3vx8tya-56whoo


Wolfram Research (2021), SequenceIndicesLayer, Wolfram Language function, https://reference.wolfram.com/language/ref/SequenceIndicesLayer.html.
Text
Wolfram Research (2021), SequenceIndicesLayer, Wolfram Language function, https://reference.wolfram.com/language/ref/SequenceIndicesLayer.html.
Wolfram Research (2021), SequenceIndicesLayer, Wolfram Language function, https://reference.wolfram.com/language/ref/SequenceIndicesLayer.html.
CMS
Wolfram Language. 2021. "SequenceIndicesLayer." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/SequenceIndicesLayer.html.
Wolfram Language. 2021. "SequenceIndicesLayer." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/SequenceIndicesLayer.html.
APA
Wolfram Language. (2021). SequenceIndicesLayer. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/SequenceIndicesLayer.html
Wolfram Language. (2021). SequenceIndicesLayer. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/SequenceIndicesLayer.html
BibTeX
@misc{reference.wolfram_2025_sequenceindiceslayer, author="Wolfram Research", title="{SequenceIndicesLayer}", year="2021", howpublished="\url{https://reference.wolfram.com/language/ref/SequenceIndicesLayer.html}", note=[Accessed: 12-May-2025
]}
BibLaTeX
@online{reference.wolfram_2025_sequenceindiceslayer, organization={Wolfram Research}, title={SequenceIndicesLayer}, year={2021}, url={https://reference.wolfram.com/language/ref/SequenceIndicesLayer.html}, note=[Accessed: 12-May-2025
]}