Solved by matthew_zeng in post #7 
              
              
                Use the basic knowledge of software engineering. 

class MultipleOptimizer(object):
    def __init__(*op):
        self.optimizers = op

    def zero_grad(self):
        for op in self.optimizers:
            op.zero_grad()

    def step(self):
        for op in self.optimizers:
            op.step(…