class_docstr: Strategy extension that support both single and multi worker strategy.
code: def _num_replicas_in_sync(self):
      # The mesh should be 1D with batch sharding only.
      # In the model parallel case, it should only return the size of
      # batch dimension.
      return self._mesh.size
  
imports: import functools
  from tensorflow.dtensor.python import api
  from tensorflow.dtensor.python import config
  from tensorflow.dtensor.python import d_variable
  from tensorflow.dtensor.python import input_util
  from tensorflow.dtensor.python import layout
  from tensorflow.python.data.experimental.ops import distribute
  from tensorflow.python.distribute import distribute_lib
  from tensorflow.python.distribute import distribute_utils
  from tensorflow.python.distribute.experimental import dtensor_util
  from tensorflow.python.framework import ops
  from tensorflow.python.ops import array_ops
  from tensorflow.python.util import nest
label_desc: Use image node_id 3 for calling the DTensorStrategyExtended obj's underlying member method code with example usage: obj._num_replicas_in_sync() and returns: self