Browse Source

judge return value of pyfunc

tags/v1.3.0
ms_yan 4 years ago
parent
commit
91be7cc970
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      mindspore/dataset/engine/queue.py

+ 3
- 0
mindspore/dataset/engine/queue.py View File

@@ -74,6 +74,9 @@ class _SharedQueue(multiprocessing.queues.Queue):
name_list = []
count = 0
start_bytes = 0
if not isinstance(data, tuple) and not isinstance(data, np.ndarray):
raise TypeError("return value of user defined python function in GeneratorDataset or"
" map should be numpy array or tuple of numpy array.")
for r in data:
if (isinstance(r, np.ndarray) and r.size > self.min_shared_mem
and start_bytes + r.nbytes < self.seg_size):


Loading…
Cancel
Save