def log_image(self, key: str, global_step: int, epoch: int, img_tensor: Tensor):
    img = img_tensor.data.permute(1, 2, 0).cpu().numpy()
    matplotlib.image.imsave(os.path.join(self.logdir, f'{key}.png'), img)
def log_image(self, key: str, global_step: int, epoch: int, img_tensor: Tensor):
    img = img_tensor.data.permute(1, 2, 0).cpu().numpy()
    matplotlib.image.imsave(os.path.join(self.logdir, f'{key}.png'), img)