(name, img)
| 88 | images_dict = tensor2numpy(images_dict) |
| 89 | |
| 90 | def preprocess(name, img): |
| 91 | if not (len(img.shape) == 3 or len(img.shape) == 4): |
| 92 | raise NotImplementedError("invalid img shape {}:{} in save_images".format(name, img.shape)) |
| 93 | if len(img.shape) == 3: |
| 94 | img = img[:, np.newaxis, :, :] |
| 95 | img = torch.from_numpy(img[:1]) |
| 96 | return vutils.make_grid(img, padding=0, nrow=1, normalize=True, scale_each=True) |
| 97 | |
| 98 | for key, value in images_dict.items(): |
| 99 | if not isinstance(value, (list, tuple)): |