code: def zero_spec_nest(specs, outer_dims=None):
      """Create zero tensors for a given spec.
  
      Args:
        specs: A nest of `TensorSpec`.
        outer_dims: An optional list of constants or `Tensor` specifying outer
          dimensions to add to the spec shape before sampling.
  
      Returns:
        A nest of zero tensors matching `specs`, with the optional outer
        dimensions added.
  
      Raises:
        TypeError: If `specs` is an unknown type.
        NotImplementedError: If `specs` contains non-dense tensor specs.
      """
  
      def make_zero(spec):
          if not isinstance(spec, TensorSpec):
              raise NotImplementedError(
                  "Spec type not supported: '{}'".format(spec)
              )
          if outer_dims is None:
              shape = spec.shape
          else:
              spec_shape = tf.convert_to_tensor(
                  value=spec.shape, dtype=tf.int32
              )
              shape = tf.concat((outer_dims, spec_shape), axis=0)
          return tf.zeros(shape, spec.dtype)
  
      if specs:
          if outer_dims is None:
              outer_dims = tf.constant([], dtype=tf.int32)
          else:
              outer_dims = tf.convert_to_tensor(
                  outer_dims, dtype=tf.int32
              )
  
      return tf.nest.map_structure(make_zero, specs)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  from typing import Union
  import numpy
  import tensorflow
  import tensorflow_probability
  from tf_agents.specs import array_spec
  from tf_agents.typing import types
  from google.protobuf import text_format
  from tensorflow.core.protobuf import struct_pb2
  from tensorflow.python.framework import tensor_spec
  from tensorflow.python.saved_model import nested_structure_coder
label_desc: Use image node_id 13 for calling a global function with example usage: zero_spec_nest(specs, outer_dims) and returns: tf, tf