code: def create_cumprod_input(
      rng, shape, axis, with_mask, with_random_zero_pos, zero_pos
  ):
      x = (rng.randn(*shape)).astype(np.float32)
      if with_mask:
          if with_random_zero_pos:
              # Make zero elements with the probability of `1 / x_shape[axis]`.
              # It is the probability of existence of one zero element in each scan axis.
              mask = rng.rand(*shape) > (1.0 / shape[axis])
              x = x * mask
          else:
              x.swapaxes(0, axis)[zero_pos] = 0
      return x
  
file_path: nnabla/python/test/function/test_cumprod.py
imports: import pytest
  import numpy
  import nnabla
  import nnabla.functions
  from nbla_test_utils import list_context
  from refs import cumprod
  from refs import cumprod_backward
label_desc: Use image node_id 1 for calling a global function with example usage: create_cumprod_input(rng, shape, axis, with_mask, with_random_zero_pos, zero_pos) and returns: x