當前位置: 首頁>>代碼示例>>Python>>正文


Python tensorflow.broadcast_global_variables方法代碼示例

本文整理匯總了Python中horovod.tensorflow.broadcast_global_variables方法的典型用法代碼示例。如果您正苦於以下問題:Python tensorflow.broadcast_global_variables方法的具體用法?Python tensorflow.broadcast_global_variables怎麽用?Python tensorflow.broadcast_global_variables使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在horovod.tensorflow的用法示例。


在下文中一共展示了tensorflow.broadcast_global_variables方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: broadcast_global_variables

# 需要導入模塊: from horovod import tensorflow [as 別名]
# 或者: from horovod.tensorflow import broadcast_global_variables [as 別名]
def broadcast_global_variables(cls, *args):
    """Get a TensorFlow operation to broadcast all the global variables."""

    try:
      return mgw.broadcast_global_variables(*args)
    except NameError:
      raise NameError('module <mgw> not imported') 
開發者ID:yuanyuanli85,項目名稱:tf-hrnet,代碼行數:9,代碼來源:multi_gpu_wrapper.py

示例2: broadcast_global_variables

# 需要導入模塊: from horovod import tensorflow [as 別名]
# 或者: from horovod.tensorflow import broadcast_global_variables [as 別名]
def broadcast_global_variables(root_rank):
    """Broadcasts all global variables from root rank to all other processes.

    Arguments:
        root_rank: Rank of the process from which global variables will be broadcasted
                   to all other processes.
    """
    bcast_op = hvd.broadcast_global_variables(root_rank)
    return K.get_session().run(bcast_op) 
開發者ID:mlperf,項目名稱:training_results_v0.6,代碼行數:11,代碼來源:__init__.py

示例3: on_train_begin

# 需要導入模塊: from horovod import tensorflow [as 別名]
# 或者: from horovod.tensorflow import broadcast_global_variables [as 別名]
def on_train_begin(self, logs=None):
        with tf.device(self.device):
            bcast_op = hvd.broadcast_global_variables(self.root_rank)
            K.get_session().run(bcast_op) 
開發者ID:mlperf,項目名稱:training_results_v0.6,代碼行數:6,代碼來源:callbacks.py


注:本文中的horovod.tensorflow.broadcast_global_variables方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。