code: def _tensor_arithmetic_op_broadcast_helper(self, dev):
      def _run_test(dev, singa_op, np_op, s1, s2):
          x_0 = np.random.random(s1).astype(np.float32)
          y_0 = np.random.random(s2).astype(np.float32)
          x0 = tensor.Tensor(device=dev, data=x_0)
          y0 = tensor.Tensor(device=dev, data=y_0)
  
          z0 = tensor._call_singa_func(singa_op, x0.data, y0.data)
          z0.to_host()
          np.testing.assert_array_almost_equal(
              tensor.to_numpy(z0), np_op(x_0, y_0)
          )
          return
  
      for s_op, n_op in zip(
          [
              singa_api.Pow,
              singa_api.__add__,
              singa_api.__div__,
              singa_api.__sub__,
              singa_api.__mul__,
          ],
          [np.power, np.add, np.divide, np.subtract, np.multiply],
      ):
          _run_test(dev, s_op, n_op, [6], [1])
          _run_test(dev, s_op, n_op, [2, 3], [2, 3])
          _run_test(dev, s_op, n_op, [3, 2], [1])
          _run_test(dev, s_op, n_op, [3, 1, 2], [3, 1, 1])
          _run_test(dev, s_op, n_op, [2, 3, 4, 5], [5])
          _run_test(dev, s_op, n_op, [2, 3, 4, 5], [1, 1, 1])
          _run_test(dev, s_op, n_op, [2, 3, 4, 5], [1, 1, 1, 1])
          _run_test(
              dev, s_op, n_op, [2, 3, 4, 5], [4, 5]
          )  # 45+2345=2345
          _run_test(dev, s_op, n_op, [3, 1, 2, 1], [3, 1, 2])
          _run_test(
              dev, s_op, n_op, [4, 5], [2, 3, 4, 5]
          )  # 45+2345=2345
          _run_test(
              dev, s_op, n_op, [1, 4, 5], [2, 3, 1, 1]
          )  # 145+2311=2345
          _run_test(dev, s_op, n_op, [3, 4, 5], [2, 1, 1, 1])
  
imports: from __future__ import division
  import unittest
  import math
  import numpy
  from singa import singa_wrap
  from singa import tensor
  from cuda_helper import gpu_dev, cpu_dev
label_desc: Use image node_id 6 for calling the TestAPI obj's underlying member method code with example usage: obj._tensor_arithmetic_op_broadcast_helper(dev) without return types