mindspore.dataset.Dataset.device_que

Dataset.device_que(send_epoch_end=True, create_data_info_queue=False)[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.

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, dataset for transferring.

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()