Solved by yjiang05 in post #4 
              
              
                You should subclass the base Optimizer class imported from torch.optim.optimizer, i.e., from torch.optim.optimizer import Optimizer