(items)
| 20 | from mmcv.runner import get_dist_info, init_dist |
| 21 | |
| 22 | def round_float(items): |
| 23 | if isinstance(items, list): |
| 24 | return [round_float(item) for item in items] |
| 25 | elif isinstance(items, float): |
| 26 | return round(items, 3) |
| 27 | elif isinstance(items, np.ndarray): |
| 28 | return round_float(float(items)) |
| 29 | elif isinstance(items, torch.Tensor): |
| 30 | return round_float(items.detach().cpu().numpy()) |
| 31 | else: |
| 32 | return items |
| 33 | |
| 34 | def train_one_epoch(model: torch.nn.Module, |
| 35 | criterion: torch.nn.Module, |
no test coverage detected