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

Function FindKernelDef

tensorflow/core/framework/op_kernel.cc:1320–1350  ·  view source on GitHub ↗

TODO(irving): Change const NodeDef& to const Node&

Source from the content-addressed store, hash-verified

1318
1319// TODO(irving): Change const NodeDef& to const Node&
1320Status FindKernelDef(
1321 const DeviceType& device_type, StringPiece node_name,
1322 bool has_experimental_debug_info,
1323 const NodeDef_ExperimentalDebugInfo& experimental_debug_info,
1324 StringPiece node_op, StringPiece node_device, AttrSlice node_attrs,
1325 const KernelDef** def, string* kernel_class_name) {
1326 const KernelRegistration* reg = nullptr;
1327 bool was_attr_mismatch;
1328 TF_RETURN_IF_ERROR(FindKernelRegistration(
1329 device_type, node_name, has_experimental_debug_info,
1330 experimental_debug_info, node_op, node_attrs, &reg, &was_attr_mismatch));
1331 if (reg == nullptr) {
1332 Status s = errors::NotFound(
1333 "No registered '", node_op, "' OpKernel for ",
1334 DeviceTypeString(device_type), " devices compatible with node ",
1335 FormatNodeDefForError(node_name, has_experimental_debug_info,
1336 experimental_debug_info));
1337 if (was_attr_mismatch) {
1338 errors::AppendToMessage(
1339 &s, " (OpKernel was found, but attributes didn't match) ",
1340 "Requested Attributes: ",
1341 SummarizeAttrsHelper(node_attrs, node_device));
1342 }
1343 errors::AppendToMessage(&s,
1344 ". Registered:", KernelsRegisteredForOp(node_op));
1345 return s;
1346 }
1347 if (def != nullptr) *def = &reg->def;
1348 if (kernel_class_name != nullptr) *kernel_class_name = reg->kernel_class_name;
1349 return Status::OK();
1350}
1351
1352Status FindKernelDef(const DeviceType& device_type, const NodeDef& node_def,
1353 const KernelDef** def, string* kernel_class_name) {

Callers 15

TryFindKernelClassFunction · 0.85
ValidateGraphFunction · 0.85
HasXLAKernelMethod · 0.85
MustCompileNodeFunction · 0.85
GetKernelClassNameMethod · 0.85
MemoryTypesForNodeFunction · 0.85
IsHostMemoryFunction · 0.85
IsHostMemoryFunction · 0.85
TryFindKernelDefFunction · 0.85

Calls 12

FindKernelRegistrationFunction · 0.85
NotFoundFunction · 0.85
DeviceTypeStringFunction · 0.85
FormatNodeDefForErrorFunction · 0.85
AppendToMessageFunction · 0.85
SummarizeAttrsHelperFunction · 0.85
KernelsRegisteredForOpFunction · 0.85
AttrSliceClass · 0.85
attrMethod · 0.80
nameMethod · 0.65
opMethod · 0.45
deviceMethod · 0.45

Tested by 2

GetKernelClassNameMethod · 0.68