reservoirpy.ops.merge#

class reservoirpy.ops.merge(
*models: Node | Model | Sequence[Node | Model],
)[source]#

Merge different Model or Node instances into a single Model instance.

Node instances contained in the models to merge will be gathered in a single model, along with all previously defined connections between them, if they exists.

You can also perform this operation using the & operator:

model = (node1 >> node2) & (node1 >> node3))

This is equivalent to:

model = merge((node1 >> node2), (node1 >> node3))

The in-place operator can also be used:

model &= other_model

Which is equivalent to:

model.update_graph(other_model.nodes, other_model.edges)
Parameters:
  • model (Model or Node) – First node or model to merge.

  • *models (Model or Node) – All models to merge.

Returns:

A new Model instance.

Return type:

Model