So, maybe a silly question, but I’ve stumbled upon a problem where backprop seems to “fail” for part of my forward. i.e. part of my nn.Module .parameters() never get changes when I call .step()
The exact loop I have here is something like:
    def forward(self, input_arr):
        # self.encoders is an nn.ModuleList
        
        stacked_inputs = []
        for k in range(len(input_arr[0])):
            stacked_inputs.append([])
            for i in range(len(input_arr)):
                stacked_inputs[k].append(input_arr[i][k])

        for i in range(len(stacked_inputs)):
            stacked_inputs[i] = torch.stack(stacked_inputs[i])
        
        # I assume the actual issue starts here
        k = 0
        X = torch.zeros(len(input_arr),self.input_size)
        for i in range(len(stacked_inputs)):
            input = stacked_inputs[i]
            if i in self.encoder_indexes:
                input = self.encoders[k](input)
                k += 1
            X[:,self.input_indexes[i][0]:self.input_indexes[i][1]] = input

        X = X.to(self.device)

        output = self._foward_net(X)
        return output

And I’m curios where the problem could be arrising here, however, I’m curios, in the more general scenario, what would be the way to go about debugging something like this to begin with ?