def upcast_float16_ufunc(fn):
 def ret(*args, **kwargs):
  out_dtype = numpy.find_common_type([a.dtype for a in args], [numpy.float16])
  if (out_dtype == 'float16'):
   sig = ((('f' * fn.nin) + '->') + ('f' * fn.nout))
   kwargs.update(sig=sig)
  return fn(*args, **kwargs)
 return ret

def upcast_float16_ufunc ( fn ) : def ret ( * args , ** kwargs ) : out_dtype = numpy . find_common_type ( [ a . dtype for a in args ] , [ numpy . float16 ] ) if ( out_dtype == 'float16' ) : sig = ( ( ( 'f' * fn . nin ) + '->' ) + ( 'f' * fn . nout ) ) kwargs . update ( sig = sig ) return fn ( * args , ** kwargs ) return ret
decorator that enforces computation is not done in float16 by numpy .