Skip to content

Commit 1148097

Browse files
NicolasHugDmitriy Genzel
and
Dmitriy Genzel
authored
[FBcode->GH] Enable analytics logging for MNIST and CIFAR (#4090)
Summary: Enable analytics logging for MNIST and CIFAR Reviewed By: colin2328, fmassa Differential Revision: D29183132 fbshipit-source-id: 67d9f6881354f87659fdec4183b22a1be3ec0eb6 Co-authored-by: Dmitriy Genzel <[email protected]>
1 parent 655a2ed commit 1148097

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

torchvision/datasets/cifar.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import os.path
44
import numpy as np
55
import pickle
6+
import torch
67
from typing import Any, Callable, Optional, Tuple
78

89
from .vision import VisionDataset
@@ -58,6 +59,7 @@ def __init__(
5859

5960
super(CIFAR10, self).__init__(root, transform=transform,
6061
target_transform=target_transform)
62+
torch._C._log_api_usage_once(f"torchvision.datasets.{self.__class__.__name__}")
6163

6264
self.train = train # training set or test set
6365

torchvision/datasets/mnist.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ def __init__(
7777
) -> None:
7878
super(MNIST, self).__init__(root, transform=transform,
7979
target_transform=target_transform)
80+
torch._C._log_api_usage_once(f"torchvision.datasets.{self.__class__.__name__}")
8081
self.train = train # training set or test set
8182

8283
if self._check_legacy_exist():

0 commit comments

Comments
 (0)