@@ -359,21 +359,18 @@ class Pad(torch.nn.Module):
359
359
padding_mode (str): Type of padding. Should be: constant, edge, reflect or symmetric.
360
360
Default is constant.
361
361
362
- - constant: pads with a constant value, this value is specified with fill
362
+ - constant: pads with a constant value, this value is specified with fill.
363
363
364
- - edge: pads with the last value at the edge of the image
364
+ - edge: pads with the last value at the edge of the image.
365
+ If input a 5D torch Tensor, the last 3 dimensions will be padded instead of the last 2
365
366
366
- If input a 5D torch Tensor, the last 3 dimensions will be padded instead of the last 2
367
+ - reflect: pads with reflection of image without repeating the last value on the edge.
368
+ For example, padding [1, 2, 3, 4] with 2 elements on both sides in reflect mode
369
+ will result in [3, 2, 1, 2, 3, 4, 3, 2]
367
370
368
- - reflect: pads with reflection of image without repeating the last value on the edge
369
-
370
- For example, padding [1, 2, 3, 4] with 2 elements on both sides in reflect mode
371
- will result in [3, 2, 1, 2, 3, 4, 3, 2]
372
-
373
- - symmetric: pads with reflection of image repeating the last value on the edge
374
-
375
- For example, padding [1, 2, 3, 4] with 2 elements on both sides in symmetric mode
376
- will result in [2, 1, 1, 2, 3, 4, 4, 3]
371
+ - symmetric: pads with reflection of image repeating the last value on the edge.
372
+ For example, padding [1, 2, 3, 4] with 2 elements on both sides in symmetric mode
373
+ will result in [2, 1, 1, 2, 3, 4, 4, 3]
377
374
"""
378
375
379
376
def __init__ (self , padding , fill = 0 , padding_mode = "constant" ):
@@ -544,21 +541,18 @@ class RandomCrop(torch.nn.Module):
544
541
padding_mode (str): Type of padding. Should be: constant, edge, reflect or symmetric.
545
542
Default is constant.
546
543
547
- - constant: pads with a constant value, this value is specified with fill
548
-
549
- - edge: pads with the last value at the edge of the image
550
-
551
- If input a 5D torch Tensor, the last 3 dimensions will be padded instead of the last 2
552
-
553
- - reflect: pads with reflection of image without repeating the last value on the edge
544
+ - constant: pads with a constant value, this value is specified with fill.
554
545
555
- For example, padding [1, 2, 3, 4] with 2 elements on both sides in reflect mode
556
- will result in [3, 2, 1, 2, 3, 4, 3, 2]
546
+ - edge: pads with the last value at the edge of the image.
547
+ If input a 5D torch Tensor, the last 3 dimensions will be padded instead of the last 2
557
548
558
- - symmetric: pads with reflection of image repeating the last value on the edge
549
+ - reflect: pads with reflection of image without repeating the last value on the edge.
550
+ For example, padding [1, 2, 3, 4] with 2 elements on both sides in reflect mode
551
+ will result in [3, 2, 1, 2, 3, 4, 3, 2]
559
552
560
- For example, padding [1, 2, 3, 4] with 2 elements on both sides in symmetric mode
561
- will result in [2, 1, 1, 2, 3, 4, 4, 3]
553
+ - symmetric: pads with reflection of image repeating the last value on the edge.
554
+ For example, padding [1, 2, 3, 4] with 2 elements on both sides in symmetric mode
555
+ will result in [2, 1, 1, 2, 3, 4, 4, 3]
562
556
"""
563
557
564
558
@staticmethod
0 commit comments