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 [source] ΒΆ
Resolve an activation, returning None for act=None.
Parameters:
-
act(Union[str, Callable, None]) βActivation name (e.g.,
"relu","leaky_relu";"swish"resolves tonn.SiLU), 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.