mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-30 14:35:15 +02:00
resolve the problem of pickling a gpu kernel
This commit is contained in:
parent
e9d33ddc7e
commit
deb48407ff
1 changed files with 3 additions and 7 deletions
|
|
@ -34,16 +34,12 @@ class RBF(Stationary):
|
|||
|
||||
def __getstate__(self):
|
||||
dc = super(RBF, self).__getstate__()
|
||||
# if self.useGPU:
|
||||
# dc['psicomp'] = PSICOMP_RBF()
|
||||
# dc['useGPU'] = False
|
||||
if self.useGPU:
|
||||
dc['psicomp'] = PSICOMP_RBF()
|
||||
dc['useGPU'] = False
|
||||
return dc
|
||||
|
||||
def __setstate__(self, state):
|
||||
from ...util.gpu_init import gpu_initialized
|
||||
if state['useGPU'] and not gpu_initialized:
|
||||
state['useGPU'] = False
|
||||
state['psicomp'] = PSICOMP_RBF()
|
||||
return super(RBF, self).__setstate__(state)
|
||||
|
||||
def spectrum(self, omega):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue