(imgs)
| 409 | |
| 410 | @torch.inference_mode() |
| 411 | def pytorch2numpy(imgs): |
| 412 | results = [] |
| 413 | for x in imgs: |
| 414 | y = x.movedim(0, -1) |
| 415 | y = y * 127.5 + 127.5 |
| 416 | y = y.detach().float().cpu().numpy().clip(0, 255).astype(np.uint8) |
| 417 | results.append(y) |
| 418 | return results |
| 419 | |
| 420 | |
| 421 | @torch.inference_mode() |
nothing calls this directly
no outgoing calls
no test coverage detected