class_docstr: An abstract key-value store interface for data parallel training.
class_docstr_tok: ["An","abstract","key-value","store","interface","for","data","parallel","training","."]
docstr: Registers a new KVStore.
  Once a kvstore is registered, we can create an instance of this
  kvstore with `create` later.
  
  Examples
  --------
  >>> @mx.kvstore.KVStoreBase.register
  ... class MyKVStore(mx.kvstore.KVStoreBase):
  ...     pass
  >>> kv = mx.kv.create('MyKVStore')
  >>> print(type(kv))
  <class '__main__.MyKVStore'>
docstr_tok: ["Registers","a","new","KVStore",".","Once","a","kvstore","is","registered",",","we","can","create","an","instance","of","this","kvstore","with","`","create","`","later",".","Examples","--","--","--","--",">",">",">","@","mx.kvstore.KVStoreBase.register","...","class","MyKVStore","(","mx.kvstore.KVStoreBase",")",":","...","pass",">",">",">","kv","=","mx.kv.create","(","'MyKVStore","'",")",">",">",">","print","(","type","(","kv",")",")","<","class","'__main__.MyKVStore","'",">"]
code: def register(klass):
      """Registers a new KVStore.
      Once a kvstore is registered, we can create an instance of this
      kvstore with `create` later.
  
      Examples
      --------
      >>> @mx.kvstore.KVStoreBase.register
      ... class MyKVStore(mx.kvstore.KVStoreBase):
      ...     pass
      >>> kv = mx.kv.create('MyKVStore')
      >>> print(type(kv))
      <class '__main__.MyKVStore'>
      """
      assert isinstance(klass, type)
      name = klass.__name__.lower()
      if name in KVStoreBase.kv_registry:
          warnings.warn(
              f"WARNING: New kvstore {klass.__module__}.{klass.__name__} is overriding "
              "existing kvstore "
              f"{KVStoreBase.kv_registry[name].__module__}.{KVStoreBase.kv_registry[name].__name__}"
          )
      KVStoreBase.kv_registry[name] = klass
      return klass
  
imports: from array import array
  import ctypes
  import warnings
  from ..ndarray import NDArray
  from ..base import _LIB, c_str_array, c_handle_array, c_array, c_array_buf, c_str
  from ..base import check_call, string_types
  from ..base import KVStoreHandle
  from ..profiler import set_kvstore_handle
label_desc: Use image node_id 10 for calling the KVStoreBase obj's underlying member method code with example usage: obj.register(klass) and returns: klass