in Synthesis_incorporation/benchmarks/stackoverflow_benchmarks.py [0:0]
def stackoverflow_06():
examples = [
benchmark.Example(
inputs=[
[3, 5, 0, 2, 3, 3, 0],
],
output=[
[1, 0, 0, 0, 1, 1, 0],
[0, 1, 0, 0, 0, 0, 0],
[0, 0, 1, 0, 0, 0, 1],
[0, 0, 0, 1, 0, 0, 0],
[1, 0, 0, 0, 1, 1, 0],
[1, 0, 0, 0, 1, 1, 0],
[0, 0, 1, 0, 0, 0, 1],
],
# [
# [1.0, 0.0, 0.0, 0.0, 1.0, 1.0, 0.0],
# [0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0],
# [0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0],
# [0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0],
# [1.0, 0.0, 0.0, 0.0, 1.0, 1.0, 0.0],
# [1.0, 0.0, 0.0, 0.0, 1.0, 1.0, 0.0],
# [0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0],
# ],
),
]
constants = []
description = "binary tensor from vector indicating if elements are equal"
target_program = "torch.eq(in1, torch.unsqueeze(in1, dim=1)).float()"
source = "https://stackoverflow.com/questions/47816231/create-binary-tensor-from-vector-in-tensorflow"
return benchmark.Benchmark(
examples=examples,
constants=constants,
description=description,
target_program=target_program,
source=source,
name="stackoverflow_06",
)