Skip to content

Commit 32b2ad8

Browse files
Improve addcdiv_out test coverage: add missing benchmark for addcdiv_out (flagos-ai#3073)
1 parent e71279d commit 32b2ad8

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

benchmark/test_addcdiv.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,23 @@ def test_addcdiv():
2121
dtypes=consts.FLOAT_DTYPES,
2222
)
2323
bench.run()
24+
25+
26+
def _input_fn_out(shape, dtype, device):
27+
inp1 = utils.generate_tensor_input(shape, dtype, device)
28+
inp2 = utils.generate_tensor_input(shape, dtype, device)
29+
inp3 = utils.generate_tensor_input(shape, dtype, device)
30+
out = torch.empty_like(inp1)
31+
32+
yield inp1, inp2, inp3, {"value": 0.5, "out": out}
33+
34+
35+
@pytest.mark.addcdiv_out
36+
def test_addcdiv_out():
37+
bench = base.GenericBenchmark(
38+
op_name="addcdiv_out",
39+
input_fn=_input_fn_out,
40+
torch_op=torch.addcdiv,
41+
dtypes=consts.FLOAT_DTYPES,
42+
)
43+
bench.run()

0 commit comments

Comments
 (0)