Commit 3d4d7b9
Refactor ChunkDataReader API + fix missing headers (#19485)
Summary:
This PR restricts the BatchType template argument of ChunkDataReader to STL
vectors only. Internally, ChunkDataReader was assuming BatchType was a
vector, but the user could pass any type to the template argument,
leading to compiling issues during CPP extensions.
Additionally to the proposed API change, this PR adds missing include
headers to chunk.h. Currently the current implementation works but if
users try to create C++ extensions that implements new ChunkDataReaders
to be along with the existing ChunkDataset, the build will fail due to
the missing headers.
In terms of functionality, nothing has changed. This PR simply makes the
implementation slightly more robust for future extensions.
Pull Request resolved: #19485
Differential Revision: D15261725
Pulled By: soumith
fbshipit-source-id: 38c9465d665392ae6a2d12c5a520a4f501e1a6ca1 parent bed1d7d commit 3d4d7b9
File tree
2 files changed
+24
-16
lines changed- test/cpp/api
- torch/csrc/api/include/torch/data/datasets
2 files changed
+24
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
65 | 66 | | |
66 | | - | |
| 67 | + | |
67 | 68 | | |
68 | | - | |
| 69 | + | |
| 70 | + | |
69 | 71 | | |
70 | 72 | | |
71 | 73 | | |
| |||
1650 | 1652 | | |
1651 | 1653 | | |
1652 | 1654 | | |
1653 | | - | |
| 1655 | + | |
1654 | 1656 | | |
1655 | 1657 | | |
1656 | 1658 | | |
| |||
1709 | 1711 | | |
1710 | 1712 | | |
1711 | 1713 | | |
1712 | | - | |
| 1714 | + | |
1713 | 1715 | | |
1714 | | - | |
| 1716 | + | |
1715 | 1717 | | |
1716 | 1718 | | |
1717 | 1719 | | |
| |||
1752 | 1754 | | |
1753 | 1755 | | |
1754 | 1756 | | |
1755 | | - | |
| 1757 | + | |
1756 | 1758 | | |
1757 | | - | |
| 1759 | + | |
1758 | 1760 | | |
1759 | 1761 | | |
1760 | 1762 | | |
| |||
1791 | 1793 | | |
1792 | 1794 | | |
1793 | 1795 | | |
1794 | | - | |
| 1796 | + | |
1795 | 1797 | | |
1796 | 1798 | | |
1797 | 1799 | | |
| |||
1825 | 1827 | | |
1826 | 1828 | | |
1827 | 1829 | | |
1828 | | - | |
1829 | | - | |
| 1830 | + | |
| 1831 | + | |
1830 | 1832 | | |
1831 | 1833 | | |
1832 | 1834 | | |
| |||
1869 | 1871 | | |
1870 | 1872 | | |
1871 | 1873 | | |
1872 | | - | |
1873 | | - | |
| 1874 | + | |
| 1875 | + | |
1874 | 1876 | | |
1875 | 1877 | | |
1876 | 1878 | | |
1877 | 1879 | | |
1878 | 1880 | | |
1879 | 1881 | | |
1880 | 1882 | | |
1881 | | - | |
| 1883 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
3 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
4 | 9 | | |
5 | 10 | | |
6 | 11 | | |
| |||
12 | 17 | | |
13 | 18 | | |
14 | 19 | | |
15 | | - | |
| 20 | + | |
16 | 21 | | |
17 | 22 | | |
18 | | - | |
| 23 | + | |
| 24 | + | |
19 | 25 | | |
20 | 26 | | |
21 | 27 | | |
| |||
34 | 40 | | |
35 | 41 | | |
36 | 42 | | |
37 | | - | |
| 43 | + | |
38 | 44 | | |
39 | 45 | | |
40 | 46 | | |
| |||
0 commit comments