tensorflow/core/grappler/optimizers/pin_to_host_optimizer.cc
// Find KernelDef for `node`, greedily return first found from `devices`.
Find KernelDef for `node`, greedily return first found from `devices`.
Find KernelDef for ` node ` greedily return first found from ` devices ` .
Status TryFindKernelDef(const std::vector<DeviceType>& devices,
                        const NodeDef& node, const KernelDef** kdef) {
  for (const DeviceType& device : devices) {
    const KernelDef* kernel = nullptr;
    Status s = FindKernelDef(device, node, &kernel, nullptr);
    if (s.ok()) {
      if (kdef) {
        *kdef = kernel;
      }
      return Status::OK();
    }
  }
  return errors::NotFound("Could not find KernelDef for op: ", node.op());
}
Status TryFindKernelDef ( const std :: vector < DeviceType > & devices , const NodeDef & node , const KernelDef * * kdef ) { for ( const DeviceType & device : devices ) { const KernelDef * kernel = nullptr ; Status s = FindKernelDef ( device , node , & kernel , nullptr ) ; if ( s . ok ( ) ) { if ( kdef ) { * kdef = kernel ; } return Status :: OK ( ) ; } } return errors :: NotFound ( " " , node . op ( ) ) ; }
Find KernelDef for `node`, greedily return first found from `devices`.
Find KernelDef for ` node ` greedily return first found from ` devices ` .