MCPcopy Create free account
hub / github.com/pytorch/tutorials / imshow

Function imshow

advanced_source/neural_style_tutorial.py:129–136  ·  view source on GitHub ↗
(tensor, title=None)

Source from the content-addressed store, hash-verified

127plt.ion()
128
129def imshow(tensor, title=None):
130 image = tensor.cpu().clone() # we clone the tensor to not do changes on it
131 image = image.squeeze(0) # remove the fake batch dimension
132 image = unloader(image)
133 plt.imshow(image)
134 if title is not None:
135 plt.title(title)
136 plt.pause(0.001) # pause a bit so that plots are updated
137
138
139plt.figure()

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected