Skip to content

Commit c332a7f

Browse files
authored
Removed copy=False in torch.from_numpy in MNIST to avoid warning (#4184)
1 parent 1e0f794 commit c332a7f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

torchvision/datasets/mnist.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ def read_sn3_pascalvincent_tensor(path: str, strict: bool = True) -> torch.Tenso
496496
s = [get_int(data[4 * (i + 1): 4 * (i + 2)]) for i in range(nd)]
497497
parsed = np.frombuffer(data, dtype=m[1], offset=(4 * (nd + 1)))
498498
assert parsed.shape[0] == np.prod(s) or not strict
499-
return torch.from_numpy(parsed.astype(m[2], copy=False)).view(*s)
499+
return torch.from_numpy(parsed.astype(m[2])).view(*s)
500500

501501

502502
def read_label_file(path: str) -> torch.Tensor:

0 commit comments

Comments
 (0)