コード例 #1
0
 def testEnableCache(self):
   examples = standard_artifacts.Examples()
   model = standard_artifacts.Model()
   model_blessing = standard_artifacts.ModelBlessing()
   bulk_inferrer_1 = component.BulkInferrer(
       examples=channel_utils.as_channel([examples]),
       model=channel_utils.as_channel([model]),
       model_blessing=channel_utils.as_channel([model_blessing]))
   self.assertEqual(None, bulk_inferrer_1.enable_cache)
   bulk_inferrer_2 = component.BulkInferrer(
       examples=channel_utils.as_channel([examples]),
       model=channel_utils.as_channel([model]),
       model_blessing=channel_utils.as_channel([model_blessing]),
       enable_cache=True)
   self.assertEqual(True, bulk_inferrer_2.enable_cache)
コード例 #2
0
    def testConstructInferenceResultAndOutputExample(self):
        with self.assertRaises(ValueError):
            component.BulkInferrer(examples=self._examples,
                                   model=self._model,
                                   model_blessing=self._model_blessing,
                                   output_examples=channel_utils.as_channel(
                                       [standard_artifacts.Examples()]))

        with self.assertRaises(ValueError):
            component.BulkInferrer(
                examples=self._examples,
                model=self._model,
                model_blessing=self._model_blessing,
                output_example_spec=bulk_inferrer_pb2.OutputExampleSpec(),
                inference_result=channel_utils.as_channel(
                    [standard_artifacts.InferenceResult()]))
コード例 #3
0
ファイル: component_test.py プロジェクト: vikrosj/tfx
 def testConstructInferenceResult(self):
     bulk_inferrer = component.BulkInferrer(
         examples=self._examples,
         model=self._model,
         model_blessing=self._model_blessing)
     self.assertEqual('InferenceResult',
                      bulk_inferrer.outputs['inference_result'].type_name)
     self.assertNotIn('output_examples', bulk_inferrer.outputs.keys())
コード例 #4
0
 def testConstructInferenceResult(self):
     bulk_inferrer = component.BulkInferrer(
         examples=self._examples,
         model=self._model,
         model_blessing=self._model_blessing)
     self.assertEqual(
         'InferenceResult', bulk_inferrer.outputs[
             standard_component_specs.INFERENCE_RESULT_KEY].type_name)
     self.assertNotIn('output_examples', bulk_inferrer.outputs.keys())
コード例 #5
0
ファイル: component_test.py プロジェクト: vikrosj/tfx
 def testConstructOutputExample(self):
     bulk_inferrer = component.BulkInferrer(
         examples=self._examples,
         model=self._model,
         model_blessing=self._model_blessing,
         output_example_spec=bulk_inferrer_pb2.OutputExampleSpec())
     self.assertEqual('Examples',
                      bulk_inferrer.outputs['output_examples'].type_name)
     self.assertNotIn('inference_result', bulk_inferrer.outputs.keys())
コード例 #6
0
ファイル: component_test.py プロジェクト: zw39125432/tfx
 def testConstruct(self):
   examples = standard_artifacts.Examples()
   model = standard_artifacts.Model()
   model_blessing = standard_artifacts.ModelBlessing()
   bulk_inferrer = component.BulkInferrer(
       examples=channel_utils.as_channel([examples]),
       model=channel_utils.as_channel([model]),
       model_blessing=channel_utils.as_channel([model_blessing]))
   self.assertEqual('InferenceResult',
                    bulk_inferrer.outputs['inference_result'].type_name)