code: def nanprod(
      a: np.ndarray,
      /,
      *,
      axis: Optional[Union[int, Sequence[int]]] = None,
      dtype: Optional[np.dtype] = None,
      keepdims: Optional[bool] = False,
      out: Optional[np.ndarray] = None,
      initial: Optional[Union[int, float, complex]] = None,
      where: Optional[np.ndarray] = None,
  ) -> np.ndarray:
      dtype = ivy.as_native_dtype(dtype)
      if dtype is None:
          dtype = _infer_dtype(a.dtype)
      axis = tuple(axis) if isinstance(axis, list) else axis
      return np.asarray(
          np.nanprod(
              a=a,
              axis=axis,
              dtype=dtype,
              keepdims=keepdims,
              out=out,
              initial=initial,
          )
      )
  
imports: from typing import Optional, Union, Tuple, Sequence
  import numpy
  import math
  import ivy
  from ivy.func_wrapper import with_unsupported_dtypes
  from .None import backend_version
  from ..statistical import _infer_dtype
  from copy import deepcopy
label_desc: Use image node_id 5 for calling a global function with example usage: nanprod() and returns: np