| 739 | |
| 740 | template <typename T> |
| 741 | Status LookupResources(OpKernelContext* ctx, |
| 742 | absl::Span<ResourceHandle const* const> p, |
| 743 | std::vector<core::RefCountPtr<T>>* values) { |
| 744 | std::vector<std::pair<const string*, const string*>> containers_and_names( |
| 745 | p.size()); |
| 746 | for (size_t i = 0; i < p.size(); ++i) { |
| 747 | TF_RETURN_IF_ERROR(internal::ValidateDeviceAndType<T>(ctx, *p[i])); |
| 748 | containers_and_names[i] = {&p[i]->container(), &p[i]->name()}; |
| 749 | } |
| 750 | return ctx->resource_manager()->LookupMany(containers_and_names, values); |
| 751 | } |
| 752 | |
| 753 | template <typename T> |
| 754 | Status LookupOrCreateResource(OpKernelContext* ctx, const ResourceHandle& p, |
no test coverage detected