Commit cf5505a
Diffusion Model Encoder has an output layer set in forward method and this leads to problems (#8578)
Fixes #8577 .
### Description
This pull request sets the out layer of DiffusionModelEncoder in the
init method. This requires the inclusion of input_shape parameter in the
init method to calculate the input dimension to the last linear layer.
The output spatial shape derivation is a bit baroque, but allows for the
otherwise not very pleasant odd spatial dimensions at input.
### Types of changes
- [x] Non breaking change (fix or new feature that would cause existing
functionality to change). **The tutorial that was failing will need to
provide this input parameter, but input_shape is now defaulted to the
notebook dims.**
- [x] Quick tests passed locally by running `./runtests.sh --quick
--unittests --disttests`.
- [x] In-line docstrings updated.
---------
Signed-off-by: Virginia Fernandez <[email protected]>
Co-authored-by: Virginia Fernandez <[email protected]>
Co-authored-by: YunLiu <[email protected]>1 parent 6327a86 commit cf5505a
1 file changed
+15
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
| 39 | + | |
38 | 40 | | |
39 | 41 | | |
40 | 42 | | |
| |||
1882 | 1884 | | |
1883 | 1885 | | |
1884 | 1886 | | |
| 1887 | + | |
1885 | 1888 | | |
1886 | 1889 | | |
1887 | 1890 | | |
| |||
1901 | 1904 | | |
1902 | 1905 | | |
1903 | 1906 | | |
| 1907 | + | |
1904 | 1908 | | |
1905 | 1909 | | |
1906 | 1910 | | |
| |||
2007 | 2011 | | |
2008 | 2012 | | |
2009 | 2013 | | |
2010 | | - | |
| 2014 | + | |
| 2015 | + | |
| 2016 | + | |
| 2017 | + | |
| 2018 | + | |
| 2019 | + | |
| 2020 | + | |
| 2021 | + | |
2011 | 2022 | | |
2012 | 2023 | | |
2013 | 2024 | | |
| |||
2052 | 2063 | | |
2053 | 2064 | | |
2054 | 2065 | | |
2055 | | - | |
2056 | | - | |
2057 | | - | |
2058 | | - | |
| 2066 | + | |
| 2067 | + | |
| 2068 | + | |
2059 | 2069 | | |
2060 | 2070 | | |
2061 | 2071 | | |
0 commit comments