class_docstr: Test case class implementing extra test functionalities.
class_docstr_tok: ["Test","case","class","implementing","extra","test","functionalities","."]
docstr: Computes the gradient error.
  
  Args:
    x: a tensor or list of tensors.
    y: a tensor.
    x_init: a numpy array of the same shape as "x" representing the initial
      value of x.
    delta: (optional) the amount of perturbation.
  
  Returns:
    A tuple (max_error, row, column), with max_error the maxium error between
    the two Jacobians, and row/column the position of said maximum error.
docstr_tok: ["Computes","the","gradient","error",".","Args",":","x",":","a","tensor","or","list","of","tensors",".","y",":","a","tensor",".","x_init",":","a","numpy","array","of","the","same","shape","as","``","x","''","representing","the","initial","value","of","x.","delta",":","(","optional",")","the","amount","of","perturbation",".","Returns",":","A","tuple","(","max_error",",","row",",","column",")",",","with","max_error","the","maxium","error","between","the","two","Jacobians",",","and","row\/column","the","position","of","said","maximum","error","."]
code: def _compute_gradient_error(self, x, y, x_init, delta=1e-6):
      """Computes the gradient error.
  
      Args:
        x: a tensor or list of tensors.
        y: a tensor.
        x_init: a numpy array of the same shape as "x" representing the initial
          value of x.
        delta: (optional) the amount of perturbation.
  
      Returns:
        A tuple (max_error, row, column), with max_error the maxium error between
        the two Jacobians, and row/column the position of said maximum error.
      """
      with self.cached_session():
          grad = tf.compat.v1.test.compute_gradient(
              x, x.shape.as_list(), y, y.shape.as_list(), x_init, delta
          )
          if isinstance(grad, tuple):
              grad = [grad]
          error = 0
          row_max_error = 0
          column_max_error = 0
          for j_t, j_n in grad:
              if (
                  j_t.size or j_n.size
              ):  # Handle zero size tensors correctly
                  diff = np.fabs(j_t - j_n)
                  max_error = np.maximum(error, diff.max())
                  row_max_error, column_max_error = np.unravel_index(
                      diff.argmax(), diff.shape
                  )
          return max_error, row_max_error, column_max_error
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import warnings
  from absl import flags
  from absl.testing import parameterized
  import numpy
  from six.moves import zip
  import tensorflow
  from tensorflow_graphics.util import tfg_flags
label_desc: Use image node_id 3 for calling the TestCase obj's underlying member method code with example usage: obj._compute_gradient_error(x, y, x_init, delta) and returns: max_error,  row_max_error,  column_max_error