code: def testFeaturesBroadcast(self):
      np_f = np.array(
          [[1.0, 2.0, 3.0, 4.0], [1.0, 2.0, 3.0, 4.0]]
      ).astype(np.float32)
      np_l = np.array(
          [[0.0, 0.0, 0.0, 1.0], [0.0, 0.5, 0.5, 0.0]]
      ).astype(np.float32)
      np_loss, np_gradient = self._npXent(labels=np_l, logits=np_f)
      tf_f = constant_op.constant(
          np.array([[1.0, 2.0, 3.0, 4.0]]).astype(np.float32)
      )
      tf_l = constant_op.constant(
          np.array([[0.0, 0.0, 0.0, 1.0], [0.0, 0.5, 0.5, 0.0]]).astype(
              np.float32
          )
      )
      (
          tf_loss,
          tf_gradient,
      ) = gen_nn_ops.softmax_cross_entropy_with_logits(tf_f, tf_l)
      self.assertAllCloseAccordingToType(np_loss, tf_loss)
      self.assertAllCloseAccordingToType(np_gradient, tf_gradient)
  
      tf_f = constant_op.constant(np.array([[1.0]]).astype(np.float32))
      tf_l = constant_op.constant(
          np.array([[1.0], [1.0]]).astype(np.float32)
      )
      (
          tf_loss,
          tf_gradient,
      ) = gen_nn_ops.softmax_cross_entropy_with_logits(tf_f, tf_l)
      self.assertAllClose([0, 0], tf_loss)
      self.assertAllCloseAccordingToType([[0], [0]], tf_gradient)
  
imports: import itertools
  import sys
  import numpy
  from tensorflow.python.client import session
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import test_util
  from tensorflow.python.kernel_tests.nn_ops import xent_op_test_base
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import gen_nn_ops
  from tensorflow.python.ops import nn_ops
  from tensorflow.python.platform import test
label_desc: Use image node_id 2 for calling the XentOpTest obj's underlying member method code with example usage: obj.testFeaturesBroadcast() without return types