ForEach¶
- class laminar.configurations.layers.ForEach(parameters: ~typing.Iterable[~laminar.configurations.layers.Parameter] = <factory>)¶
Bases:
object
Configures a layer to perform a grid-foreach over the configured properties.
Notes
In order to foreach over each element of a layer, the layer’s artifact must be sharded. See Layer.shard().
If Parameter(index=None), ForEach will include artifacts from all Layer splits.
Usage:
@Flow.register(foreach=ForEach(...))
Methods
Generate a grid of all combinations of foreach inputs.
Join together multiple artifact splits of a layer into a single Archive.
Set a foreach layer's parameters given the inputs from the foreach grid.
Get the splits of the ForEach grid.
Attributes
Parameters to configure the foreach with.
- __init__(parameters: ~typing.Iterable[~laminar.configurations.layers.Parameter] = <factory>)¶
- grid(*, layer: Layer) list[dict[Layer, dict[str, int]]] ¶
Generate a grid of all combinations of foreach inputs.
- join(*, layer: Layer, name: str) Archive ¶
Join together multiple artifact splits of a layer into a single Archive.