code: def inplace_function_test_helper(
      inputs,
      func,
      func_args=[],
      func_kwargs={},
      ctx=None,
      func_name=None,
      rng=None,
  ):
      if rng is None:
          rng = np.random.RandomState(313)
      if ctx is None:
          ctx = nn.Context()
      with nn.context_scope(ctx):
          a_s = [inp * 1.0 for inp in inputs]
          y = func(
              *(a_s + list(func_args)), inplace=False, **func_kwargs
          )
          l = F.sum(y)
          a_s_i = [inp * 1.0 for inp in inputs]
          y_i = func(
              *(a_s_i + list(func_args)), inplace=True, **func_kwargs
          )
          l_i = F.sum(y_i)
      data = [
          (randn(rng, *inp.shape), randn(rng, *inp.shape))
          for inp in inputs
      ]
      for i in range(len(data)):
          inputs[i].d = data[i][0]
          inputs[i].g = data[i][1]
      l.forward()
      l.backward()
      grads = [inp.g.copy() for inp in inputs]
      for i in range(len(data)):
          inputs[i].d = data[i][0]
          inputs[i].g = data[i][1]
      l_i.forward()
      l_i.backward()
      grads_i = [inp.g.copy() for inp in inputs]
      for g, g_i in zip(grads, grads_i):
          assert_allclose(
              g, g_i, err_msg="{} inplace test fails.".format(func_name)
          )
  
imports: from nnabla.utils import nnabla_pb2
  from six.moves import filter
  import copy
  import nnabla
  import nnabla.ext_utils
  import nnabla.functions
  import nnabla.utils.converter
  import nnabla.dtypes
  from nnabla.testing import assert_allclose
  import numpy
  import numpy
  import platform
label_desc: Use image node_id 19 for calling a global function with example usage: inplace_function_test_helper(inputs, func, func_args, func_kwargs, ctx, func_name, rng) without return types