예제 #1
0
파일: prims.py 프로젝트: Tillsten/parakeet
 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)
예제 #2
0
파일: prims.py 프로젝트: iskandr/parakeet
 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)
예제 #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)