Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 2 additions & 18 deletions test/test_functional_tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1030,25 +1030,9 @@ def test_resized_crop(device, mode):
(F_t.adjust_contrast, (1.0,)),
(F_t.adjust_hue, (-0.5,)),
(F_t.adjust_saturation, (2.0,)),
(
F_t.pad,
(
[
2,
],
2,
"constant",
),
),
(F_t.pad, ([2], 2, "constant")),
(F_t.resize, ([10, 11],)),
(
F_t.perspective,
(
[
0.2,
]
),
),
(F_t.perspective, ([0.2])),
(F_t.gaussian_blur, ((2, 2), (0.7, 0.5))),
(F_t.invert, ()),
(F_t.posterize, (0,)),
Expand Down
7 changes: 1 addition & 6 deletions torchvision/transforms/functional_tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,12 +570,7 @@ def _cast_squeeze_out(img: Tensor, need_cast: bool, need_squeeze: bool, out_dtyp

def _apply_grid_transform(img: Tensor, grid: Tensor, mode: str, fill: Optional[List[float]]) -> Tensor:

img, need_cast, need_squeeze, out_dtype = _cast_squeeze_in(
img,
[
grid.dtype,
],
)
img, need_cast, need_squeeze, out_dtype = _cast_squeeze_in(img, [grid.dtype])

if img.shape[0] > 1:
# Apply same grid to a batch of images
Expand Down