code: def testMeanTensor(self, distribution):
      def _dataset_fn():
          dataset = dataset_ops.Dataset.range(1000).map(
              math_ops.to_float
          )
          # Want to produce a fixed, known shape, so drop remainder when batching.
          dataset = dataset.batch(4, drop_remainder=True)
          return dataset
  
      def _expected_fn(num_batches):
          # Mean(0, 4, ..., 4 * num_batches - 4) == 2 * num_batches - 2
          # Mean(1, 5, ..., 4 * num_batches - 3) == 2 * num_batches - 1
          # Mean(2, 6, ..., 4 * num_batches - 2) == 2 * num_batches
          # Mean(3, 7, ..., 4 * num_batches - 1) == 2 * num_batches + 1
          first = 2.0 * num_batches - 2.0
          return [first, first + 1.0, first + 2.0, first + 3.0]
  
      self._test_metric(
          distribution, _dataset_fn, metrics.mean_tensor, _expected_fn
      )
  
imports: from absl.testing import parameterized
  from tensorflow.python.data.ops import dataset_ops
  from tensorflow.python.distribute import combinations
  from tensorflow.python.distribute import strategy_combinations
  from tensorflow.python.distribute import strategy_test_lib
  from tensorflow.python.eager import test
  from tensorflow.python.framework import ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import metrics
  from tensorflow.python.ops import variables
label_desc: Use image node_id 6 for calling the MetricsV1Test obj's underlying member method code with example usage: obj.testMeanTensor(distribution) and returns: dataset, list