ParameterLike#
- class penzai.nn.parameters.ParameterLike[source]#
-
Protocol for a parameter-like object.
ParameterLike
defines the common API for parameters inpenzai.nn
. Any parameterized network layer should annotate its parameters asParameterLike
, and should not make assumptions about the exact implementation ofParameterLike
used.ParameterLike
is a protocol, which means implementations of it do not have to explicitly subclass it. If you definevalue
as a dataclass attribute rather than a property, you should avoid subclassingParameterLike
directly, since Python’s ABC system will not see that as an implementation of the method.Methods
__init__
(*args, **kwargs)Attributes
The value of the parameter.
- abstract property value: T#
The value of the parameter. May raise an error for some instances.