Skip to content

Commit

Permalink
Merge pull request #324 from kirilg/0.5.1
Browse files Browse the repository at this point in the history
Make TensorFlow Serving work with the latest 1.0.0 RC.
  • Loading branch information
kirilg authored Feb 14, 2017
2 parents 8be19ce + f3347af commit 5ead923
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion tensorflow
Submodule tensorflow updated 1338 files
20 changes: 10 additions & 10 deletions tensorflow_serving/batching/batching_session_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,13 @@ TEST(BatchingSessionTest, TensorSignatureFromSignatureDefs) {
const SignatureDef signature_def_0 =
CreateSignatureDef({{"x0", "x1"}, {"y0", "y1"}});
const SignatureDef signature_def_1 =
CreateSignatureDef({{"x1", "x2"}, {"y1", "y3"}});
CreateSignatureDef({{"x1", "x2"}, {"y1", "y2"}});
const TensorSignature tensor_signature =
TensorSignatureFromSignatureDefs({signature_def_0, signature_def_1});
EXPECT_THAT(tensor_signature.input_tensors,
UnorderedElementsAre("x0", "x1", "x2"));
EXPECT_THAT(tensor_signature.output_tensors,
UnorderedElementsAre("y0", "y1", "y3"));
UnorderedElementsAre("y0", "y1", "y2"));
}

TEST(BatchingSessionTest, Basic) {
Expand Down Expand Up @@ -199,9 +199,9 @@ TEST(BatchingSessionTest, RequestThatDoesntMatchSignatureGetsRunAnyway) {
std::unique_ptr<Session> batching_session;
BatchingSessionOptions batching_session_options;
TF_ASSERT_OK(CreateBasicBatchingSession(
schedule_options, batching_session_options, {{"x2"}, {"y3"}},
schedule_options, batching_session_options, {{"x2"}, {"y2"}},
CreateHalfPlusTwoSession(), &batching_session));
// Issue a request using x/y, which doesn't match the x2/y3 signature.
// Issue a request using x/y, which doesn't match the x2/y2 signature.
TestSingleRequest(100.0f, 42.0f, batching_session.get());
}

Expand Down Expand Up @@ -299,7 +299,7 @@ TEST(BatchingSessionTest, DifferentOrderForInputAndOutputTensors) {
BatchingSessionOptions batching_session_options;
std::unique_ptr<Session> batching_session;
TF_ASSERT_OK(CreateBasicBatchingSession(
schedule_options, batching_session_options, {{"x", "x2"}, {"y", "y3"}},
schedule_options, batching_session_options, {{"x", "x2"}, {"y", "y2"}},
CreateHalfPlusTwoSession(), &batching_session));

const Tensor input0 = test::AsTensor<float>({8.0f, 6.0f}, {2});
Expand All @@ -311,7 +311,7 @@ TEST(BatchingSessionTest, DifferentOrderForInputAndOutputTensors) {
Env::Default()->StartThread(ThreadOptions(), "first_request_thread", [&] {
std::vector<Tensor> outputs;
TF_ASSERT_OK(batching_session->Run({{"x", input0}, {"x2", input1}},
{"y", "y3"} /* outputs */,
{"y", "y2"} /* outputs */,
{} /* target nodes */, &outputs));
ASSERT_EQ(2, outputs.size());
test::ExpectTensorEqual<float>(expected_output0, outputs[0]);
Expand All @@ -321,7 +321,7 @@ TEST(BatchingSessionTest, DifferentOrderForInputAndOutputTensors) {
ThreadOptions(), "second_request_thread", [&] {
std::vector<Tensor> outputs;
TF_ASSERT_OK(batching_session->Run({{"x2", input1}, {"x", input0}},
{"y3", "y"} /* outputs */,
{"y2", "y"} /* outputs */,
{} /* target nodes */, &outputs));
ASSERT_EQ(2, outputs.size());
test::ExpectTensorEqual<float>(expected_output1, outputs[0]);
Expand All @@ -331,7 +331,7 @@ TEST(BatchingSessionTest, DifferentOrderForInputAndOutputTensors) {
Env::Default()->StartThread(ThreadOptions(), "third_request_thread", [&] {
std::vector<Tensor> outputs;
TF_ASSERT_OK(batching_session->Run({{"x2", input1}, {"x", input0}},
{"y", "y3"} /* outputs */,
{"y", "y2"} /* outputs */,
{} /* target nodes */, &outputs));
ASSERT_EQ(2, outputs.size());
test::ExpectTensorEqual<float>(expected_output0, outputs[0]);
Expand Down Expand Up @@ -360,7 +360,7 @@ TEST(BatchingSessionTest, MultipleSignatures) {
std::unique_ptr<Session> batching_session;
TF_CHECK_OK(CreateBatchingSession(
batching_session_options, {{{{"x"}, {"y"}}, create_scheduler},
{{{"x2"}, {"y3"}}, create_scheduler}},
{{{"x2"}, {"y2"}}, create_scheduler}},
CreateHalfPlusTwoSession(), &batching_session));
ASSERT_EQ(2, schedulers.size());

Expand All @@ -378,7 +378,7 @@ TEST(BatchingSessionTest, MultipleSignatures) {
Tensor input = test::AsTensor<float>({100.0f, 42.0f}, {2});
Tensor expected_output = test::AsTensor<float>({53.0f, 24.0f}, {2});
std::vector<Tensor> outputs;
TF_ASSERT_OK(batching_session->Run({{"x2", input}}, {"y3"} /* outputs */,
TF_ASSERT_OK(batching_session->Run({{"x2", input}}, {"y2"} /* outputs */,
{} /* target nodes */, &outputs));
ASSERT_EQ(1, outputs.size());
test::ExpectTensorEqual<float>(expected_output, outputs[0]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,9 @@ TEST_P(GetModelMetadataImplTest, ReturnsSignaturesForValidModel) {
received_signature_def_map.signature_def().size());
if (GetParam()) {
EXPECT_THAT(
expected_signature_def_map.signature_def().at("regress_x_to_y"),
expected_signature_def_map.signature_def().at(kRegressMethodName),
test_util::EqualsProto(
received_signature_def_map.signature_def().at("regress_x_to_y")));
received_signature_def_map.signature_def().at(kRegressMethodName)));
} else {
EXPECT_THAT(expected_signature_def_map.signature_def().at("regress"),
test_util::EqualsProto(
Expand Down

0 comments on commit 5ead923

Please sign in to comment.