MCPcopy Index your code
hub / github.com/pytorch/tutorials / imshow

Function imshow

beginner_source/transfer_learning_tutorial.py:113–123  ·  view source on GitHub ↗

Display image for Tensor.

(inp, title=None)

Source from the content-addressed store, hash-verified

111# augmentations.
112
113def imshow(inp, title=None):
114 """Display image for Tensor."""
115 inp = inp.numpy().transpose((1, 2, 0))
116 mean = np.array([0.485, 0.456, 0.406])
117 std = np.array([0.229, 0.224, 0.225])
118 inp = std * inp + mean
119 inp = np.clip(inp, 0, 1)
120 plt.imshow(inp)
121 if title is not None:
122 plt.title(title)
123 plt.pause(0.001) # pause a bit so that plots are updated
124
125
126# Get a batch of training data

Callers 3

visualize_modelFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected