From a890e3a9c0f7c8be3c3ac3d415afee6d4694f482 Mon Sep 17 00:00:00 2001 From: James Betker Date: Sun, 4 Oct 2020 21:05:01 -0600 Subject: [PATCH] Fix geometric loss not handling 0 index --- codes/models/steps/losses.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codes/models/steps/losses.py b/codes/models/steps/losses.py index 85fcf63a..1928f39f 100644 --- a/codes/models/steps/losses.py +++ b/codes/models/steps/losses.py @@ -316,7 +316,7 @@ class TranslationInvarianceLoss(ConfigurableLoss): trans_output = net(*input) else: trans_output = net(*input) - if self.gen_output_to_use: + if self.gen_output_to_use is not None: fake_shared_output = trans_output[self.gen_output_to_use][:, :, hl:hh, wl:wh] else: fake_shared_output = trans_output[:, :, hl:hh, wl:wh]