Solved by dohwan.lee in post #4 
              
              
                val_ht_loss = torch.mean(torch.stack(holder_loss_ht)) 
scheduler_ht.step(val_ht_loss) 
print('Epoc: ', i, ’ Sparse loss: ', val_ht_loss) 
–> 
val_ht_loss = torch.mean(torch.stack(holder_loss_ht)) 
scheduler_ht.step(val_ht_loss.data[0]) 
print('Epoc: ', i, ’ Sparse loss: ', val_ht_loss)