Commit Graph

4 Commits

Author SHA1 Message Date
Akko
e157af78bf erge branch 'master' of http://git.nakadashi.lol/akko/diffvg 2023-05-15 16:23:02 +02:00
Dan Nissenbaum
a5e26c4395 Resolve crash in 'backward' when a background image with only 3 channels is passed to 'forward'
The existing code adds the fourth channel to the background image directly inside 'forward'. However, this breaks back propagation because Torch's autograd framework records the shapes of all inputs to the 'forward' function and expects shapes passed to 'backward' to match. By adding a channel to the background image inside 'forward' and passing this to 'backward', there is an extra channel that autograd does not expect, and it crashes.

The resolution is to instead raise an exception with a useful error message for the end user that they need to add a channel of all ones to the background image.
2023-04-24 12:38:35 +02:00
Dan Nissenbaum
af48db06cd Resolve crash in 'backward' when a background image with only 3 channels is passed to 'forward'
The existing code adds the fourth channel to the background image directly inside 'forward'. However, this breaks back propagation because Torch's autograd framework records the shapes of all inputs to the 'forward' function and expects shapes passed to 'backward' to match. By adding a channel to the background image inside 'forward' and passing this to 'backward', there is an extra channel that autograd does not expect, and it crashes.

The resolution is to instead raise an exception with a useful error message for the end user that they need to add a channel of all ones to the background image.
2022-11-05 15:07:47 -04:00
Tzu-Mao Li
413a3e5cee initial commit 2020-09-03 22:30:30 -04:00