(self, value)
| 263 | return None |
| 264 | |
| 265 | def _regularize_value(self, value): |
| 266 | if isinstance(value, np.ndarray): |
| 267 | return value |
| 268 | |
| 269 | elif isinstance(value, torch.distributed.tensor.DTensor): |
| 270 | return value.to_local().cpu().numpy() |
| 271 | elif isinstance(value, torch.Tensor): |
| 272 | return torch_to_numpy(value) |
| 273 | raise TypeError( |
| 274 | f'Expected numpy.ndarray or torch.Tensor, got {type(value)}') |
no test coverage detected