Skip to content

Commit 5501bfe

Browse files
talcsNicolasHug
andauthored
Mentioning the padding policy in transforms.GaussianBlur docs (#8246)
Co-authored-by: Nicolas Hug <[email protected]> Co-authored-by: Nicolas Hug <[email protected]>
1 parent 6c10d08 commit 5501bfe

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

torchvision/transforms/functional.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -1307,7 +1307,9 @@ def erase(img: Tensor, i: int, j: int, h: int, w: int, v: Tensor, inplace: bool
13071307

13081308

13091309
def gaussian_blur(img: Tensor, kernel_size: List[int], sigma: Optional[List[float]] = None) -> Tensor:
1310-
"""Performs Gaussian blurring on the image by given kernel.
1310+
"""Performs Gaussian blurring on the image by given kernel
1311+
1312+
The convolution will be using reflection padding corresponding to the kernel size, to maintain the input shape.
13111313
If the image is torch Tensor, it is expected
13121314
to have [..., H, W] shape, where ... means at most one leading dimension.
13131315

torchvision/transforms/v2/_misc.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,9 @@ def _transform(self, inpt: Any, params: Dict[str, Any]) -> Any:
166166

167167

168168
class GaussianBlur(Transform):
169-
"""Blurs image with randomly chosen Gaussian blur.
169+
"""Blurs image with randomly chosen Gaussian blur kernel.
170+
171+
The convolution will be using reflection padding corresponding to the kernel size, to maintain the input shape.
170172
171173
If the input is a Tensor, it is expected
172174
to have [..., C, H, W] shape, where ... means an arbitrary number of leading dimensions.

0 commit comments

Comments
 (0)