Skip to content

Commit 7a8e452

Browse files
NicolasHugfacebook-github-bot
authored andcommitted
[fbsync] Mentioning the padding policy in transforms.GaussianBlur docs (#8246)
Reviewed By: vmoens Differential Revision: D55062807 fbshipit-source-id: 9284b54f77d6664bab5714bdfac2314691413718 Co-authored-by: Nicolas Hug <[email protected]> Co-authored-by: Nicolas Hug <[email protected]>
1 parent 0ce9194 commit 7a8e452

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

torchvision/transforms/functional.py

Lines changed: 3 additions & 1 deletion
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

Lines changed: 3 additions & 1 deletion
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)