| 22 | |
| 23 | |
| 24 | class TestModule(export_base.ExportModule): |
| 25 | |
| 26 | @tf.function |
| 27 | def serve(self, inputs: tf.Tensor) -> Mapping[Text, tf.Tensor]: |
| 28 | x = inputs if self.preprocessor is None else self.preprocessor( |
| 29 | inputs=inputs) |
| 30 | x = self.inference_step(x) |
| 31 | x = self.postprocessor(x) if self.postprocessor else x |
| 32 | return {'outputs': x} |
| 33 | |
| 34 | def get_inference_signatures( |
| 35 | self, function_keys: Dict[Text, Text]) -> Mapping[Text, Any]: |
| 36 | input_signature = tf.TensorSpec(shape=[None, None], dtype=tf.float32) |
| 37 | return {'foo': self.serve.get_concrete_function(input_signature)} |
| 38 | |
| 39 | |
| 40 | class ExportBaseTest(tf.test.TestCase): |
no outgoing calls