code: def test_from_array(need_grad):
      data = np.random.randint(0, 10, size=(2, 3, 4))
      grad = np.random.randint(0, 10, size=(2, 3, 4))
  
      v1 = nn.Variable.from_numpy_array(data, need_grad=need_grad)
      assert np.all(v1.d == data)
      assert v1.d.dtype == data.dtype
      assert v1.need_grad == need_grad
  
      v2 = nn.Variable.from_numpy_array(data, grad, need_grad)
      assert np.all(v2.d == data)
      assert v2.d.dtype == data.dtype
      assert np.all(v2.g == grad)
      assert v2.g.dtype == grad.dtype
      assert v2.need_grad == need_grad
  
imports: import pytest
  import numpy
  import nnabla
  from nnabla.testing import assert_allclose
label_desc: Use image node_id 2 for calling a global function with example usage: test_from_array(need_grad) without return types