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

Function LookupResources

tensorflow/core/framework/resource_mgr.h:741–751  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

739
740template <typename T>
741Status 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
753template <typename T>
754Status LookupOrCreateResource(OpKernelContext* ctx, const ResourceHandle& p,

Callers 2

ComputeMethod · 0.85

Calls 5

LookupManyMethod · 0.80
nameMethod · 0.65
sizeMethod · 0.45
containerMethod · 0.45
resource_managerMethod · 0.45

Tested by

no test coverage detected