code: def testNest(self, strategy):
      @def_function.function
      def f():
          return {
              "foo": array_ops.ones((), dtypes.float32),
              "bar": [
                  array_ops.zeros((), dtypes.float32),
                  array_ops.ones((), dtypes.float32),
              ],
          }
  
      results = test_util.gather(strategy, strategy.run(f))
      self.assertAllEqual(
          self.evaluate(results["foo"]),
          [1.0] * strategy.num_replicas_in_sync,
      )
      self.assertAllEqual(
          self.evaluate(results["bar"][0]),
          [0.0] * strategy.num_replicas_in_sync,
      )
      self.assertAllEqual(
          self.evaluate(results["bar"][1]),
          [1.0] * strategy.num_replicas_in_sync,
      )
  
imports: import sys
  from absl.testing import parameterized
  from tensorflow.python.distribute import combinations
  from tensorflow.python.distribute import strategy_combinations
  from tensorflow.python.distribute import test_util
  from tensorflow.python.eager import context
  from tensorflow.python.eager import def_function
  from tensorflow.python.eager import test
  from tensorflow.python.framework import config
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.ops import array_ops
label_desc: Use image node_id 2 for calling the GatherTest obj's underlying member method code with example usage: obj.testNest(strategy) and returns: dict