I’ve found a solution to avoid it, making param_need_l1_penalty_case_2 a property of my class.
    @property
    def param_need_l1_penalty_case_2(self):
        return [self.subModule.my_param[:,0]]

Then this is called after mode.to(device).
and the trainer code do not need modification.