code: def get_output_specs_from_function(
      func: tf_function.ConcreteFunction,
  ):
      output_specs = nest.map_structure(
          type_spec.type_spec_from_value, func.structured_outputs
      )
      output_specs_proto = nested_structure_coder.encode_structure(
          output_specs
      )
      return output_specs_proto.SerializeToString()
  
imports: from typing import Optional, Sequence, Union
  import tensorflow.distribute.experimental.rpc.kernels.gen_rpc_ops
  from tensorflow.distribute.experimental.rpc.proto import tf_rpc_service_pb2
  from tensorflow.python.eager import context
  from tensorflow.python.eager import def_function
  from tensorflow.python.eager import function
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors
  from tensorflow.python.framework import none_tensor
  from tensorflow.python.framework import type_spec
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import resource_variable_ops
  from tensorflow.python.saved_model import nested_structure_coder
  from tensorflow.python.types import core
  from tensorflow.python.util import nest
  from tensorflow.python.util.tf_export import tf_export
label_desc: Use image node_id 1 for calling a global function with example usage: get_output_specs_from_function(func) and returns: output_specs_proto