I am exploring the scipy.linalg.get_blas_function() method in python. But I am noticing some difficulties it has in handling numpy int types.
Input
import scipy.linalg
import numpy as np
def blas(name, ndarray):
arr = scipy.linalg.get_blas_funcs((name,), (ndarray,), dtype=ndarray.dtype)[0]
return arr
blas_scal = blas('scal', np.array([], dtype=np.int32))
print "int32 --> %s" % (blas_scal.dtype)
blas_scal = blas('scal', np.array([], dtype=np.int64))
print "int64 --> %s" % (blas_scal.dtype)
blas_scal = blas('scal', np.array([], dtype=np.float32))
print "float32 --> %s" % (blas_scal.dtype)
blas_scal = blas('scal', np.array([], dtype=np.float64))
print "float64 --> %s" % (blas_scal.dtype)
Output
int32 --> float64
int64 --> float64
float32 --> float32
float64 --> float64
As you can see, the get_blas_funcs() seems to ignore the data type when it is an integer, and outputs float64 whenever you have any sort of numpy integer. However, inputting a numpy float32 or numpy64 is fine with get_blas_funcs(), and it doesn't change the dtype as it goes through to output.
What is happening here? How does this function handle data types?