From: Edward Yang Date: Wed, 13 Mar 2019 15:35:26 +0000 (-0700) Subject: Fix lint in test_utils.py (#17944) X-Git-Tag: accepted/tizen/6.5/unified/20211028.231830~830 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9089182ce40d026efd8c4256fbf3e6db02865a85;p=platform%2Fupstream%2Fpytorch.git Fix lint in test_utils.py (#17944) Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/17944 ghimport-source-id: 5b45086428b5a36e737882c78f285141121fd1bc Stack: * **#17944 Fix lint in test_utils.py** Signed-off-by: Edward Z. Yang Differential Revision: D14430132 fbshipit-source-id: b00de7b4c685645ad5a4dc8c5fe6ce7e1893a3eb --- diff --git a/test/test_utils.py b/test/test_utils.py index b0afba5..0c78bb8 100644 --- a/test/test_utils.py +++ b/test/test_utils.py @@ -201,7 +201,7 @@ class TestCheckpoint(TestCase): ) def test_checkpoint_rng_cpu(self): - for i in range(5): + for _ in range(5): inp = torch.randn(20000, device='cpu').requires_grad_() phase1 = torch.nn.Dropout() phase2 = torch.nn.Dropout() @@ -229,7 +229,7 @@ class TestCheckpoint(TestCase): @unittest.skipIf(not HAS_CUDA, 'No CUDA') def test_checkpoint_rng_cuda(self): - for i in range(5): + for _ in range(5): inp = torch.randn(20000, device='cuda').requires_grad_() phase1 = torch.nn.Dropout() phase2 = torch.nn.Dropout() @@ -325,7 +325,7 @@ class TestBottleneck(TestCase): import subprocess from common_utils import PY3 - p = subprocess.Popen(command, stdout=subprocess.PIPE, + p = subprocess.Popen(command, stdout=subprocess.PIPE, # noqa stderr=subprocess.PIPE, shell=True) output, err = p.communicate() rc = p.returncode