MCPcopy Create free account
hub / github.com/apache/singa / print_t

Function print_t

test/python/test_api.py:94–101  ·  view source on GitHub ↗
(t1)

Source from the content-addressed store, hash-verified

92
93
94def 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
104class TestAPI(unittest.TestCase):

Callers

nothing calls this directly

Calls 5

deviceMethod · 0.80
ToHostMethod · 0.80
data_typeMethod · 0.80
SizeMethod · 0.45
ToDeviceMethod · 0.45

Tested by

no test coverage detected