Beispiel #1
0
 def restore(self, data):
     cls, args = data['__reduce__']
     unpickler = self.context
     restore = unpickler.restore
     cls = restore(cls, reset=False)
     value = util.b64decode(args[0])
     params = (value, ) + tuple([restore(i, reset=False) for i in args[1:]])
     return cls.__new__(cls, *params)
Beispiel #2
0
 def restore(self, obj):
     cls, args = obj['__reduce__']
     unpickler = self.context
     restore = unpickler.restore
     cls = restore(cls, reset=False)
     value = util.b64decode(args[0])
     params = (value,) + tuple([restore(i, reset=False) for i in args[1:]])
     return cls.__new__(cls, *params)
Beispiel #3
0
 def restore(self, obj):
     cls, args = obj['__reduce__']
     unpickler = self.context
     restore = unpickler.restore
     cls = restore(cls, reset=False)
     shape = restore(args[0])
     dtype = np.dtype(restore(args[1]))
     strides = restore(args[2])
     buffer = util.b64decode(args[3])
     return cls(shape=shape, dtype=dtype, buffer=buffer, strides=strides)