phlower.nn.VertexConcatenate

class phlower.nn.VertexConcatenate(unbatch_keys=None)[source]

Bases: Module, IGenericPhlowerCoreModule[IPhlowerLayerParameters, PhlowerTensor]

Concatenate vertex tensors in input order.

The shape pattern determines the vertex axis. All other axes, including time and feature axes, must have matching sizes. In a Phlower graph, input_keys specifies the concatenation order.

Parameters:

unbatch_keys (dict[str, str] | None, optional) – Map each input key to a simulation-field reference with matching per-sample vertex counts. Required for sample-wise concatenation when multiple samples are batched along the vertex axis. Samples remain contiguous, with inputs in input order within each sample. When None, concatenate whole input tensors.

Methods

forward(data, *[, field_data])

Append vertices along the axis given by the input shape pattern.

from_setting(setting)

Create the concatenation module for a resolved graph.

get_nn_name()

Return the module name used in YAML.

Attributes

T_destination

call_super_init

dump_patches

training

forward(data, *, field_data=None, **kwargs)[source]

Append vertices along the axis given by the input shape pattern.

Parameters:
  • data (IPhlowerTensorCollections) – Vertex tensors with the same vertex axis and matching shapes along the other axes.

  • field_data (ISimulationField | None, optional) – Per-input batch references, required when unbatch_keys is set.

Returns:

A tensor with the combined vertex count and input shape pattern.

Return type:

PhlowerTensor

classmethod from_setting(setting)[source]

Create the concatenation module for a resolved graph.

Parameters:

setting (VertexConcatenateSetting)

Return type:

Self

classmethod get_nn_name()[source]

Return the module name used in YAML.

Return type:

str