python-对包含文件打开和关闭的代码使用 jit 装饰器
发布时间:2022-08-17 23:32:12 225
相关标签: # node.js
我有一个程序,在nopython模式下使用Numba的@jit decorator,与非Numba版本相比,输出结果的时间要短得多。现在,我想在每个循环中将一些结果存储到。我的程序中的dat文件。
对于普通版本,我只会使用open
但jit装饰器不支持它。
下面是我实际代码的示例代表代码:
@jit(nopython=True)
def f(x,y,z):
max=10
Time=0
time_plot=[Time]
X=[x]
Y=[y]
Tfile=f.open('T.dat')
while Time
这不起作用,因为:
TypingError: Failed in nopython mode pipeline (step: nopython frontend)
Unknown attribute 'open' of type recursive(type(CPUDispatcher()))
我还有什么选择?
特别声明:以上内容(图片及文字)均为互联网收集或者用户上传发布,本站仅提供信息存储服务!如有侵权或有涉及法律问题请联系我们。
举报