I suggest adding the ```copy=False``` kwarg so that a copy is made only if necessary.  Also, ideally, this cast should be done only if the input is not already float32 or float64.