code: def test_assign_forward_backward(seed, ctx, func_name):
      rng = np.random.RandomState(seed)
      dst = nn.Variable((2, 3, 4), need_grad=True)
      src = nn.Variable((2, 3, 4), need_grad=True)
  
      assign = F.assign(dst, src)
  
      src.d = rng.rand(2, 3, 4)
      assign.forward()
  
      # destination variable should be equal to source variable
      assert_allclose(dst.d, src.d)
      # output variable of assign function should be equal to source variable
      assert_allclose(assign.d, src.d)
  
      dummy = assign + rng.rand()
  
      dst.grad.zero()
      src.grad.zero()
      dummy.forward()
      dummy.backward()
  
      # gradients at destination are identical to gradients at assign operation
      assert not np.all(dst.g == np.zeros((2, 3, 4)))
      assert np.all(dst.g == assign.g)
      assert np.all(src.g == np.zeros((2, 3, 4)))
  
      # check accum=False
      assign.grad.zero()
      dst.g = rng.rand(2, 3, 4)
      f = assign.parent
      f.forward([dst, src], [assign])
      f.backward([dst, src], [assign], accum=[False])
      assert np.all(dst.g == assign.g)
      assert np.all(src.g == np.zeros((2, 3, 4)))
  
file_path: nnabla/python/test/function/test_assign.py
imports: import pytest
  import numpy
  import nnabla
  import nnabla.functions
  from nbla_test_utils import list_context, recomputation_test
  from nnabla.testing import assert_allclose
label_desc: Use image node_id 1 for calling a global function with example usage: test_assign_forward_backward(seed, ctx, func_name) without return types