def upcast_int8_nfunc(fn):
 def ret(*args, **kwargs):
  args = list(args)
  for (i, a) in enumerate(args):
   if (getattr(a, 'dtype', None) in ('int8', 'uint8')):
    args[i] = a.astype('float32')
  return fn(*args, **kwargs)
 return ret

def upcast_int8_nfunc ( fn ) : def ret ( * args , ** kwargs ) : args = list ( args ) for ( i , a ) in enumerate ( args ) : if ( getattr ( a , 'dtype' , None ) in ( 'int8' , 'uint8' ) ) : args [ i ] = a . astype ( 'float32' ) return fn ( * args , ** kwargs ) return ret
decorator that upcasts input of dtype int8 to float32 .