code: def _SoftmaxCrossEntropyWithLogitsGrad(
      op: ops.Operation, grad_loss, grad_grad
  ):
      """Gradient function for SoftmaxCrossEntropyWithLogits."""
      # grad_loss is the backprop for cost, and we multiply it with the gradients
      # (which is output[1])
      # grad_grad is the backprop for softmax gradient.
      #
      # Second derivative is just softmax derivative w.r.t. logits.
      softmax_grad = op.outputs[1]
      grad = _BroadcastMul(grad_loss, softmax_grad)
  
      logits = op.inputs[0]
      if grad_grad is not None and not getattr(
          grad_grad, "_is_zeros_tensor", False
      ):
          softmax = gen_nn_ops.softmax(logits)
  
          grad += (
              grad_grad
              - array_ops.squeeze(
                  math_ops.matmul(
                      array_ops.expand_dims(grad_grad, 1),
                      array_ops.expand_dims(softmax, 2),
                  ),
                  axis=1,
              )
          ) * softmax
  
      return grad, _BroadcastMul(
          grad_loss, -gen_nn_ops.log_softmax(logits)
      )
  
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 32 for calling a global function with example usage: _SoftmaxCrossEntropyWithLogitsGrad(op, grad_loss, grad_grad) and returns: grad,  _BroadcastMul