MCPcopy
hub / github.com/pytorch/vision / inject_fake_data

Method inject_fake_data

test/test_datasets.py:1804–1818  ·  view source on GitHub ↗
(self, tmpdir, config)

Source from the content-addressed store, hash-verified

1802 ADDITIONAL_CONFIGS = combinations_grid(split=("train", "test", "extra"))
1803
1804 def inject_fake_data(self, tmpdir, config):
1805 import scipy.io as sio
1806
1807 split = config["split"]
1808 num_examples = {
1809 "train": 2,
1810 "test": 3,
1811 "extra": 4,
1812 }.get(split)
1813
1814 file = f"{split}_32x32.mat"
1815 images = np.zeros((32, 32, 3, num_examples), dtype=np.uint8)
1816 targets = np.zeros((num_examples,), dtype=np.uint8)
1817 sio.savemat(os.path.join(tmpdir, file), {"X": images, "y": targets})
1818 return num_examples
1819
1820
1821class Places365TestCase(datasets_utils.ImageDatasetTestCase):

Callers

nothing calls this directly

Calls 1

getMethod · 0.80

Tested by

no test coverage detected