* add makefile * bump version * add isort and yapf * update contributing.md * update PR template * spelling check
17 lines
378 B
Python
17 lines
378 B
Python
from typing import Any
|
|
|
|
import cloudpickle
|
|
|
|
|
|
class CloudpickleWrapper(object):
|
|
"""A cloudpickle wrapper used in SubprocVectorEnv."""
|
|
|
|
def __init__(self, data: Any) -> None:
|
|
self.data = data
|
|
|
|
def __getstate__(self) -> str:
|
|
return cloudpickle.dumps(self.data)
|
|
|
|
def __setstate__(self, data: str) -> None:
|
|
self.data = cloudpickle.loads(data)
|