(state: dict[str, Any], key: str)
| 223 | |
| 224 | |
| 225 | def _shape_list_from_state(state: dict[str, Any], key: str) -> list[int] | None: |
| 226 | tensor = state.get(key) |
| 227 | if tensor is None or not hasattr(tensor, "shape"): |
| 228 | return None |
| 229 | return [int(x) for x in tuple(tensor.shape)] |
| 230 | |
| 231 | |
| 232 | def _resolve_scale_keys_from_config(cfg: Any | None) -> list[float]: |