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

Function ValidateKernelRegistrations

tensorflow/core/framework/op_kernel.cc:1566–1590  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1564} // namespace
1565
1566Status ValidateKernelRegistrations(const OpRegistryInterface& op_registry) {
1567 auto typed_registry = GlobalKernelRegistryTyped();
1568 tf_shared_lock lock(typed_registry->mu);
1569 for (const auto& key_registration : typed_registry->registry) {
1570 const KernelDef& kernel_def(key_registration.second.def);
1571 const OpRegistrationData* op_reg_data;
1572 const Status status = op_registry.LookUp(kernel_def.op(), &op_reg_data);
1573 if (!status.ok()) {
1574 // TODO(josh11b): Make this a hard error.
1575 LOG(ERROR) << "OpKernel ('" << ProtoShortDebugString(kernel_def)
1576 << "') for unknown op: " << kernel_def.op();
1577 continue;
1578 }
1579 const OpDef& op_def = op_reg_data->op_def;
1580 for (const auto& host_memory_arg : kernel_def.host_memory_arg()) {
1581 if (!FindArgInOp(host_memory_arg, op_def.input_arg()) &&
1582 !FindArgInOp(host_memory_arg, op_def.output_arg())) {
1583 return errors::InvalidArgument(
1584 "HostMemory arg '", host_memory_arg,
1585 "' not found in OpDef: ", SummarizeOpDef(op_def));
1586 }
1587 }
1588 }
1589 return Status::OK();
1590}
1591
1592template <>
1593const Eigen::ThreadPoolDevice& OpKernelContext::eigen_device() const {

Callers 1

LookUpSlowMethod · 0.85

Calls 7

FindArgInOpFunction · 0.85
InvalidArgumentFunction · 0.85
SummarizeOpDefFunction · 0.85
LookUpMethod · 0.45
opMethod · 0.45
okMethod · 0.45

Tested by

no test coverage detected