Skip to content

Commit 204f698

Browse files
committed
cleanup commnet, variable names
1 parent e9efdd8 commit 204f698

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

test/common_utils.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,6 @@ def make_image_pil(*args, **kwargs):
401401

402402

403403
def make_image_cvcuda(*args, batch_dims=(1,), **kwargs):
404-
# explicitly default batch_dims to (1,) since to_cvcuda_tensor requires a batch dimension (ndims == 4)
405404
return to_cvcuda_tensor(make_image(*args, batch_dims=batch_dims, **kwargs))
406405

407406

test/test_transforms_v2.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2617,10 +2617,10 @@ def test_functional(self, make_input, input_dtype, output_dtype, device, scale):
26172617
@pytest.mark.parametrize("scale", (True, False))
26182618
@pytest.mark.parametrize("as_dict", (True, False))
26192619
def test_transform(self, make_input, input_dtype, output_dtype, device, scale, as_dict):
2620-
input = make_input(dtype=input_dtype, device=device)
2620+
inpt = make_input(dtype=input_dtype, device=device)
26212621
if as_dict:
2622-
output_dtype = {type(input): output_dtype}
2623-
check_transform(transforms.ToDtype(dtype=output_dtype, scale=scale), input, check_sample_input=not as_dict)
2622+
output_dtype = {type(inpt): output_dtype}
2623+
check_transform(transforms.ToDtype(dtype=output_dtype, scale=scale), inpt, check_sample_input=not as_dict)
26242624

26252625
def reference_convert_dtype_image_tensor(self, image, dtype=torch.float, scale=False):
26262626
input_dtype = image.dtype
@@ -2696,14 +2696,14 @@ def test_image_correctness(self, input_dtype, output_dtype, device, scale, make_
26962696
if input_dtype == torch.uint8 and output_dtype == torch.uint16 and device == "cuda":
26972697
pytest.xfail("uint8 to uint16 conversion is not supported on cuda")
26982698

2699-
input = make_input(dtype=input_dtype, device=device)
2700-
out = F.to_dtype(input, dtype=output_dtype, scale=scale)
2699+
inpt = make_input(dtype=input_dtype, device=device)
2700+
out = F.to_dtype(inpt, dtype=output_dtype, scale=scale)
27012701

27022702
if make_input == make_image_cvcuda:
2703-
input = F.cvcuda_to_tensor(input)
2703+
inpt = F.cvcuda_to_tensor(inpt)
27042704
out = F.cvcuda_to_tensor(out)
27052705

2706-
expected = self.reference_convert_dtype_image_tensor(input, dtype=output_dtype, scale=scale)
2706+
expected = self.reference_convert_dtype_image_tensor(inpt, dtype=output_dtype, scale=scale)
27072707

27082708
atol = self._get_dtype_conversion_atol(input_dtype, output_dtype, scale)
27092709
torch.testing.assert_close(out, expected, rtol=0, atol=atol)

0 commit comments

Comments
 (0)