message: Return a clear error message when outside compilation has int64 input/output.
diff: @@ -330,6 +330,38 @@ xla::StatusOr<NodeDef> BuildXlaHostComputeNodeDef(
  return new_def;
  }
  +Status ValidateOutsideCompilationCallNode(Node* call_node) {
  + // DT_INT64 as input/output for outside compilation is not supported yet:
  + // b/120809951.
  + for (const Edge* e : call_node->in_edges()) {
  + if (e->IsControlEdge()) {
  + continue;
  + }
  + DataType dtype = e->src()->output_type(e->src_output());
  + if (dtype == DT_INT64) {
  + return errors::Unimplemented(
  + "int64 input for outside compilation is not supported yet: "
  + "b/120809951. Please cast output of node ",
  + e->src()->DebugString(),
  + " to int32 before feeding it into outside compilation.");
  + }
  + }
  + for (const Edge* e : call_node->out_edges()) {
  + if (e->IsControlEdge()) {
  + continue;
  + }
  + DataType dtype = e->dst()->input_type(e->dst_input());
  + if (dtype == DT_INT64) {
  + return errors::Unimplemented(
  + "int64 output for outside compilation is not supported yet: "
  + "b/120809951. Please cast input of node ",
  + e->dst()->DebugString(),
  + " to int32 before returning it from outside compilation.");
  + }
  + }
  + return Status::OK();
  +}
  +
  // Replace outside compilation function call node with XlaHostCompute node.
  // If the function call node has no input/output edges, we will just remove it
  // and not create a XlaHostCompute node.
  @@ -1517,6 +1549,7 @@ Status ExtractOutsideCompilationForFunction(
  }
  }
  for (Node* n : outside_compilation_nodes) {
  + TF_RETURN_IF_ERROR(ValidateOutsideCompilationCallNode(n));
  TF_RETURN_IF_ERROR(ReplaceOrRemoveOutsideCompilationCallNode(
  graph_out.get(), n, host_compute_core));
  }
  