code: def example_nested_tensor_spec(dtype, outer_dims=()):
      minval = 0 if dtype == tf.uint8 else -10
      maxval = 255 if dtype == tf.uint8 else 10
      return {
          "spec_1": tensor_spec.TensorSpec(outer_dims + (2, 3), dtype),
          "bounded_spec_1": tensor_spec.BoundedTensorSpec(
              outer_dims + (2, 3), dtype, minval, maxval
          ),
          "bounded_spec_2": tensor_spec.BoundedTensorSpec(
              outer_dims + (2, 3), dtype, minval, minval
          ),
          "bounded_array_spec_3": tensor_spec.BoundedTensorSpec(
              outer_dims + (2,),
              dtype,
              [minval, minval],
              [maxval, maxval],
          ),
          "bounded_array_spec_4": tensor_spec.BoundedTensorSpec(
              outer_dims + (2,),
              dtype,
              [minval, minval + 1],
              [maxval, maxval - 1],
          ),
          "dict_spec": {
              "spec_2": tensor_spec.TensorSpec(
                  outer_dims + (2, 3), dtype
              ),
              "bounded_spec_2": tensor_spec.BoundedTensorSpec(
                  outer_dims + (2, 3), dtype, minval, maxval
              ),
          },
          "tuple_spec": (
              tensor_spec.TensorSpec(outer_dims + (2, 3), dtype),
              tensor_spec.BoundedTensorSpec(
                  outer_dims + (2, 3), dtype, minval, maxval
              ),
          ),
          "list_spec": [
              tensor_spec.TensorSpec(outer_dims + (2, 3), dtype),
              (
                  tensor_spec.TensorSpec(outer_dims + (2, 3), dtype),
                  tensor_spec.BoundedTensorSpec(
                      outer_dims + (2, 3), dtype, minval, maxval
                  ),
              ),
          ],
      }
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from absl.testing import parameterized
  import numpy
  import tensorflow
  from tf_agents.specs import array_spec
  from tf_agents.specs import tensor_spec
  from tf_agents.trajectories import time_step
label_desc: Use image node_id 2 for calling a global function with example usage: example_nested_tensor_spec(dtype, outer_dims) and returns: dict