in Synthesis_incorporation/benchmarks/stackoverflow_benchmarks.py [0:0]
def stackoverflow_44():
examples = [
benchmark.Example(
inputs=[
[
# [3, 5, 2],
# [6, 2, 3],
# [8, 7, 1],
# [0, -3, 5],
# [-4, 7, 3],
# [2, 1, 6],
# [10, 20, 30],
# [4, 5, 6],
[3, 5, 2],
[6, 2, 3],
[8, 7, 1],
[0, 3, 5],
[4, 7, 3],
[2, 1, 6],
[10, 20, 30],
[4, 5, 6],
],
],
output=[[9, 7, 5], [8, 19, 6], [6, 8, 9], [14, 25, 36]]
# [[9, 7, 5], [8, 4, 6], [-2, 8, 9], [14, 25, 36]],
),
]
constants = [2]
description = "sum across columns for pairs of consecutive rows"
target_program = "torch.sum(torch.reshape(in1, (-1, 2, in1.size(1))), 1)"
source = "https://stackoverflow.com/questions/54402389/sum-the-columns-for-each-two-consecutive-rows-of-a-tensor-of-3-dimensions"
return benchmark.Benchmark(
examples=examples,
constants=constants,
description=description,
target_program=target_program,
source=source,
name="stackoverflow_44",
)