Closed elikosan closed 7 years ago
this will fail if input size changes right? that's not correct.
If the input size changes, then it will recompute the coefs. The expression: not input:isSize(self._inpsz) becomes true when the size of input and the cached size are different.
From: Soumith Chintala [mailto:notifications@github.com] Sent: Monday, October 02, 2017 3:01 PM To: torch/nn Cc: Eric Cosatto; Author Subject: Re: [torch/nn] fix condition logic for coef recalculation in SpatialSubtractiveNormalization (#1283)
this will fail if input size changes right? that's not correct.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/torch/nn/pull/1283#issuecomment-333632048, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ASkgqhJxjLn4oTAWn1dwqVSnzU73A0-Wks5soTL9gaJpZM4PrEyT.
thanks!
Hi Soumith,
I found out why Travis failed. I need to clear my cache in SpatialSubtractiveNormalization:clearState() Otherwise the jac.TestIO fails
I will make another pull request with the fix. Sorry about that.
Eric.
From: Soumith Chintala [mailto:notifications@github.com] Sent: Monday, October 02, 2017 3:01 PM To: torch/nn Cc: Eric Cosatto; Author Subject: Re: [torch/nn] fix condition logic for coef recalculation in SpatialSubtractiveNormalization (#1283)
this will fail if input size changes right? that's not correct.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/torch/nn/pull/1283#issuecomment-333632048, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ASkgqhJxjLn4oTAWn1dwqVSnzU73A0-Wks5soTL9gaJpZM4PrEyT.
Existing conditional expression always verified, resulting in overhead as coefficients were recalculated every time. Fix and simplify expression by using cached input size.