code: def _compute_output_shape(layer, shape, dtype):
      @tf.function(
          input_signature=[
              tf.TensorSpec(dtype=dtype, name="text", shape=shape)
          ]
      )
      def call(text):
          return layer(text)
  
      cf = call.get_concrete_function()
      if not isinstance(cf.output_shapes, tf.TensorShape):
          raise ValueError(
              "The SavedModel doesn't return a single result on __call__, "
              "instead it returns %s. Did you specify the right `output_key`?"
              % cf.structured_outputs
          )
      # Return dimensions after batch size.
      return cf.output_shapes[1:]
  
file_path: hub/tensorflow_hub/feature_column_v2.py
imports: import collections
  import tensorflow
  from tensorflow_hub import keras_layer
  from tensorflow.python.feature_column import feature_column_v2
label_desc: Use image node_id 1 for calling a global function with example usage: _compute_output_shape(layer, shape, dtype) and returns: cf, layer