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

Function test_add_op

test/py/test_module_construct.py:33–43  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

31
32
33def test_add_op():
34 p = migraphx.program()
35 mm = p.get_main_module()
36 x = mm.add_literal(create_buffer('f', [1.0] * 9, (3, 3)))
37 y = mm.add_literal(create_buffer('f', [2.0] * 9, (3, 3)))
38 add_op = mm.add_instruction(migraphx.op("add"), [x, y])
39 mm.add_return([add_op])
40 p.compile(migraphx.get_target("ref"))
41 params = {}
42 output = p.run(params)[-1].tolist()
43 assert output == list([3.0] * 9)
44
45
46def test_if_then_else():

Callers 1

Calls 10

programMethod · 0.80
get_main_moduleMethod · 0.80
get_targetMethod · 0.80
create_bufferFunction · 0.70
add_literalMethod · 0.45
add_instructionMethod · 0.45
opMethod · 0.45
add_returnMethod · 0.45
compileMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected