def deepcopy(self):
""" Return a deep copy of the batch.
Constructs a new ``Batch`` instance and then recursively copies all
the objects found in the original batch, except the ``pipeline``,
which remains unchanged.
Returns
-------
Batch
"""
pipeline = self.pipeline
self.pipeline = None
dump_batch = dill.dumps(self)
self.pipeline = pipeline
restored_batch = dill.loads(dump_batch)
restored_batch.pipeline = pipeline
return restored_batch
评论列表
文章目录