Commit 5caa6fc
[PTen] Add variable transform to/from ptenTensor and add cast kernel (#36916)
* add cast kernel
* add cast cuda kernel
* add cast kernel
* make cast kernel output dtype undefined
* get cast dtype from vardesc
* move cast to manipulation and add test case
* add castinfershape
* avoid reinitilaze variable
* InitializeVariable support datatype
* merge develop branch
* fix merge bug
* revert modify initializeVariable
* revert modify on InitializeVariable
* revert modify on InitializeVariable
* mutable support reset dtype
* enable make pten tensor from variable when def_arg.type is undefined
* fix build pten ctx start_idx error
* copy pten out tensor to variable
* merge develop branch
* fix non pten kernel cast failed
* add reset allocation place for remake tensor
* fix inplace realloc error
* add mutable on pten kernles and remove unused cast files
* rename function names
* fix output type error
* fix conflict with develop branch
* set data type to variable with pten's dtype
* fix test_cast_api type mismatch
* densorTensro mutable_data support 0 bytes value
* fix the inplace bug of reshape kernel
* fix pten.backend != variable.place when moving storage, palce mismatch bug
* fix conflict with develop branch
* Fix bug of paddle::experimental::MovesStorage
* fix ReMakePtenDenseTensor place mismatch bug
* Revert "fix ReMakePtenDenseTensor place mismatch bug"
This reverts commit 8633603.
* fix ReMakePtenDenseTensor place mismatch bug
* reverts the set_lod interface, test=develop
* modify by the review options
* modify error message
* add & for const input arguments
* add reference in params
* elementwise_sub add mutable_data
* fix ResetHolderWithType check size bug
* add dependence pten_tensor to test_cast_api object
* remove unused code to pass ci coverage
Co-authored-by: Chen Weihang <[email protected]>
Co-authored-by: YuanRisheng <[email protected]>
Co-authored-by: shixiaowei02 <[email protected]>1 parent 075c22f commit 5caa6fc
File tree
40 files changed
+837
-149
lines changed- paddle
- fluid
- framework
- imperative
- operators
- pten
- api
- ext
- include
- lib
- utils
- core
- include
- infermeta
- kernels
- cpu
- cuda
- functions
- cpu
- eigen
- general
- math
- xpu
- tests
- api
- kernels
40 files changed
+837
-149
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1183 | 1183 | | |
1184 | 1184 | | |
1185 | 1185 | | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
1186 | 1189 | | |
1187 | 1190 | | |
1188 | 1191 | | |
| |||
1808 | 1811 | | |
1809 | 1812 | | |
1810 | 1813 | | |
1811 | | - | |
| 1814 | + | |
| 1815 | + | |
| 1816 | + | |
| 1817 | + | |
| 1818 | + | |
| 1819 | + | |
| 1820 | + | |
| 1821 | + | |
| 1822 | + | |
| 1823 | + | |
| 1824 | + | |
| 1825 | + | |
1812 | 1826 | | |
1813 | 1827 | | |
1814 | 1828 | | |
1815 | 1829 | | |
1816 | 1830 | | |
1817 | 1831 | | |
1818 | | - | |
| 1832 | + | |
1819 | 1833 | | |
1820 | 1834 | | |
1821 | | - | |
| 1835 | + | |
1822 | 1836 | | |
1823 | 1837 | | |
1824 | | - | |
| 1838 | + | |
| 1839 | + | |
| 1840 | + | |
| 1841 | + | |
| 1842 | + | |
| 1843 | + | |
| 1844 | + | |
| 1845 | + | |
| 1846 | + | |
1825 | 1847 | | |
1826 | | - | |
1827 | 1848 | | |
1828 | 1849 | | |
1829 | | - | |
| 1850 | + | |
| 1851 | + | |
| 1852 | + | |
| 1853 | + | |
| 1854 | + | |
| 1855 | + | |
| 1856 | + | |
1830 | 1857 | | |
1831 | 1858 | | |
1832 | 1859 | | |
1833 | 1860 | | |
1834 | 1861 | | |
1835 | 1862 | | |
1836 | | - | |
| 1863 | + | |
| 1864 | + | |
| 1865 | + | |
| 1866 | + | |
| 1867 | + | |
| 1868 | + | |
| 1869 | + | |
| 1870 | + | |
| 1871 | + | |
| 1872 | + | |
| 1873 | + | |
1837 | 1874 | | |
1838 | 1875 | | |
1839 | 1876 | | |
1840 | 1877 | | |
1841 | 1878 | | |
1842 | 1879 | | |
1843 | | - | |
| 1880 | + | |
1844 | 1881 | | |
1845 | 1882 | | |
1846 | | - | |
| 1883 | + | |
1847 | 1884 | | |
1848 | 1885 | | |
1849 | | - | |
| 1886 | + | |
| 1887 | + | |
| 1888 | + | |
| 1889 | + | |
| 1890 | + | |
| 1891 | + | |
| 1892 | + | |
| 1893 | + | |
| 1894 | + | |
| 1895 | + | |
1850 | 1896 | | |
1851 | | - | |
1852 | 1897 | | |
1853 | 1898 | | |
1854 | | - | |
| 1899 | + | |
| 1900 | + | |
| 1901 | + | |
| 1902 | + | |
| 1903 | + | |
| 1904 | + | |
| 1905 | + | |
1855 | 1906 | | |
1856 | 1907 | | |
1857 | 1908 | | |
| |||
1883 | 1934 | | |
1884 | 1935 | | |
1885 | 1936 | | |
1886 | | - | |
1887 | | - | |
1888 | | - | |
1889 | | - | |
1890 | | - | |
1891 | | - | |
1892 | | - | |
1893 | | - | |
| 1937 | + | |
| 1938 | + | |
| 1939 | + | |
| 1940 | + | |
| 1941 | + | |
| 1942 | + | |
| 1943 | + | |
| 1944 | + | |
| 1945 | + | |
| 1946 | + | |
| 1947 | + | |
| 1948 | + | |
| 1949 | + | |
| 1950 | + | |
| 1951 | + | |
| 1952 | + | |
| 1953 | + | |
1894 | 1954 | | |
1895 | 1955 | | |
1896 | 1956 | | |
| |||
1901 | 1961 | | |
1902 | 1962 | | |
1903 | 1963 | | |
| 1964 | + | |
| 1965 | + | |
| 1966 | + | |
| 1967 | + | |
| 1968 | + | |
| 1969 | + | |
| 1970 | + | |
| 1971 | + | |
| 1972 | + | |
| 1973 | + | |
| 1974 | + | |
| 1975 | + | |
| 1976 | + | |
| 1977 | + | |
| 1978 | + | |
| 1979 | + | |
| 1980 | + | |
| 1981 | + | |
| 1982 | + | |
| 1983 | + | |
| 1984 | + | |
1904 | 1985 | | |
1905 | 1986 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
589 | 589 | | |
590 | 590 | | |
591 | 591 | | |
| 592 | + | |
| 593 | + | |
592 | 594 | | |
593 | 595 | | |
594 | 596 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
207 | | - | |
208 | | - | |
| 207 | + | |
209 | 208 | | |
| 209 | + | |
210 | 210 | | |
211 | 211 | | |
| 212 | + | |
| 213 | + | |
212 | 214 | | |
213 | 215 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
271 | 271 | | |
272 | 272 | | |
273 | 273 | | |
274 | | - | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
275 | 277 | | |
276 | 278 | | |
277 | 279 | | |
| |||
0 commit comments