def stackoverflow_35()

in Synthesis_incorporation/benchmarks/stackoverflow_benchmarks.py [0:0]


def stackoverflow_35():
    examples = [
        benchmark.Example(
            inputs=[
                [
                    [[1.0, 2.0], [3.0, 4.0], [5.0, 6.0]],
                    [[10.0, 20.0], [30.0, 40.0], [50.0, 60.0]],
                ],
                [
                    [[9.0, 8.0], [7.0, 6.0], [5.0, 4.0]],
                    [[90.0, 80.0], [70.0, 60.0], [50.0, 40.0]],
                ],
                [0.1, 0.4, 0.8],
            ],
            output=[
                [[8.2, 7.4], [5.4, 5.2], [5.0, 5.6]],
                [[82.0, 74.0], [54.0, 52.0], [50.0, 56.0]],
            ],
        ),
    ]
    constants = []
    description = "linear interpolation between two tensors"
    target_program = (
        "torch.add(in2, torch.mul(torch.unsqueeze(in3, 1), torch.sub(in1, in2)))"
    )
    source = "https://stackoverflow.com/questions/49643371/keras-compute-convex-combination-of-two-tensors"
    return benchmark.Benchmark(
        examples=examples,
        constants=constants,
        description=description,
        target_program=target_program,
        source=source,
        name="stackoverflow_35",
    )