mindspore.dataset.Dataset.device_que

View Source On Gitee
Dataset.device_que(send_epoch_end=True, create_data_info_queue=False, queue_name='')[source]

Return a transferred Dataset that transfers data through a device.

Parameters
  • send_epoch_end (bool, optional) – Whether to send end of sequence to device or not. Default: True.

  • create_data_info_queue (bool, optional) – Whether to create queue which stores types and shapes of data or not. Default: False.

  • queue_name (str, optional) – Name of queue which connects dataset processing and model computing. Default: "".

Note

If device is Ascend, features of data will be transferred one by one. The limitation of data transmission per time is 256M.

Returns

Dataset, a new dataset with the above operation applied.

Examples

>>> import mindspore.dataset as ds
>>> import time
>>>
>>> data = ds.TFRecordDataset('/path/to/TF_FILES', '/path/to/TF_SCHEMA_FILE', shuffle=ds.Shuffle.FILES)
>>> data = data.device_que()
>>> data.send()
>>> time.sleep(0.1)
>>> data.stop_send()