parameters: (kvstore)
return_statement: return (kv, True)
docstring: Create kvstore assuming some parameters' storage types are row_sparse.
  
      Parameters
      ----------
      kvstore : KVStore or str
          The kvstore.
  
      Returns
      -------
      kvstore : KVStore
      update_on_kvstore : bool. Always True.
docstring_summary: Create kvstore assuming some parameters' storage types are row_sparse.
docstring_tokens: Create kvstore assuming some parameters storage types are row_sparse .
function: def _create_sparse_kvstore(kvstore):
      """Create kvstore assuming some parameters' storage types are row_sparse.
  
      Parameters
      ----------
      kvstore : KVStore or str
          The kvstore.
  
      Returns
      -------
      kvstore : KVStore
      update_on_kvstore : bool. Always True.
      """
      # always update on kvstore
      if isinstance(kvstore, kvs.KVStore):
          kv = kvstore
      elif isinstance(kvstore, str):
          kv = kvs.create(kvstore)
      else:
          raise TypeError("Cannot create '%s' KVStore with row_sparse parameters. "
                          "The type must be KVStore or str." % kvstore)
      assert kv.is_capable(kvs.KVStoreBase.OPTIMIZER), \
          "KVStore with sparse weight requires optimizer support. " \
          "However, type(kv) does not support optimizer. " \
          "Please consider other kvstore backends (e.g. dist_device) instead."
      return (kv, True)
function_tokens: def _create_sparse_kvstore ( kvstore ) : # always update on kvstore if isinstance ( kvstore , kvs . KVStore ) : kv = kvstore elif isinstance ( kvstore , str ) : kv = kvs . create ( kvstore ) else : raise TypeError ( "Cannot create '%s' KVStore with row_sparse parameters. " "The type must be KVStore or str." % kvstore ) assert kv . is_capable ( kvs . KVStoreBase . OPTIMIZER ) , "KVStore with sparse weight requires optimizer support. " "However, type(kv) does not support optimizer. " "Please consider other kvstore backends (e.g. dist_device) instead." return ( kv , True )