fixed attribute error for _current_plan with threading
@@ -9,8 +9,6 @@ from cupy.cuda cimport stream as stream_module
cdef object _thread_local = threading.local()
-if not hasattr(_thread_local, '_current_plan'):
- _thread_local._current_plan = None
cpdef get_current_plan():
@@ -19,6 +17,8 @@ cpdef get_current_plan():
Returns:
None or cupy.cuda.cufft.Plan1d or cupy.cuda.cufft.PlanNd
"""
+ if not hasattr(_thread_local, '_current_plan'):
+ _thread_local._current_plan = None
return _thread_local._current_plan
