Function mindspore::dataset::CreateDatasetCache

Function Documentation

inline std::shared_ptr<DatasetCache> mindspore::dataset::CreateDatasetCache(session_id_type id, uint64_t mem_sz, bool spill, std::optional<std::string> hostname = std::nullopt, std::optional<int32_t> port = std::nullopt, std::optional<int32_t> num_connections = std::nullopt, std::optional<int32_t> prefetch_sz = std::nullopt)

Function the create a cache to be attached to a dataset.

Parameters
  • id[in] A user assigned session id for the current pipeline.

  • mem_sz[in] Size of the memory set aside for the row caching (default=0 which means unlimited, note that it might bring in the risk of running out of memory on the machine).

  • spill[in] Spill to disk if out of memory (default=False).

  • hostname[in] optional host name (default=”127.0.0.1”).

  • port[in] optional port (default=50052).

  • num_connections[in] optional number of connections (default=12).

  • prefetch_sz[in] optional prefetch size (default=20).

Returns

Shared pointer to DatasetCache. If error, nullptr is returned.