MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / TEST

Function TEST

tensorflow/contrib/session_bundle/bundle_shim_test.cc:115–128  ·  view source on GitHub ↗

Checks that the input map in a signature def is populated correctly.

Source from the content-addressed store, hash-verified

113
114// Checks that the input map in a signature def is populated correctly.
115TEST(BundleShimTest, AddInputToSignatureDef) {
116 SignatureDef signature_def;
117 const string tensor_name = "foo_tensor";
118 const string map_key = "foo_key";
119
120 // Build a map of tensor-name to dtype, for the unit-test.
121 std::unordered_map<string, DataType> tensor_name_to_dtype;
122 tensor_name_to_dtype[tensor_name] = tensorflow::DT_STRING;
123
124 AddInputToSignatureDef(tensor_name, tensor_name_to_dtype, map_key,
125 &signature_def);
126 EXPECT_EQ(1, signature_def.inputs_size());
127 EXPECT_EQ(tensor_name, signature_def.inputs().find(map_key)->second.name());
128}
129
130// Checks that the output map in a signature def is populated correctly.
131TEST(BundleShimTest, AddOutputToSignatureDef) {

Callers

nothing calls this directly

Calls 15

AddInputToSignatureDefFunction · 0.85
AddOutputToSignatureDefFunction · 0.85
ValidateSignatureDefFunction · 0.85
TestSrcDirPathFunction · 0.85
inputs_sizeMethod · 0.80
outputs_sizeMethod · 0.80
nameMethod · 0.65
mutable_outputMethod · 0.60
StrCatFunction · 0.50

Tested by

no test coverage detected