(onp_reduction, reduction, init_val)
return nan_reduction
Helper to generate nan* functions.
Helper to generate nan* functions.
Helper to generate nan * functions .
def _make_nan_reduction(onp_reduction, reduction, init_val):
  """Helper to generate nan* functions."""
  @utils.np_doc(onp_reduction)
  def nan_reduction(a, axis=None, dtype=None, keepdims=False):
    a = array_ops.array(a)
    v = array_ops.array(init_val, dtype=a.dtype)
    return reduction(
        array_ops.where(isnan(a), v, a),
        axis=axis,
        dtype=dtype,
        keepdims=keepdims)
  return nan_reduction
def _make_nan_reduction ( onp_reduction , reduction , init_val ) : @ utils . np_doc ( onp_reduction ) def nan_reduction ( a , axis = None , dtype = None , keepdims = False ) : a = array_ops . array ( a ) v = array_ops . array ( init_val , dtype = a . dtype ) return reduction ( array_ops . where ( isnan ( a ) , v , a ) , axis = axis , dtype = dtype , keepdims = keepdims ) return nan_reduction