Unverified Commit c332a7f5 authored by Joe Early's avatar Joe Early Committed by GitHub
Browse files

Removed copy=False in torch.from_numpy in MNIST to avoid warning (#4184)

parent 1e0f7942
......@@ -496,7 +496,7 @@ def read_sn3_pascalvincent_tensor(path: str, strict: bool = True) -> torch.Tenso
s = [get_int(data[4 * (i + 1): 4 * (i + 2)]) for i in range(nd)]
parsed = np.frombuffer(data, dtype=m[1], offset=(4 * (nd + 1)))
assert parsed.shape[0] == np.prod(s) or not strict
return torch.from_numpy(parsed.astype(m[2], copy=False)).view(*s)
return torch.from_numpy(parsed.astype(m[2])).view(*s)
def read_label_file(path: str) -> torch.Tensor:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment