Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ca2baff

Browse files
ptrblckmcarilli
authored andcommitted
Remove unused tensor in fast_collate (#281)
* remove unused tens tensor in example/imagenet/main_amp.py * remove unused tens tensor in deprecated examples and tests/L1
1 parent 03a25ba commit ca2baff

6 files changed

Lines changed: 0 additions & 6 deletions

File tree

examples/deprecated_api/imagenet/main.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ def fast_collate(batch):
8080
tensor = torch.zeros( (len(imgs), 3, h, w), dtype=torch.uint8 )
8181
for i, img in enumerate(imgs):
8282
nump_array = np.asarray(img, dtype=np.uint8)
83-
tens = torch.from_numpy(nump_array)
8483
if(nump_array.ndim < 3):
8584
nump_array = np.expand_dims(nump_array, axis=-1)
8685
nump_array = np.rollaxis(nump_array, 2)

examples/deprecated_api/imagenet/main_amp.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ def fast_collate(batch):
7979
tensor = torch.zeros( (len(imgs), 3, h, w), dtype=torch.uint8 )
8080
for i, img in enumerate(imgs):
8181
nump_array = np.asarray(img, dtype=np.uint8)
82-
tens = torch.from_numpy(nump_array)
8382
if(nump_array.ndim < 3):
8483
nump_array = np.expand_dims(nump_array, axis=-1)
8584
nump_array = np.rollaxis(nump_array, 2)

examples/deprecated_api/imagenet/main_fp16_optimizer.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ def fast_collate(batch):
8383
tensor = torch.zeros( (len(imgs), 3, h, w), dtype=torch.uint8 )
8484
for i, img in enumerate(imgs):
8585
nump_array = np.asarray(img, dtype=np.uint8)
86-
tens = torch.from_numpy(nump_array)
8786
if(nump_array.ndim < 3):
8887
nump_array = np.expand_dims(nump_array, axis=-1)
8988
nump_array = np.rollaxis(nump_array, 2)

examples/deprecated_api/imagenet/main_reducer.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ def fast_collate(batch):
7979
tensor = torch.zeros( (len(imgs), 3, h, w), dtype=torch.uint8 )
8080
for i, img in enumerate(imgs):
8181
nump_array = np.asarray(img, dtype=np.uint8)
82-
tens = torch.from_numpy(nump_array)
8382
if(nump_array.ndim < 3):
8483
nump_array = np.expand_dims(nump_array, axis=-1)
8584
nump_array = np.rollaxis(nump_array, 2)

examples/imagenet/main_amp.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ def fast_collate(batch):
8282
tensor = torch.zeros( (len(imgs), 3, h, w), dtype=torch.uint8 )
8383
for i, img in enumerate(imgs):
8484
nump_array = np.asarray(img, dtype=np.uint8)
85-
tens = torch.from_numpy(nump_array)
8685
if(nump_array.ndim < 3):
8786
nump_array = np.expand_dims(nump_array, axis=-1)
8887
nump_array = np.rollaxis(nump_array, 2)

tests/L1/common/main_amp.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ def fast_collate(batch):
8686
tensor = torch.zeros( (len(imgs), 3, h, w), dtype=torch.uint8 )
8787
for i, img in enumerate(imgs):
8888
nump_array = np.asarray(img, dtype=np.uint8)
89-
tens = torch.from_numpy(nump_array)
9089
if(nump_array.ndim < 3):
9190
nump_array = np.expand_dims(nump_array, axis=-1)
9291
nump_array = np.rollaxis(nump_array, 2)

0 commit comments

Comments
 (0)