Solved by blackberry in post #2 
              
              
                Solved. 
In case someone encounters the same issue, here is how to change the code to be able to compile it: 
for i, (l, c) in enumerate(zip(self.loc, self.conf)):
   x = sources[i]
   loc.append(l(x).permute(0, 2, 3, 1).contiguous())
   conf.append(c(x).permute(0, 2, 3, 1).contiguous())