'Attempt to cast the inputs to the required types if necessary
and if they are not device array.
Side effect: Only affects the element of `norm_inputs` that requires
a type cast.'

def adjust_input_types(self, indtypes):

    for (i, (ity, val)) in enumerate(zip(indtypes, self.norm_inputs)):
        if (ity != val.dtype):
            if (not hasattr(val, 'astype')):
                msg = 'compatible    signature    is    possible    by    casting    but    {0}    does    not    support    .astype()'.format(type(val))
                raise TypeError(msg)
            self.norm_inputs[i] = val.astype(ity)
