From 852039b7265cccf975a5d9246ebbe4b305e27a31 Mon Sep 17 00:00:00 2001 From: caojian05 Date: Sat, 18 Apr 2020 18:16:29 +0800 Subject: [PATCH] fix dataset deepcopy failed while depipline referenced in the iterator --- mindspore/dataset/engine/iterators.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mindspore/dataset/engine/iterators.py b/mindspore/dataset/engine/iterators.py index d670de508..cb56a435f 100644 --- a/mindspore/dataset/engine/iterators.py +++ b/mindspore/dataset/engine/iterators.py @@ -231,6 +231,9 @@ class Iterator: def num_classes(self): return self.depipeline.GetNumClasses() + def __deepcopy__(self, memo): + return Iterator(copy.deepcopy(self.dataset, memo)) + class DictIterator(Iterator): """ -- GitLab