class_docstr: A distribution strategy for synchronous training on multiple workers.
  
  This strategy implements synchronous distributed training across multiple
  workers, each with potentially multiple GPUs. Similar to
  `tf.distribute.MirroredStrategy`, it replicates all variables and computations
  to each local device. The difference is that it uses a distributed collective
  implementation (e.g. all-reduce), so that multiple workers can work together.
class_docstr_tok: ["A","distribution","strategy","for","synchronous","training","on","multiple","workers",".","This","strategy","implements","synchronous","distributed","training","across","multiple","workers",",","each","with","potentially","multiple","GPUs",".","Similar","to","`","tf.distribute.MirroredStrategy","`",",","it","replicates","all","variables","and","computations","to","each","local","device",".","The","difference","is","that","it","uses","a","distributed","collective","implementation","(","e.g",".","all-reduce",")",",","so","that","multiple","workers","can","work","together","."]
code: def _validate_init_args(cls, mesh, cluster_resolver):
      if mesh and cluster_resolver:
          raise ValueError(
              "Mesh and cluster_resolver can not be provided at the "
              f"same time. Received mesh = {mesh}, cluster_resolver = "
              f"{cluster_resolver}"
          )
      if mesh and len(mesh.shape()) != 1:
          raise ValueError(
              "The mesh for MultiWorkerMirroredStrategy must be 1D, "
              f"received: {len(mesh.shape())}D"
          )
  
file_path: tensorflow/tensorflow/python/distribute/experimental/multi_worker_mirrored_strategy.py
imports: import os
  from tensorflow.dtensor.python import config
  from tensorflow.dtensor.python import mesh_util
  from tensorflow.python.distribute import distribute_lib
  from tensorflow.python.distribute import multi_worker_util
  from tensorflow.python.distribute.cluster_resolver import tfconfig_cluster_resolver
  from tensorflow.python.distribute.experimental import dtensor_strategy_extended
  from tensorflow.python.distribute.experimental import dtensor_util
label_desc: Use image node_id 2 for calling the MultiWorkerMirroredStrategy obj's underlying member method code with example usage: obj._validate_init_args(cls, mesh, cluster_resolver) without return types