mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
See https://github.com/pytorch/pytorch/pull/129751#issue-2380881501. Most changes are auto-generated by linter. You can review these PRs via: ```bash git diff --ignore-all-space --ignore-blank-lines HEAD~1 ``` Pull Request resolved: https://github.com/pytorch/pytorch/pull/129754 Approved by: https://github.com/ezyang
35 lines
962 B
Python
35 lines
962 B
Python
import pytest # noqa: F401
|
|
|
|
|
|
default_rnns = [
|
|
"cudnn",
|
|
"aten",
|
|
"jit",
|
|
"jit_premul",
|
|
"jit_premul_bias",
|
|
"jit_simple",
|
|
"jit_multilayer",
|
|
"py",
|
|
]
|
|
default_cnns = ["resnet18", "resnet18_jit", "resnet50", "resnet50_jit"]
|
|
all_nets = default_rnns + default_cnns
|
|
|
|
|
|
def pytest_generate_tests(metafunc):
|
|
# This creates lists of tests to generate, can be customized
|
|
if metafunc.cls.__name__ == "TestBenchNetwork":
|
|
metafunc.parametrize("net_name", all_nets, scope="class")
|
|
metafunc.parametrize(
|
|
"executor", [metafunc.config.getoption("executor")], scope="class"
|
|
)
|
|
metafunc.parametrize(
|
|
"fuser", [metafunc.config.getoption("fuser")], scope="class"
|
|
)
|
|
|
|
|
|
def pytest_addoption(parser):
|
|
parser.addoption("--fuser", default="old", help="fuser to use for benchmarks")
|
|
parser.addoption(
|
|
"--executor", default="legacy", help="executor to use for benchmarks"
|
|
)
|