fix python version error (#71021)

Summary:
if python3 is the one running the tests but there exists a "python" installed as python2.7 the test will fail with a syntax issue

Pull Request resolved: https://github.com/pytorch/pytorch/pull/71021

Reviewed By: zou3519

Differential Revision: D33667073

Pulled By: albanD

fbshipit-source-id: 8e489b491439be1740fc32ca5c7cdceb2145771e
(cherry picked from commit 5adfece429fcfe6ace778dd67f060d04a3d54699)
This commit is contained in:
Rishi Puri
2022-01-20 17:01:53 -08:00
committed by PyTorch MergeBot
parent e2dc2aca93
commit 76fd3cfd38

View File

@ -17,7 +17,8 @@ class TestFunctionalAutogradBenchmark(TestCase):
# is not allowed to open it again. As this is a simple smoke test, we choose for now
# not to run this on windows and keep the code here simple.
with tempfile.NamedTemporaryFile() as out_file:
cmd = ['python', '../benchmarks/functional_autograd_benchmark/functional_autograd_benchmark.py']
cmd = ['python3',
'../benchmarks/functional_autograd_benchmark/functional_autograd_benchmark.py']
# Only run the warmup
cmd += ['--num-iters', '0']
# Only run the vjp task (fastest one)