code: def _LogSoftmaxGrad(op: ops.Operation, grad):
      """The gradient for log_softmax.
  
          log_softmax = input - log(sum(exp(input))
          dlog_softmax/dinput = diag - softmax(input)
  
      Args:
        op: The log softmax op.
        grad: The tensor representing the gradient w.r.t. the output.
  
      Returns:
        The gradients w.r.t. the input.
      """
      softmax = math_ops.exp(op.outputs[0])
      return (
          grad - math_ops.reduce_sum(grad, -1, keepdims=True) * softmax
      )
  
imports: import functools
  import itertools
  import operator
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import array_ops_stack
  from tensorflow.python.ops import gen_nn_ops
  from tensorflow.python.ops import math_ops
label_desc: Use image node_id 14 for calling a global function with example usage: _LogSoftmaxGrad(op, grad) and returns: unknown