| 257 | } |
| 258 | |
| 259 | Status BindGenericNames(const GenericSignature& signature, |
| 260 | const std::vector<string>& input_names, |
| 261 | std::vector<string>* bound_names) { |
| 262 | const protobuf::Map<string, serving::TensorBinding>& bindings = |
| 263 | signature.map(); |
| 264 | |
| 265 | for (const string& entry : input_names) { |
| 266 | const auto mapped = bindings.find(entry); |
| 267 | if (mapped == bindings.end()) { |
| 268 | return errors::NotFound( |
| 269 | strings::StrCat("Could not find generic binding for: ", entry)); |
| 270 | } |
| 271 | bound_names->push_back(mapped->second.tensor_name()); |
| 272 | } |
| 273 | return Status::OK(); |
| 274 | } |
| 275 | |
| 276 | } // namespace serving |
| 277 | } // namespace tensorflow |