This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import torch | |
import torchvision | |
from matplotlib import pyplot as plt | |
# from PIL import Image | |
def show_tensor(tensor, transpose=None, normalize=None, figsize=(10,10), nrow=None, padding=2, verbose=True, **kwargs): | |
"""Convenient function for visualizing tensors of any shape, supports batch_size.""" | |
if not isinstance(tensor, torch.Tensor): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import torch | |
import torchvision | |
from matplotlib import pyplot as plt | |
# from PIL import Image | |
def show_tensor( | |
tensor, |