message: [TF] Fail fast if there is no CPU kernel during constant tensor evaluation.
  Avoids LOG(ERROR) spam when the Executor is unable to find a CPU kernel.
diff: @@ -113,6 +113,13 @@ Status TryToInferTensorOutputFromInputShapes(const Edge& edge,
  return Status::OK();
  }
  +// Returns true if 'node' has a registered CPU kernel.
  +bool HasCpuKernel(const Node& node) {
  + return FindKernelDef(DeviceType(DEVICE_CPU), node.def(), /*def=*/nullptr,
  + /*kernel_class_name=*/nullptr)
  + .ok();
  +}
  +
  // Extracts the subgraph ending at 'target_node' that is statically computable
  // and inserts into 'out_graph'. If statically computable, 'is_constant_graph'
  // will be set to true.
  @@ -136,6 +143,12 @@ Status ExtractConstantSubgraph(
  return Status::OK();
  }
  + // Since constant-folding runs on the CPU, do not attempt to constant-fold
  + // operators that have no CPU kernel.
  + if (!HasCpuKernel(target_node)) {
  + return Status::OK();
  + }
  +
  // TODO(skyewm): should more of the filtering applied in input nodes below be
  // applied to target_node here?
  @@ -201,6 +214,11 @@ Status ExtractConstantSubgraph(
  return Status::OK();
  }
  + if (!HasCpuKernel(*current_node)) {
  + *is_constant_graph = false;
  + return Status::OK();
  + }
  +
  // If there is nothing more to recurse down, see if
  // the generator node is a constant.
  if (current_node->num_inputs() == 0) {
  