Skip to content

Commit edfede4

Browse files
tchatonthomas
authored andcommitted
Update auto_encoder.py to accomodate torchvision breaking change (#18996)
Co-authored-by: thomas <[email protected]> (cherry picked from commit cb23fc2)
1 parent 69fc0b4 commit edfede4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

examples/pytorch/basics/autoencoder.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def __init__(
4444
nrow: int = 8,
4545
padding: int = 2,
4646
normalize: bool = True,
47-
norm_range: Optional[Tuple[int, int]] = None,
47+
value_range: Optional[Tuple[int, int]] = None,
4848
scale_each: bool = False,
4949
pad_value: int = 0,
5050
) -> None:
@@ -56,7 +56,7 @@ def __init__(
5656
padding: Amount of padding. Default: ``2``.
5757
normalize: If ``True``, shift the image to the range (0, 1),
5858
by the min and max values specified by :attr:`range`. Default: ``False``.
59-
norm_range: Tuple (min, max) where min and max are numbers,
59+
value_range: Tuple (min, max) where min and max are numbers,
6060
then these numbers are used to normalize the image. By default, min and max
6161
are computed from the tensor.
6262
scale_each: If ``True``, scale each image in the batch of
@@ -71,7 +71,7 @@ def __init__(
7171
self.nrow = nrow
7272
self.padding = padding
7373
self.normalize = normalize
74-
self.norm_range = norm_range
74+
self.value_range = value_range
7575
self.scale_each = scale_each
7676
self.pad_value = pad_value
7777

@@ -81,7 +81,7 @@ def _to_grid(self, images):
8181
nrow=self.nrow,
8282
padding=self.padding,
8383
normalize=self.normalize,
84-
value_range=self.norm_range,
84+
value_range=self.value_range,
8585
scale_each=self.scale_each,
8686
pad_value=self.pad_value,
8787
)

0 commit comments

Comments
 (0)