我正在尝试在此仓库logsumexp上运行示例代码。
但是,当我运行示例代码时:
import sselogsumexp
x = np.random.randn(100)
sselogsumexp.logsumexp(x)
我得到了错误:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "sselogsumexp.pyx", line 8, in sselogsumexp.logsumexp (sselogsumexp.c:1258)
ValueError: Buffer dtype mismatch, expected 'float32_t' but got 'double'
如何将double
转换为float32_t
?