| 27 | namespace { |
| 28 | |
| 29 | Status CreatePoolFromSet(const protobuf::FileDescriptorSet& set, |
| 30 | std::unique_ptr<protobuf::DescriptorPool>* out_pool) { |
| 31 | *out_pool = absl::make_unique<protobuf::DescriptorPool>(); |
| 32 | for (const auto& file : set.file()) { |
| 33 | if ((*out_pool)->BuildFile(file) == nullptr) { |
| 34 | return errors::InvalidArgument("Failed to load FileDescriptorProto: ", |
| 35 | file.DebugString()); |
| 36 | } |
| 37 | } |
| 38 | return Status::OK(); |
| 39 | } |
| 40 | |
| 41 | // Build a `DescriptorPool` from the named file or URI. The file or URI |
| 42 | // must be available to the current TensorFlow environment. |
no test coverage detected