class_docstr: A key-value store for synchronization of values, over multiple devices.
class_docstr_tok: ["A","key-value","store","for","synchronization","of","values",",","over","multiple","devices","."]
docstr: Broadcast the `value` NDArray at rank 0 to all ranks,
  and store the result in `out`.
  
  Note that the native KVStore does not support broadcasting the same key more than once.
  
  Parameters
  ----------
  key : str, or int
      The key.
  
  value : NDArray, list of NDArray, or list of list of NDArray
      Values corresponding to the keys.
  
  out: NDArray or list of NDArray or list of list of NDArray
      Outputs corresponding to the keys.
  
  priority : int, optional
      The priority of the operation.
      Higher priority operations are likely to be executed before other actions.
  
  Examples
  --------
  >>> # broadcast a single key-value pair
  >>> shape = (2,3)
  >>> kv = mx.kv.create('local')
  >>> a = mx.nd.zeros(shape)
  >>> kv.broadcast('3', mx.nd.ones(shape)*2, out=a)
  >>> print a.asnumpy()
  [[ 2.  2.  2.]
  [ 2.  2.  2.]]
docstr_tok: ["Broadcast","the","`","value","`","NDArray","at","rank","0","to","all","ranks",",","and","store","the","result","in","`","out","`",".","Note","that","the","native","KVStore","does","not","support","broadcasting","the","same","key","more","than","once",".","Parameters","--","--","--","--","--","key",":","str",",","or","int","The","key",".","value",":","NDArray",",","list","of","NDArray",",","or","list","of","list","of","NDArray","Values","corresponding","to","the","keys",".","out",":","NDArray","or","list","of","NDArray","or","list","of","list","of","NDArray","Outputs","corresponding","to","the","keys",".","priority",":","int",",","optional","The","priority","of","the","operation",".","Higher","priority","operations","are","likely","to","be","executed","before","other","actions",".","Examples","--","--","--","--",">",">",">","#","broadcast","a","single","key-value","pair",">",">",">","shape","=","(","2,3",")",">",">",">","kv","=","mx.kv.create","(","'local","'",")",">",">",">","a","=","mx.nd.zeros","(","shape",")",">",">",">","kv.broadcast","(","'","3","'",",","mx.nd.ones","(","shape",")","*","2",",","out=a",")",">",">",">","print","a.asnumpy","(",")","[","[","2",".","2",".","2",".","]","[","2",".","2",".","2",".","]","]"]
code: def broadcast(self, key, value, out, priority=0):
      """Broadcast the `value` NDArray at rank 0 to all ranks,
      and store the result in `out`.
  
      Note that the native KVStore does not support broadcasting the same key more than once.
  
      Parameters
      ----------
      key : str, or int
          The key.
  
      value : NDArray, list of NDArray, or list of list of NDArray
          Values corresponding to the keys.
  
      out: NDArray or list of NDArray or list of list of NDArray
          Outputs corresponding to the keys.
  
      priority : int, optional
          The priority of the operation.
          Higher priority operations are likely to be executed before other actions.
  
      Examples
      --------
      >>> # broadcast a single key-value pair
      >>> shape = (2,3)
      >>> kv = mx.kv.create('local')
      >>> a = mx.nd.zeros(shape)
      >>> kv.broadcast('3', mx.nd.ones(shape)*2, out=a)
      >>> print a.asnumpy()
      [[ 2.  2.  2.]
      [ 2.  2.  2.]]
  
      """
      cvkeys, cvals, use_str_keys = _ctype_key_value(key, value)
      cokeys, couts, _ = _ctype_key_value(key, out)
  
      if use_str_keys:
          check_call(
              _LIB.MXKVStoreBroadcastEx(
                  self.handle,
                  mx_uint(len(cvkeys)),
                  cvkeys,
                  mx_uint(len(cokeys)),
                  cokeys,
                  cvals,
                  couts,
                  ctypes.c_int(priority),
              )
          )
      else:
          check_call(
              _LIB.MXKVStoreBroadcast(
                  self.handle,
                  mx_uint(len(cvkeys)),
                  cvkeys,
                  mx_uint(len(cokeys)),
                  cokeys,
                  cvals,
                  couts,
                  ctypes.c_int(priority),
              )
          )
  
imports: import pickle
  import ctypes
  import os
  from ..ndarray import NDArray
  from ..ndarray import _ndarray_cls
  from ..base import _LIB, c_str
  from ..base import check_call, mx_uint, py_str
  from ..base import NDArrayHandle, KVStoreHandle
  from ..None import optimizer
  from .base import _ctype_key_value, _ctype_dict, KVStoreBase
label_desc: Use image node_id 3 for calling the KVStore obj's underlying member method code with example usage: obj.broadcast(key, value, out, priority) without return types