Function mindspore::dataset::CreateDatasetCacheCharIF

Function Documentation

std::shared_ptr<DatasetCache> mindspore::dataset::CreateDatasetCacheCharIF(session_id_type id, uint64_t mem_sz, bool spill, std::optional<std::vector<char>> 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 to create a cache to be attached to a dataset.

Note

The reason for providing this API is that std::string will be constrained by the compiler option ‘_GLIBCXX_USE_CXX11_ABI’ while char is free of this restriction.

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.