MCPcopy Create free account
hub / github.com/ROCm/AMDMIGraphX / create_buffer

Function create_buffer

test/py/test_cpu.py:46–53  ·  view source on GitHub ↗
(t, data, shape)

Source from the content-addressed store, hash-verified

44
45
46def create_buffer(t, data, shape):
47 a = array.array(t, data)
48 if sys.version_info >= (3, 0):
49 m = memoryview(a.tobytes())
50 return m.cast(t, shape)
51 else:
52 m = memoryview(a.tostring())
53 return m
54
55
56def test_add_scalar():

Callers 1

test_add_scalarFunction · 0.70

Calls 2

arrayMethod · 0.80
castMethod · 0.80

Tested by

no test coverage detected