code: def test_reshape():
      v = nn.Variable([2, 3, 4], need_grad=True)
      grad = np.random.randn(*v.shape).astype(np.float32)
      v.g = grad
      v.d = np.random.randn(*v.shape)
      import nnabla.functions as F
  
      with nn.context_scope(nn.Context()), nn.auto_forward():
          v2 = F.identity(v)
          v2_s = v2.reshape((3, 4, 2))
          v3 = F.identity(v2_s)
      v3.backward(clear_buffer=False)
      assert np.all(v2_s.g.flat == v2.g.flat)
      assert np.all(v2_s.g == 1)
      v2.d = 1
      assert np.all(v2_s.d == 1)
  
      # Check unlink
      v2_su = v2.reshape((3, 4, 2), unlink=True)
      assert v2_su.need_grad
      assert v2_su.parent is None
      v2_su.need_grad = False
      v2_su2 = v2_su.reshape((3, 4, 2), unlink=True)
      assert not v2_su2.need_grad
      assert v2_su2.parent is None
  
imports: import pytest
  import numpy
  import nnabla
  from nnabla.testing import assert_allclose
label_desc: Use image node_id 7 for calling a global function with example usage: test_reshape() without return types