Hi,
I was wondering what the equivlent in pytorch of the following tensor flow is:
def compute_apply_gradients(model, x, optimizer):  
     with tf.GradientTape() as tape:    
          loss = compute_loss(model, x)  
     gradients = tape.gradient(loss, model.trainable_variables)  
     optimizer.apply_gradients(zip(gradients, model.trainable_variables))

many thanks,
chaslie