问题
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