Skip to content

Commit ba6e19d

Browse files
awaelchlilantiga
authored andcommitted
Make introduction example run on devices (#18097)
(cherry picked from commit b8d4a70)
1 parent 22cdd10 commit ba6e19d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/source-pytorch/starter/introduction.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ Once you've trained the model you can export to onnx, torchscript and put it int
204204
encoder.eval()
205205
206206
# embed 4 fake images!
207-
fake_image_batch = Tensor(4, 28 * 28)
207+
fake_image_batch = torch.rand(4, 28 * 28, device=autoencoder.device)
208208
embeddings = encoder(fake_image_batch)
209209
print("" * 20, "\nPredictions (4 image embeddings):\n", embeddings, "\n", "" * 20)
210210

0 commit comments

Comments
 (0)