code: def test_build_all_signature_defs_serving_only(self):
      # Force the test to run in graph mode.
      # This tests a deprecated v1 API that depends on graph-only functions such
      # as build_tensor_info.
      with ops.Graph().as_default():
          receiver_tensor = {
              "input": array_ops.placeholder(dtypes.string)
          }
          output_1 = constant_op.constant([1.0])
          export_outputs = {
              signature_constants.DEFAULT_SERVING_SIGNATURE_DEF_KEY: export_output.PredictOutput(
                  outputs=output_1
              ),
              "train": export_output.TrainOutput(loss=output_1),
          }
  
          signature_defs = export_utils.build_all_signature_defs(
              receiver_tensor, export_outputs
          )
  
          expected_signature_defs = {
              "serving_default": signature_def_utils.predict_signature_def(
                  receiver_tensor, {"output": output_1}
              )
          }
  
          self.assertDictEqual(expected_signature_defs, signature_defs)
  
          signature_defs = export_utils.build_all_signature_defs(
              receiver_tensor, export_outputs, serving_only=False
          )
  
          expected_signature_defs.update(
              {
                  "train": signature_def_utils.supervised_train_signature_def(
                      receiver_tensor, loss={"loss": output_1}
                  )
              }
          )
  
          self.assertDictEqual(expected_signature_defs, signature_defs)
  
imports: import os
  import tempfile
  import time
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.platform import test
  from tensorflow.python.saved_model import signature_constants
  from tensorflow.python.saved_model import signature_def_utils
  from tensorflow.python.saved_model.model_utils import export_output
  from tensorflow.python.saved_model.model_utils import export_utils
  from tensorflow.python.saved_model.model_utils.mode_keys import KerasModeKeys
label_desc: Use image node_id 7 for calling the ExportTest obj's underlying member method code with example usage: obj.test_build_all_signature_defs_serving_only() without return types