Tianshou/tianshou/env/utils.py

13 lines
262 B
Python
Raw Normal View History

2020-03-11 09:09:56 +08:00
import cloudpickle
class CloudpickleWrapper(object):
def __init__(self, data):
self.data = data
2020-03-11 09:38:14 +08:00
2020-03-11 09:09:56 +08:00
def __getstate__(self):
return cloudpickle.dumps(self.data)
2020-03-11 09:38:14 +08:00
2020-03-11 09:09:56 +08:00
def __setstate__(self, data):
self.data = cloudpickle.loads(data)