Enhance front-end to add op (#19433)
authorMingzhe Li <mingzhe0908@fb.com>
Fri, 19 Apr 2019 00:03:56 +0000 (17:03 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Fri, 19 Apr 2019 00:07:02 +0000 (17:07 -0700)
commit45d5b6be48caae761970d6d4c99e4ed8bc82263e
treebdeb64abe7cf308e0de6d33c153e0130a21fb209
parentedf77fe64ae2f9becfbc1848721b096a14bcd820
Enhance front-end to add op (#19433)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19433

For operator benchmark project, we need to cover a lot of operators, so the interface for adding operators needs to be very clean and simple. This diff is implementing a new interface to add op.

Here is the logic to add new operator to the benchmark:
```
long_config = {}
short_config = {}

map_func

add_test(
  [long_config, short_config],
  map_func,
  [caffe2 op]
  [pt op]
)
```

Reviewed By: zheng-xq

Differential Revision: D14791191

fbshipit-source-id: ac6738507cf1b9d6013dc8e546a2022a9b177f05
benchmarks/operator_benchmark/benchmark_core.py
benchmarks/operator_benchmark/benchmark_runner.py
benchmarks/operator_benchmark/benchmark_test_generator.py [new file with mode: 0644]
benchmarks/operator_benchmark/benchmark_utils.py
benchmarks/operator_benchmark/ops/add.py
benchmarks/operator_benchmark/ops/matmul.py