Add bindings for .cpu() & .cuda() to script (#15904)
authorElias Ellison <eellison@fb.com>
Fri, 11 Jan 2019 18:00:37 +0000 (10:00 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Fri, 11 Jan 2019 18:04:08 +0000 (10:04 -0800)
commit3d0d16d31c9465c2d5ed915e0c8957bdfac8eed9
treee496727a2d94ee2cb80eb2eaa096dcb3c25355af
parent03a570cad9aa4e2a423c15db545e729a180833c3
Add bindings for .cpu() & .cuda() to script (#15904)

Summary:
Adding bindings for .cpu() and .cuda() to script.

It's worth noting that if the device remains unchanged, than the returned tensor aliases the input, but if it does change than they do not alias each other.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/15904

Differential Revision: D13632879

Pulled By: eellison

fbshipit-source-id: 024a04f267909674aa1e510562efd9cb081f407c
test/test_jit.py
torch/csrc/jit/register_prim_ops.cpp