def forward(self, x):
        """
        x is the processed tensor from raw states before the dueling layers,
        its shape should be [batch x prelinear_size]
        """
        shape = x.size()
        assert len(shape) == 2 and shape[1] == self.prelinear_size

        action_scores = x
        for is_last, fc_action in U.iter_last(self.fc_action_layers):
            action_scores = fc_action(action_scores)
            if not is_last:
                action_scores = F.relu(action_scores)

        if self.dueling:
            action_scores_mean = action_scores.mean(dim=1, keepdim=True)
            action_scores -= action_scores_mean
            state_score = x
            for is_last, fc_action in U.iter_last(self.fc_state_layers):
                state_score = fc_action(state_score)
                if not is_last:
                    state_score = F.relu(state_score)
            return action_scores + state_score
        else:
            return action_scores

        x is the processed tensor from raw states before the dueling layers,
        its shape should be [batch x prelinear_size]
        
surreal/model/q_net.py