# chainer.datasets.open_pickle_dataset_writer¶

chainer.datasets.open_pickle_dataset_writer(path, protocol=4)[source]

Opens a writer to make a PickleDataset.

This is a helper function to open PickleDatasetWriter. It opens a given file in binary mode and creates a PickleDatasetWriter instance.

This method does not close the opened file. A user needs to call PickleDatasetWriter.close() or use with:

with chainer.datasets.open_pickle_dataset_writer('path') as writer:
pass  # use writer

Parameters
Returns

Opened writer.

Return type

chainer.datasets.PickleDatasetWriter