Skip to content

Commit

Permalink
Update auto_encoder.py to accomodate torchvision breaking change (#18996
Browse files Browse the repository at this point in the history
)

Co-authored-by: thomas <[email protected]>
(cherry picked from commit cb23fc2)
  • Loading branch information
tchaton authored and lantiga committed Nov 15, 2023
1 parent 69fc0b4 commit edfede4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions examples/pytorch/basics/autoencoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def __init__(
nrow: int = 8,
padding: int = 2,
normalize: bool = True,
norm_range: Optional[Tuple[int, int]] = None,
value_range: Optional[Tuple[int, int]] = None,
scale_each: bool = False,
pad_value: int = 0,
) -> None:
Expand All @@ -56,7 +56,7 @@ def __init__(
padding: Amount of padding. Default: ``2``.
normalize: If ``True``, shift the image to the range (0, 1),
by the min and max values specified by :attr:`range`. Default: ``False``.
norm_range: Tuple (min, max) where min and max are numbers,
value_range: Tuple (min, max) where min and max are numbers,
then these numbers are used to normalize the image. By default, min and max
are computed from the tensor.
scale_each: If ``True``, scale each image in the batch of
Expand All @@ -71,7 +71,7 @@ def __init__(
self.nrow = nrow
self.padding = padding
self.normalize = normalize
self.norm_range = norm_range
self.value_range = value_range
self.scale_each = scale_each
self.pad_value = pad_value

Expand All @@ -81,7 +81,7 @@ def _to_grid(self, images):
nrow=self.nrow,
padding=self.padding,
normalize=self.normalize,
value_range=self.norm_range,
value_range=self.value_range,
scale_each=self.scale_each,
pad_value=self.pad_value,
)
Expand Down

0 comments on commit edfede4

Please sign in to comment.