@@ -236,7 +236,6 @@ def VerifyPredictRequest(self,
236
236
# Prepare request
237
237
request = predict_pb2 .PredictRequest ()
238
238
request .model_spec .name = model_name
239
- request .model_spec .signature_name = signature_name
240
239
request .inputs ['x' ].dtype = types_pb2 .DT_FLOAT
241
240
request .inputs ['x' ].float_val .append (2.0 )
242
241
dim = request .inputs ['x' ].tensor_shape .dim .add ()
@@ -723,52 +722,6 @@ def testPredictUDS(self):
723
722
expected_version = self ._GetModelVersion (
724
723
self ._GetSavedModelHalfPlusThreePath ()))
725
724
726
- def test_tf_saved_model_save (self ):
727
- base_path = os .path .join (self .get_temp_dir (), 'tf_saved_model_save' )
728
- export_path = os .path .join (base_path , '00000123' )
729
- root = tf .train .Checkpoint ()
730
- root .v1 = tf .Variable (3. )
731
- root .v2 = tf .Variable (2. )
732
- root .f = tf .function (
733
- lambda x : {'y' : root .v1 * root .v2 * x })
734
- to_save = root .f .get_concrete_function (tf .TensorSpec (None , tf .float32 ))
735
- tf .saved_model .experimental .save (root , export_path , to_save )
736
- _ , model_server_address , _ = TensorflowModelServerTest .RunServer (
737
- 'default' , base_path )
738
- expected_version = self ._GetModelVersion (base_path )
739
- self .VerifyPredictRequest (
740
- model_server_address ,
741
- expected_output = 12.0 ,
742
- specify_output = False ,
743
- expected_version = expected_version )
744
-
745
- def test_tf_saved_model_save_multiple_signatures (self ):
746
- base_path = os .path .join (self .get_temp_dir (), 'tf_saved_model_save' )
747
- export_path = os .path .join (base_path , '00000123' )
748
- root = tf .train .Checkpoint ()
749
- root .f = tf .function (lambda x : {'y' : 1. },
750
- input_signature = [tf .TensorSpec (None , tf .float32 )])
751
- root .g = tf .function (lambda x : {'y' : 2. },
752
- input_signature = [tf .TensorSpec (None , tf .float32 )])
753
- tf .saved_model .experimental .save (
754
- root , export_path ,
755
- signatures = {
756
- signature_constants .DEFAULT_SERVING_SIGNATURE_DEF_KEY : root .f ,
757
- 'custom_signature_key' : root .g })
758
- _ , model_server_address , _ = TensorflowModelServerTest .RunServer (
759
- 'default' , base_path )
760
- expected_version = self ._GetModelVersion (base_path )
761
- self .VerifyPredictRequest (
762
- model_server_address ,
763
- expected_output = 2.0 ,
764
- expected_version = expected_version ,
765
- signature_name = 'custom_signature_key' )
766
- self .VerifyPredictRequest (
767
- model_server_address ,
768
- expected_output = 1.0 ,
769
- expected_version = expected_version )
770
-
771
725
772
726
if __name__ == '__main__' :
773
- tf .enable_eager_execution ()
774
727
tf .test .main ()
0 commit comments