code: def test_bool_fill_forward_backward(
      seed, ctx, func_name, dshape, mshape, value, inf_or_nan
  ):
      from nbla_test_utils import function_tester
  
      rng = np.random.RandomState(seed)
      data = rng.randn(*dshape).astype(np.float32)
      mask = rng.randint(0, 2, mshape)
      backward = [True, False]
      if inf_or_nan != 0:
          bmask = np.broadcast_to(mask, data.shape)
          data[bmask.astype(bool)] = inf_or_nan
          # we can not compute the numerical gradients
          backward = [False, False]
      inputs = [data, mask]
  
      function_tester(
          rng,
          F.bool_fill,
          ref_bool_fill,
          inputs,
          ctx=ctx,
          func_name=func_name,
          func_args=[value],
          backward=backward,
      )
  
file_path: nnabla/python/test/function/test_bool_fill.py
imports: import pytest
  import numpy
  import nnabla
  import nnabla.functions
  from nbla_test_utils import list_context
label_desc: Use image node_id 2 for calling a global function with example usage: test_bool_fill_forward_backward(seed, ctx, func_name, dshape, mshape, value, inf_or_nan) without return types