Skip to content

Commit

Permalink
Fix jit doc model loading example
Browse files Browse the repository at this point in the history
  • Loading branch information
ssnl committed Nov 17, 2020
1 parent 49f0e5d commit 6199e42
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/source/jit.rst
Expand Up @@ -547,10 +547,10 @@ best practices?

cpu_model = gpu_model.cpu()
sample_input_cpu = sample_input_gpu.cpu()
traced_cpu = torch.jit.trace(traced_cpu, sample_input_cpu)
traced_cpu = torch.jit.trace(cpu_model, sample_input_cpu)
torch.jit.save(traced_cpu, "cpu.pth")

traced_gpu = torch.jit.trace(traced_gpu, sample_input_gpu)
traced_gpu = torch.jit.trace(gpu_model, sample_input_gpu)
torch.jit.save(traced_gpu, "gpu.pth")

# ... later, when using the model:
Expand Down

0 comments on commit 6199e42

Please sign in to comment.