pytorch/benchmarks/operator_benchmark/operator_benchmark.py
Mingzhe Li 31089b02ce introduce a new interface to add op [core changes] (#21147)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/21147

This diff introduces a new interface to add PT/C2 operators to the benchmark suite.

The following steps are needed to add a new operator:
1. Specify the input shapes, args to an operator in configs
2. Create a PT/C2 benchmark class which includes ```init``` (create tensors),  ```forward``` (specify the operator to be tested.), and ```backward```(gradient of an op.) methods
3. call generate_pt_test/generate_c2_test to create test cases based on configs

Reviewed By: zheng-xq

Differential Revision: D15250380

fbshipit-source-id: 1025a7cf60d2427baa0f3f716455946d3d3e6a27
2019-05-31 09:21:04 -07:00

8 lines
348 B
Python

from __future__ import absolute_import, division, print_function, unicode_literals
# TODO (mingzhe09088): get rid of noqa
import benchmark_runner # noqa
from benchmark_pytorch import TorchBenchmarkBase # noqa
from benchmark_caffe2 import Caffe2BenchmarkBase # noqa
from benchmark_test_generator import * # noqa
from benchmark_utils import * # noqa