KeyError: dtype('int32') for Anaconda Accelerate library

KeyError: dtype('int32') for Anaconda Accelerate library

我正在尝试学习如何使用 anaconda 的加速库。根据 https://docs.anaconda.com/accelerate/cublas.html,amin() 方法 "finds the index of the first largest element in array x. Same as np.argmax(x)"。

这是我的代码:

import accelerate.cuda.blas as blas
import numpy as np

self = blas.Blas()
a = np.array([1, 2, 3, 4])
print(self.amin(a))

这就是它 returns

Traceback (most recent call last):
File "/opt/anaconda1anaconda2anaconda3\api.py", line 147, in _dispatch
KeyError: dtype('int32')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\Boo\Desktop\clarify.py", 
line 11, in <module>
print(self.amin(a))
File "/opt/anaconda1anaconda2anaconda3\api.py", line 238, in amin
File "/opt/anaconda1anaconda2anaconda3\api.py", line 149, in _dispatch
TypeError: int32

np.array 需要是一个 float32 数组而不是默认的 int32

import accelerate.cuda.blas as blas
import numpy as np

self = blas.Blas()
a = np.array([1, 2, 3, 4], dtype='float32')
print(self.amin(a))