Skip to content

Commit 7142c82

Browse files
authored
Merge pull request #1281 from pytorch/data_loader
chore: Fix data loader issues and nox file paths
2 parents f16ac7b + 3b45c80 commit 7142c82

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

examples/int8/training/vgg16/export_qat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def test(model, dataloader, crit):
8181
quant_nn.TensorQuantizer.use_fb_fake_quant = True
8282
with torch.no_grad():
8383
data = iter(testing_dataloader)
84-
images, _ = data.next()
84+
images, _ = next(data)
8585
jit_model = torch.jit.trace(model, images.to("cuda"))
8686
torch.jit.save(jit_model, "trained_vgg16_qat.jit.pt")
8787

noxfile.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,8 @@ def run_trt_compatibility_tests(session):
268268
copy_model(session)
269269
session.chdir(os.path.join(TOP_DIR, "tests/py"))
270270
tests = [
271-
"test_trt_intercompatibility.py",
272-
"test_ptq_trt_calibrator.py",
271+
"integrations/test_trt_intercompatibility.py",
272+
# "ptq/test_ptq_trt_calibrator.py",
273273
]
274274
for test in tests:
275275
if USE_HOST_DEPS:
@@ -295,7 +295,7 @@ def run_multi_gpu_tests(session):
295295
print("Running multi GPU tests")
296296
session.chdir(os.path.join(TOP_DIR, "tests/py"))
297297
tests = [
298-
"test_multi_gpu.py",
298+
"hw/test_multi_gpu.py",
299299
]
300300
for test in tests:
301301
if USE_HOST_DEPS:

py/torch_tensorrt/ptq.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def get_batch(self, names):
2828
if self.current_batch_idx + self.batch_size > len(self.data_loader.dataset):
2929
return None
3030

31-
batch = self.dataset_iterator.next()
31+
batch = next(self.dataset_iterator)
3232
self.current_batch_idx += self.batch_size
3333
inputs_gpu = []
3434
if isinstance(batch, list):

tests/py/ptq/test_ptq_trt_calibrator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def get_batch(self, names):
7575
):
7676
return None
7777

78-
batch = self.dataset_iterator.next()
78+
batch = next(self.dataset_iterator)
7979
self.current_batch_idx += self.batch_size
8080
# Treat the first element as input and others as targets.
8181
if isinstance(batch, list):

0 commit comments

Comments
 (0)