Copy the data to a host tensor. Args: t (Tensor): a Tensor Returns: new Tensor at host
(t)
| 908 | |
| 909 | |
| 910 | def to_host(t): |
| 911 | '''Copy the data to a host tensor. |
| 912 | |
| 913 | Args: |
| 914 | t (Tensor): a Tensor |
| 915 | |
| 916 | Returns: |
| 917 | new Tensor at host |
| 918 | ''' |
| 919 | ret = t.clone() |
| 920 | ret.to_host() |
| 921 | return ret |
| 922 | |
| 923 | |
| 924 | def to_numpy(t): |