From 07bdd865dc88abf73374f8a453ea160f61ccbff9 Mon Sep 17 00:00:00 2001 From: James Betker Date: Thu, 9 Jun 2022 21:46:32 -0600 Subject: [PATCH] some checks --- codes/trainer/injectors/gaussian_diffusion_injector.py | 1 + 1 file changed, 1 insertion(+) diff --git a/codes/trainer/injectors/gaussian_diffusion_injector.py b/codes/trainer/injectors/gaussian_diffusion_injector.py index 3d71e2b9..0e35c361 100644 --- a/codes/trainer/injectors/gaussian_diffusion_injector.py +++ b/codes/trainer/injectors/gaussian_diffusion_injector.py @@ -21,6 +21,7 @@ def masked_channel_balancer(inp, proportion=1): def channel_restriction(inp, low, high): + assert low > 0 and low < inp.shape[1] and high <= inp.shape[1] m = torch.zeros_like(inp) m[:,low:high] = 1 return inp * m