code: def test_sum_reduce_fp16(self, gc, dc):
      assume(core.IsGPUDeviceType(gc.device_type))
  
      # Set broadcast and no axis, i.e. broadcasting last dimensions.
      X = np.random.rand(2, 3, 4, 5).astype(np.float16)
      Y = np.random.rand(4, 5).astype(np.float16)
      op = core.CreateOperator(
          "SumReduceLike",
          ["X", "Y"],
          "out",
          broadcast=1,
          device_option=gc,
      )
  
      def ref_op(X, Y):
          res = np.sum(X, axis=0)
          res = np.sum(res, axis=0)
          return [res]
  
      self.assertReferenceChecks(
          device_option=gc,
          op=op,
          inputs=[X, Y],
          reference=ref_op,
          threshold=1e-3,
      )
  
      # Set broadcast and no axis, i.e. broadcasting last dimensions.
      X = np.random.rand(2, 3, 4, 5).astype(np.float16)
      Y = np.random.rand(2, 3).astype(np.float16)
      op = core.CreateOperator(
          "SumReduceLike", ["X", "Y"], "out", broadcast=1, axis=0
      )
  
      def ref_op(X, Y):
          res = np.sum(X, axis=3)
          res = np.sum(res, axis=2)
          return [res]
  
      self.assertReferenceChecks(
          device_option=gc,
          op=op,
          inputs=[X, Y],
          reference=ref_op,
          threshold=1e-3,
      )
  
      # broadcasting intermediate dimensions
      X = np.random.rand(2, 3, 4, 5).astype(np.float16)
      Y = np.random.rand(3, 4).astype(np.float16)
      op = core.CreateOperator(
          "SumReduceLike", ["X", "Y"], "out", broadcast=1, axis=1
      )
  
      def ref_op(X, Y):
          res = np.sum(X, axis=0)
          res = np.sum(res, axis=2)
          return [res]
  
      self.assertReferenceChecks(
          device_option=gc,
          op=op,
          inputs=[X, Y],
          reference=ref_op,
          threshold=1e-3,
      )
  
      # broadcasting with single elem dimensions at both ends
      X = np.random.rand(2, 3, 4, 5).astype(np.float16)
      Y = np.random.rand(1, 3, 4, 1).astype(np.float16)
      op = core.CreateOperator(
          "SumReduceLike", ["X", "Y"], "out", broadcast=1
      )
  
      def ref_op(X, Y):
          res = np.sum(X, axis=0)
          res = np.sum(res, axis=2)
          return [res.reshape(Y.shape)]
  
      self.assertReferenceChecks(
          device_option=gc,
          op=op,
          inputs=[X, Y],
          reference=ref_op,
          threshold=1e-3,
      )
  
imports: import unittest
  from hypothesis import given, assume, settings
  import hypothesis.strategies
  import numpy
  import operator
  from caffe2.proto import caffe2_pb2
  from caffe2.python import core, workspace
  import caffe2.python.hypothesis_test_util
  import caffe2.python.serialized_test.serialized_test_util
label_desc: Use image node_id 11 for calling the TestElementwiseBroadcast obj's underlying member method code with example usage: obj.test_sum_reduce_fp16(gc, dc) and returns: list, list, list, list