code: def test_dnnlowp_elementwise_add_broadcast(self, gc, dc):
      # Set broadcast and no axis, i.e. broadcasting last dimensions.
      min_ = -100
      max_ = min_ + 255
      A = np.round(np.random.rand(2, 3, 4, 5) * (max_ - min_) + min_)
      A = A.astype(np.float32)
      A[0, 0, 0, 0] = min_
      A[0, 0, 0, 1] = max_
  
      B = np.round(np.random.rand(4, 5) * 255 / 2 - 64).astype(
          np.float32
      )
      B[0, 0] = -64
      B[0, 1] = 127.0 / 2
  
      Output = collections.namedtuple(
          "Output", ["Y", "op_type", "engine"]
      )
      outputs = []
  
      op_engine_list = [
          ("Add", ""),
          ("Add", "DNNLOWP"),
          ("Int8Add", "DNNLOWP"),
      ]
  
      for op_type, engine in op_engine_list:
          net = core.Net("test_net")
  
          add = core.CreateOperator(
              op_type,
              ["A", "B"],
              ["Y"],
              engine=engine,
              device_option=gc,
              broadcast=1,
              dequantize_output=1,
          )
          net.Proto().op.extend([add])
  
          self.ws.create_blob("A").feed(A, device_option=gc)
          self.ws.create_blob("B").feed(B, device_option=gc)
          self.ws.run(net)
          outputs.append(
              Output(
                  Y=self.ws.blobs["Y"].fetch(),
                  op_type=op_type,
                  engine=engine,
              )
          )
  
      check_quantized_results_close(outputs)
  
file_path: pytorch/caffe2/quantization/server/elementwise_add_dnnlowp_op_test.py
imports: import collections
  import caffe2.python.hypothesis_test_util
  import hypothesis.strategies
  import numpy
  from caffe2.python import core, dyndep, workspace
  from caffe2.quantization.server.dnnlowp_test_utils import check_quantized_results_close
  from hypothesis import given
label_desc: Use image node_id 2 for calling the DNNLowPAddOpTest obj's underlying member method code with example usage: obj.test_dnnlowp_elementwise_add_broadcast(gc, dc) without return types