Skip to content

Commit 46ffbf1

Browse files
authored
fix max/min shadowing
1 parent d391349 commit 46ffbf1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

torchvision/utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ def make_grid(
6060
assert isinstance(range, tuple), \
6161
"range has to be a tuple (min, max) if specified. min and max are numbers"
6262

63-
def norm_ip(img, min, max):
64-
img.clamp_(min=min, max=max)
65-
img.add_(-min).div_(max(max - min, 1e-5))
63+
def norm_ip(img, low, high):
64+
img.clamp_(min=low, max=high)
65+
img.sub_(low).div_(max(high - low, 1e-5))
6666

6767
def norm_range(t, range):
6868
if range is not None:

0 commit comments

Comments
 (0)