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)
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)
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)
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())
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)
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())
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')