Ejemplo n.º 1
0
 def expected_input_types(self, arg_types):
   max_nbytes = max(t.nbytes for t in arg_types)
   if max_nbytes <= 4:
     upcast_types = [Float32.combine(t) for t in arg_types]
   else:
     upcast_types = [Float64.combine(t) for t in arg_types]
   return Prim.expected_input_types(self, upcast_types)
Ejemplo n.º 2
0
 def expected_input_types(self, arg_types):
     assert all(isinstance(t, ScalarT) for t in arg_types), \
         "Prim %s expects scalar inputs but given %s" % (self, arg_types)
     max_nbytes = max(t.nbytes for t in arg_types)
     if max_nbytes <= 4:
         upcast_types = [Float32.combine(t) for t in arg_types]
     else:
         upcast_types = [Float64.combine(t) for t in arg_types]
     return Prim.expected_input_types(self, upcast_types)
Ejemplo n.º 3
0
 def expected_input_types(self, arg_types):
   assert all(isinstance(t, ScalarT) for t in arg_types), \
       "Prim %s expects scalar inputs but given %s" % (self, arg_types)
   max_nbytes = max(t.nbytes for t in arg_types)
   if max_nbytes <= 4:
     upcast_types = [Float32.combine(t) for t in arg_types]
   else:
     upcast_types = [Float64.combine(t) for t in arg_types]
   return Prim.expected_input_types(self, upcast_types)