code: def test_ndarray_arithmetic_ops2(seed, op, x_var, y_var, shape):
      rng = np.random.RandomState(seed)
      vx_data = rng.randn(*shape).astype(np.float32)
      vy_data = rng.randn(*shape).astype(np.float32)
      if op == "**" and vx_data.size > 0:
          vx_data += -vx_data.min() + 1.0
      if x_var:
          vx = nn.Variable.from_numpy_array(vx_data)
      else:
          vx = nn.NdArray.from_numpy_array(vx_data)
      if y_var:
          vy = nn.Variable.from_numpy_array(vy_data)
      else:
          vy = nn.NdArray.from_numpy_array(vy_data)
      vz = eval("vx {0} vy".format(op))
      ref_z = eval("vx_data {0} vy_data".format(op))
      assert_allclose(ref_z, vz.data)
  
      if x_var:
          return
  
      # Inplace test
      vx_bak = vx
      if op == "+":
          vx += vy
      elif op == "-":
          vx -= vy
      elif op == "*":
          vx *= vy
      elif op == "/":
          vx /= vy
      elif op == "**":
          vx **= vy
      assert_allclose(vx.data, vz.data)
      if op == "*" or op == "/" or op == "**":
          # In-placing for `*`, `/` and `**` is obsoleted.
          return
      assert vx is vx_bak
  
file_path: nnabla/python/test/test_ndarray_arithmetic_ops.py
imports: from six import exec_
  import pytest
  import numpy
  import nnabla
  from nnabla.testing import assert_allclose
label_desc: Use image node_id 1 for calling a global function with example usage: test_ndarray_arithmetic_ops2(seed, op, x_var, y_var, shape) without return types