docstr: compute the gradients from the loss and the parameters
  
  :param loss: ([TensorFlow Tensor]) The loss
  :param var_list: ([TensorFlow Tensor]) The parameters
  :return: ([TensorFlow Tensor]) the gradient
docstr_tok: ["compute","the","gradients","from","the","loss","and","the","parameters",":","param","loss",":","(","[","TensorFlow","Tensor","]",")","The","loss",":","param","var_list",":","(","[","TensorFlow","Tensor","]",")","The","parameters",":","return",":","(","[","TensorFlow","Tensor","]",")","the","gradient"]
code: def compute_gradients(cls, loss, var_list=None):
      """
      compute the gradients from the loss and the parameters
  
      :param loss: ([TensorFlow Tensor]) The loss
      :param var_list: ([TensorFlow Tensor]) The parameters
      :return: ([TensorFlow Tensor]) the gradient
      """
      varlist = var_list
      if varlist is None:
          varlist = tf.trainable_variables()
      gradients = tf.gradients(loss, varlist)
  
      return [(a, b) for a, b in zip(gradients, varlist)]
  
imports: import re
  from functools import reduce
  import tensorflow
  import numpy
  from stable_baselines.acktr.kfac_utils import detect_min_val, factor_reshape, gmatmul
label_desc: Use image node_id 12 for calling the KfacOptimizer obj's underlying member method code with example usage: obj.compute_gradients(cls, loss, var_list) and returns: unknown