Beispiel #1
0
 def setUp(self):
     model_dir = tempfile.mkdtemp()
     self._estimator = testing_common.get_arithmetic_estimator(
         core=True, model_dir=model_dir)
     self._serving_input_receiver_fn = testing_common.get_arithmetic_input_fn(
         core=True, train=False)
Beispiel #2
0
 def setUp(self):
     model_dir = tempfile.mkdtemp()
     self._estimator = testing_common.get_arithmetic_estimator(
         core=False, model_dir=model_dir)
     self._prediction_input_fn = testing_common.get_arithmetic_input_fn(
         core=False, train=False)
Beispiel #3
0
 def testFromCoreEstimatorWithContribEstimatorRaises(self):
   estimator = testing_common.get_arithmetic_estimator(core=False)
   input_fn = testing_common.get_arithmetic_input_fn(core=False)
   with self.assertRaises(TypeError):
     predictor_factories.from_estimator(estimator, input_fn)
Beispiel #4
0
 def testFromCoreEstimatorWithSessionConfig(self):
   estimator = testing_common.get_arithmetic_estimator(core=True)
   input_fn = testing_common.get_arithmetic_input_fn(core=True)
   predictor_factories.from_estimator(
       estimator, input_fn, config=config_pb2.ConfigProto())
Beispiel #5
0
 def testFromCoreEstimator(self):
   estimator = testing_common.get_arithmetic_estimator(core=True)
   input_fn = testing_common.get_arithmetic_input_fn(core=True)
   predictor_factories.from_estimator(estimator, input_fn)
Beispiel #6
0
 def testFromContribEstimatorWithSessionConfig(self):
   estimator = testing_common.get_arithmetic_estimator(core=False)
   input_fn = testing_common.get_arithmetic_input_fn(core=False)
   predictor_factories.from_contrib_estimator(
       estimator, input_fn, output_alternative_key='sum',
       config=config_pb2.ConfigProto())
Beispiel #7
0
 def testFromContribEstimator(self):
   estimator = testing_common.get_arithmetic_estimator(core=False)
   input_fn = testing_common.get_arithmetic_input_fn(core=False)
   predictor_factories.from_contrib_estimator(
       estimator, input_fn, output_alternative_key='sum')