0
객체 메소드의 산세와 오류 :cythonized 클래스로 dask를 사용합니다. 나는 다음과 같은 클래스와 파이썬 모듈을 cythonize 싶습니다
cythonized 모듈의 설치가 내가 코드를 실행하기 위해 노력하고있어 후class C:
def __init__(self, x):
self.x = x
@staticmethod
def f(k):
return k
def g(self, k):
return self.x, k
:
from dask import delayed, multiprocessing
c = C(3)
l = []
for i in range(10):
l.append(delayed(c.f)(i))
results = delayed(l).compute(num_workers=2, get=multiprocessing.get)
을 산 세척 오류가 발생했습니다 (정적 및 비 정적 방법에 대해 동일).
~/anaconda/envs/cython_env/lib/python3.6/site-
packages/cloudpickle/cloudpickle.py in save_global(self, obj, name,
pack)
621 self.save_dynamic_class(obj)
622 else:
--> 623 raise pickle.PicklingError("Can't pickle %r" % obj)
624
625 dispatch[type] = save_global
PicklingError: Can't pickle <cyfunction C.f at 0x113582b10>
왜 그런가?