class_docstr: Synchronous training across multiple replicas on one machine.
  
  This strategy is typically used for training on one machine with multiple
  accelerators (GPUs/TPUs).
  
  For example, a variable created under a `MirroredStrategy` is a distributed
  variable with layout replicated on each dimension. The variables will be
  placed on the `mesh` that is specified in the __init__.
class_docstr_tok: ["Synchronous","training","across","multiple","replicas","on","one","machine",".","This","strategy","is","typically","used","for","training","on","one","machine","with","multiple","accelerators","(","GPUs\/TPUs",")",".","For","example",",","a","variable","created","under","a","`","MirroredStrategy","`","is","a","distributed","variable","with","layout","replicated","on","each","dimension",".","The","variables","will","be","placed","on","the","`","mesh","`","that","is","specified","in","the","__init__","."]
code: def _validate_init_args(cls, mesh, devices):
      if mesh and devices:
          raise ValueError(
              "Mesh and devices can not be provided at the same time. "
              f"received mesh = {mesh}, devices = {devices}"
          )
  
      # For mirrored strategy, the mesh should be 1D, and only contains a batch
      # dimension, we will use that dimension to shard the inputs.
      if mesh and len(mesh.shape()) != 1:
          raise ValueError(
              "The mesh for MirroredStrategy must be 1D, received: "
              f"{len(mesh.shape())}D"
          )
  
file_path: tensorflow-upstream/tensorflow/python/distribute/experimental/mirrored_strategy.py
imports: from tensorflow.dtensor.python import config
  from tensorflow.dtensor.python import mesh_util
  from tensorflow.python.distribute import distribute_lib
  from tensorflow.python.distribute.experimental import dtensor_strategy_extended
  from tensorflow.python.distribute.experimental import dtensor_util
  from tensorflow.python.framework import device
label_desc: Use image node_id 2 for calling the MirroredStrategy obj's underlying member method code with example usage: obj._validate_init_args(cls, mesh, devices) without return types