| 779 | |
| 780 | template <typename T> |
| 781 | void IsResourceInitialized<T>::Compute(OpKernelContext* ctx) { |
| 782 | Tensor* output; |
| 783 | OP_REQUIRES_OK(ctx, ctx->allocate_output(0, {}, &output)); |
| 784 | T* object; |
| 785 | bool found; |
| 786 | if (LookupResource(ctx, HandleFromInput(ctx, 0), &object).ok()) { |
| 787 | found = true; |
| 788 | object->Unref(); |
| 789 | } else { |
| 790 | found = false; |
| 791 | } |
| 792 | |
| 793 | output->flat<bool>()(0) = found; |
| 794 | } |
| 795 | |
| 796 | template <typename T> |
| 797 | ResourceHandleOp<T>::ResourceHandleOp(OpKernelConstruction* context) |
nothing calls this directly
no test coverage detected