| 274 | } // namespace |
| 275 | |
| 276 | Status GetLookupTable(const string& input_name, OpKernelContext* ctx, |
| 277 | LookupInterface** table) { |
| 278 | string container; |
| 279 | string table_handle; |
| 280 | DataType handle_dtype; |
| 281 | TF_RETURN_IF_ERROR(ctx->input_dtype(input_name, &handle_dtype)); |
| 282 | if (handle_dtype == DT_RESOURCE) { |
| 283 | ResourceHandle handle; |
| 284 | TF_RETURN_IF_ERROR(HandleFromInput(ctx, input_name, &handle)); |
| 285 | return LookupResource(ctx, handle, table); |
| 286 | } else { |
| 287 | TF_RETURN_IF_ERROR( |
| 288 | GetTableHandle(input_name, ctx, &container, &table_handle)); |
| 289 | return ctx->resource_manager()->Lookup(container, table_handle, table); |
| 290 | } |
| 291 | } |
| 292 | |
| 293 | Status GetInitializableLookupTable(const string& input_name, |
| 294 | OpKernelContext* ctx, |
no test coverage detected