code: def test_binary_ufunc(setup, ufunc_name):
      raw_data1 = np.random.rand(100, 100)
      t1 = mt.tensor(raw_data1.copy(), chunk_size=50)
      raw_data2 = np.random.rand(100, 100)
      t2 = mt.tensor(raw_data2.copy(), chunk_size=50)
  
      ufunc_obj = getattr(np, ufunc_name)
  
      res = ufunc_obj(t1, t2)
      expected = ufunc_obj(raw_data1, raw_data2)
      assert isinstance(res, Tensor)
      np.testing.assert_array_equal(res.execute().fetch(), expected)
  
      ufunc_obj.at(t1, (3, 4), 2)
      ufunc_obj.at(raw_data1, (3, 4), 2)
      np.testing.assert_array_equal(t1.execute().fetch(), raw_data1)
  
      res = ufunc_obj.reduce(t1, axis=1)
      expected = ufunc_obj.reduce(raw_data1, axis=1)
      assert isinstance(res, Tensor)
      np.testing.assert_almost_equal(res.execute().fetch(), expected)
  
      res = t1.copy()
      ufunc_obj.reduce(t1, axis=1, out=res)
      expected = ufunc_obj.reduce(raw_data1, axis=1)
      assert isinstance(res, Tensor)
      np.testing.assert_almost_equal(res.execute().fetch(), expected)
  
      res = ufunc_obj.accumulate(t1, axis=1)
      expected = ufunc_obj.accumulate(raw_data1, axis=1)
      assert isinstance(res, Tensor)
      np.testing.assert_almost_equal(res.execute().fetch(), expected)
  
      res = t1.copy()
      ufunc_obj.accumulate(t1, axis=1, out=res)
      expected = ufunc_obj.accumulate(raw_data1, axis=1)
      assert isinstance(res, Tensor)
      np.testing.assert_almost_equal(res.execute().fetch(), expected)
  
      with pytest.raises(TypeError):
          ufunc_obj.reduceat(t1, [(3, 4)])
  
imports: import numpy
  import pytest
  from ....None import tensor
  from ...core import Tensor
label_desc: Use image node_id 2 for calling a global function with example usage: test_binary_ufunc(setup, ufunc_name) without return types