code: def test_randn_forward_backward(
      seed, ctx, func_name, mu, sigma, shape
  ):
      with nn.context_scope(ctx):
          o = F.randn(mu, sigma, shape, seed=seed)
      assert o.shape == tuple(shape)
      assert o.parent.name == func_name
      o.forward()
      if o.size >= 10000:
          est_mu = o.d.mean()
          est_sigma = o.d.std()
          np.isclose(est_mu, mu, atol=sigma)
          np.isclose(est_sigma, sigma, atol=sigma)
      else:
          data = []
          for i in range(10000):
              o.forward()
              data += [o.d.copy()]
          est_mu = np.mean(np.array(data))
          est_sigma = np.std(np.array(data))
          np.isclose(est_mu, mu, atol=sigma)
          np.isclose(est_sigma, sigma, atol=sigma)
  
      # Checking recomputation
      func_args = [mu, sigma, shape, seed]
      recomputation_test(
          rng=None,
          func=F.randn,
          vinputs=[],
          func_args=func_args,
          func_kwargs={},
          ctx=ctx,
      )
  
file_path: nnabla/python/test/function/test_random_functions.py
imports: import pytest
  import numpy
  import nnabla
  import nnabla.functions
  from nbla_test_utils import list_context, recomputation_test
  import platform
label_desc: Use image node_id 3 for calling a global function with example usage: test_randn_forward_backward(seed, ctx, func_name, mu, sigma, shape) without return types