act
Activation factory wrapper around
torch_geometric.nn.resolver.
Thin wrapper around torch_geometric.nn.resolver.activation_resolver that returns
None when act is None, so callers don't need a None guard before assigning
the result. Exists for API symmetry with create_norm, which adds dimensionality
support that PyG's resolver does not have.
Functions:
-
create_act–Resolve an activation, returning
Noneforact=None.
create_act
¶
Resolve an activation, returning None for act=None.
Parameters:
-
act(Union[str, Callable, None]) –Activation name (e.g.,
"relu","leaky_relu"), a class, an instance, orNone. -
**act_kwargs(Any, default:{}) –Forwarded to the activation constructor (ignored if
actis already an instance).
Returns:
-
Optional[Module]–The instantiated activation module, or
Noneifact is None.