code: def testBatchSizeIndivisibleByNumWorkers(self, is_batch_size_static):
      global_batch_size = 4
      num_workers = 3
      num_replicas_per_worker = 1
  
      def get_batch_sizes_for_worker(worker_index):
          return tensor_util.constant_value(
              distribute.batch_sizes_for_worker(
                  global_batch_size,
                  num_workers,
                  num_replicas_per_worker,
                  worker_index,
              )
          )
  
      # Manually verify this test case.
      self.assertAllEqual([2, 1, 1], get_batch_sizes_for_worker(0))
      self.assertAllEqual([1, 1, 2], get_batch_sizes_for_worker(1))
      self.assertAllEqual([1, 2, 1], get_batch_sizes_for_worker(2))
      self._test(
          global_batch_size,
          num_workers,
          num_replicas_per_worker,
          is_batch_size_static,
      )
  
imports: from absl.testing import parameterized
  import numpy
  from tensorflow.python.data.experimental.ops import distribute
  from tensorflow.python.data.kernel_tests import checkpoint_test_base
  from tensorflow.python.data.kernel_tests import test_base
  from tensorflow.python.data.ops import dataset_ops
  from tensorflow.python.data.util import nest
  from tensorflow.python.framework import combinations
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import tensor_shape
  from tensorflow.python.framework import tensor_util
  from tensorflow.python.ops import image_ops
  from tensorflow.python.ops.ragged import ragged_tensor
  from tensorflow.python.platform import test
label_desc: Use image node_id 3 for calling the BatchSizesForWorkerTest obj's underlying member method code with example usage: obj.testBatchSizeIndivisibleByNumWorkers(is_batch_size_static) and returns: tensor_util