Numba:如何抑制

时间:2014-01-18 18:54:32

标签: python-3.x numba

我继续在我的numba代码中出现此错误:

Warning 101:0: Unused argument 'self'

我的numba代码如下。如何禁止显示错误消息?

@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 个答案:

答案 0 :(得分:1)

您可以使用warn=False取消对特定功能的所有numba警告。例如:

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

f不使用b但numba不发出警告。这适用于@numba.jit。小心!