From 5da7b74d488b9336a60e016d6165fd8fd54ea383 Mon Sep 17 00:00:00 2001 From: Mingzhe Li Date: Fri, 19 Apr 2019 16:22:12 -0700 Subject: [PATCH] fix AI-PEP path error (#19514) Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/19514 as title Reviewed By: hl475 Differential Revision: D15018499 fbshipit-source-id: 9ce38e3a577432e0575a6743f5dcd2e907d3ab9d --- .../operator_benchmark/ops/benchmark_all_test.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/benchmarks/operator_benchmark/ops/benchmark_all_test.py b/benchmarks/operator_benchmark/ops/benchmark_all_test.py index 7c9bae8160b6..f7a4b11df04b 100644 --- a/benchmarks/operator_benchmark/ops/benchmark_all_test.py +++ b/benchmarks/operator_benchmark/ops/benchmark_all_test.py @@ -3,14 +3,11 @@ from __future__ import division from __future__ import print_function from __future__ import unicode_literals -import importlib -import os from benchmarks.operator_benchmark import benchmark_runner +from benchmarks.operator_benchmark.ops import ( # noqa + add_test, # noqa + matmul_test) # noqa + if __name__ == "__main__": - # TODO: current way of importing other tests are fragile, so we need to have a robust way - for module in os.listdir(os.path.dirname(__file__)): - if module == '__init__.py' or not module.endswith('_test.py'): - continue - importlib.import_module("benchmarks.operator_benchmark.ops." + module[:-3]) benchmark_runner.main()