AddDict#

class deeplay.components.dict.AddDict(*args, **kwargs)#

Bases: DeeplayModule

Element-wise addition of two dictionaries.

Parameters#

keysTuple[str]

Specifies the keys to be added element-wise.

Constraints#

  • Both dictionaries ‘x’ (base) and ‘y’ (addition) must contain the same keys for the addition operation.

  • ‘x’: Dict[str, Any] or torch_geometric.data.Data.

  • ‘y’: Dict[str, Any] or torch_geometric.data.Data.

Methods Summary

forward(x, y)

Define the computation performed at every call.

Methods Documentation

forward(x: Dict[str, Any] | Data, y: Dict[str, Any]) Dict[str, Any] | Data#

Define the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.