Skip to content

Commit

Permalink
Fixed bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmadsharif1 committed Feb 1, 2024
1 parent e0e056f commit 3547f83
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/test_transforms_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -5007,6 +5007,14 @@ def test_image_correctness(self, fn):
print(f"ahmad: {expected.shape=} {actual.shape=}")
assert_equal(actual, expected, rtol=0, atol=1)

def test_expanded_channels_are_not_views_into_the_same_underlying_tensor(self):
image = make_image(dtype=torch.uint8, device="cpu", color_space="GRAY")

output_image = F.grayscale_to_rgb(image)
assert_equal(output_image[0][0][0], output_image[1][0][0])
output_image[0][0][0] = output_image[0][0][0] + 1
assert output_image[0][0][0] != output_image[1][0][0]


class TestRandomZoomOut:
# Tests are light because this largely relies on the already tested `pad` kernels.
Expand Down

0 comments on commit 3547f83

Please sign in to comment.