| 721 | |
| 722 | template <typename T, bool use_dynamic_cast> |
| 723 | Status LookupResource(OpKernelContext* ctx, const ResourceHandle& p, |
| 724 | T** value) { |
| 725 | TF_RETURN_IF_ERROR(internal::ValidateDeviceAndType<T>(ctx, p)); |
| 726 | return ctx->resource_manager()->Lookup<T, use_dynamic_cast>(p.container(), |
| 727 | p.name(), value); |
| 728 | } |
| 729 | |
| 730 | template <typename T> |
| 731 | Status LookupResource(OpKernelContext* ctx, const ResourceHandle& p, |