【问题标题】:Using typed dictionaries in ahead of time compilation in numba在 numba 的提前编译中使用类型化的字典
【发布时间】:2023-09-05 22:44:01
【问题描述】:

我正在尝试在 numba 中使用提前编译,该函数将 numba 类型化字典作为其输入。该文件编译没有错误,但是当我加载生成的模块时出现错误:

dlopen(/path_to_module, 2): Symbol not found: __numba_hashsecret_djbx33a_suffix
  Referenced from: /path_to_module
  Expected in: flat namespace
 in /path_to_module

产生相同错误的示例函数是:

@jit(nopython=True)
@cc.export('my_func', 'f8(DictType(unicode_type, f8))')
def my_func(d):
    return d['a'] + d['b']

这个函数将被编译代码中的另一个函数调用。

【问题讨论】:

    标签: python jit numba


    【解决方案1】:

    这原来是 Numba 中的一个错误,几周前刚刚合并到 master 中的修复:

    https://github.com/numba/numba/pull/6410

    【讨论】:

      最近更新 更多