Copy the data to a host tensor. Args: t (Tensor): a Tensor Returns: new Tensor at host
(t)
| 875 | |
| 876 | |
| 877 | def to_host(t): |
| 878 | '''Copy the data to a host tensor. |
| 879 | |
| 880 | Args: |
| 881 | t (Tensor): a Tensor |
| 882 | |
| 883 | Returns: |
| 884 | new Tensor at host |
| 885 | ''' |
| 886 | ret = t.clone() |
| 887 | ret.to_host() |
| 888 | return ret |
| 889 | |
| 890 | |
| 891 | def to_numpy(t): |