code: def gather(explainer, op, *grads):
      # params = op.inputs[0]
      indices = op.inputs[1]
      # axis = op.inputs[2]
      var = explainer._variable_inputs(op)
      if var[1] and not var[0]:
          assert (
              len(indices.shape) == 2
          ), "Only scalar indices supported right now in GatherV2!"
  
          xin1, rin1 = tf.split(tf.cast(op.inputs[1], tf.float32), 2)
          xout, rout = tf.split(op.outputs[0], 2)
          dup_in1 = [2] + [1 for i in xin1.shape[1:]]
          dup_out = [2] + [1 for i in xout.shape[1:]]
          delta_in1_t = tf.tile(xin1 - rin1, dup_in1)
          out_sum = tf.reduce_sum(
              grads[0] * tf.tile(xout - rout, dup_out),
              list(range(len(indices.shape), len(grads[0].shape))),
          )
          if op.type == "ResourceGather":
              return [
                  None,
                  tf.where(
                      tf.abs(delta_in1_t) < 1e-6,
                      tf.zeros_like(delta_in1_t),
                      out_sum / delta_in1_t,
                  ),
              ]
          return [
              None,
              tf.where(
                  tf.abs(delta_in1_t) < 1e-6,
                  tf.zeros_like(delta_in1_t),
                  out_sum / delta_in1_t,
              ),
              None,
          ]
      elif var[0] and not var[1]:
          if op.type.startswith("shap_"):
              op.type = op.type[5:]
          return [
              explainer.orig_grads[op.type](op, grads[0]),
              None,
          ]  # linear in this case
      else:
          raise ValueError(
              "Axis not yet supported to be varying for gather op!"
          )
  
imports: import warnings
  import numpy
  from packaging import version
  from ...utils._exceptions import DimensionError
  from .._explainer import Explainer
  from ..tf_utils import _get_graph, _get_model_inputs, _get_model_output, _get_session
  from .deep_utils import _check_additivity
label_desc: Use image node_id 7 for calling a global function with example usage: gather(explainer, op) and returns: list, list, list