(t1)
| 92 | |
| 93 | |
| 94 | def print_t(t1): |
| 95 | d = t1.device() |
| 96 | t1.ToHost() |
| 97 | if t1.data_type() == singa_api.kInt: |
| 98 | print(t1.GetIntValue(t1.Size())) |
| 99 | elif t1.data_type() == singa_api.kFloat32: |
| 100 | print(t1.GetFloatValue(t1.Size())) |
| 101 | t1.ToDevice(d) |
| 102 | |
| 103 | |
| 104 | class TestAPI(unittest.TestCase): |