Numba: How to Suppress

微笑、不失礼 提交于 2021-01-28 12:11:32

问题


I keep on getting this error in my numba code:

Warning 101:0: Unused argument 'self'

My numba code is below. How do I suppress the error message?

@autojit
def initialise_output_data(self, input_data, output_data, params ):

    # Unpack Params
    #omega = params['omega']
    #beta  = params['beta']
    #gamma = params['gamma']
    psi   = params['psi']    

    # Unpack Output Data
    mu    = output_data['mu']
    s2    = output_data['sigma2']        
    res   = output_data['residuals']
    res2  = output_data['residuals2']        

    # Initialise Garch Variables
    s2[0]   = input_data[ 'sample_var' ]
    res[0]  = psi[0] / ( 1.0-psi[1] )
    res2[0] = res[0]**2
    mu[0]   = psi[0] + psi[1]*res[0] 

回答1:


You can suppress all numba warnings on a specific function with warn=False. For example:

@numba.autojit(warn=False)
def f(a, b):
    return a

f doesn't use b but numba does not issue a warning. This works for @numba.jit also. Just be careful!



来源:https://stackoverflow.com/questions/21208465/numba-how-to-suppress

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!