Skip to content

Commit 17a13f0

Browse files
committed
Make URL a public field.
1 parent fd87cac commit 17a13f0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

labs/npfl138/datasets/mnist.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class MNIST:
2121
Element = TypedDict("Element", {"image": torch.Tensor, "label": torch.Tensor})
2222
Elements = TypedDict("Elements", {"images": torch.Tensor, "labels": torch.Tensor})
2323

24-
_URL: str = "https://ufal.mff.cuni.cz/~straka/courses/npfl138/2324/datasets/"
24+
URL: str = "https://ufal.mff.cuni.cz/~straka/courses/npfl138/2425/datasets/"
2525

2626
class Dataset(torch.utils.data.Dataset):
2727
def __init__(self, data: "MNIST.Elements") -> None:
@@ -55,7 +55,7 @@ def __init__(self, dataset: str = "mnist", sizes: dict[str, int] = {}) -> None:
5555
path = "{}.npz".format(dataset)
5656
if not os.path.exists(path):
5757
print("Downloading {} dataset...".format(dataset), file=sys.stderr)
58-
urllib.request.urlretrieve("{}/{}".format(self._URL, path), filename="{}.tmp".format(path))
58+
urllib.request.urlretrieve("{}/{}".format(self.URL, path), filename="{}.tmp".format(path))
5959
os.rename("{}.tmp".format(path), path)
6060

6161
mnist = np.load(path)

0 commit comments

Comments
 (0)