A parameter to be optimized by an optimizer.
| 28 | |
| 29 | @dataclasses.dataclass |
| 30 | class OptParam: |
| 31 | """A parameter to be optimized by an optimizer.""" |
| 32 | |
| 33 | value: Tensor |
| 34 | factorization_spec: Optional[FactorizationSpec] |
| 35 | weight_decay_scale: Optional[float] |
| 36 | |
| 37 | @property |
| 38 | def dtype(self): |
| 39 | return self.value.dtype |
| 40 | |
| 41 | @property |
| 42 | def shape(self): |
| 43 | return self.value.shape |
| 44 | |
| 45 | |
| 46 | # NestedOptParam = Union[OptParam, Dict[str, "NestedOptParam"]] |
no outgoing calls