message: Add a check to ensure no loop-variant DT_RESOURCE.
diff: @@ -204,11 +204,13 @@ Status BuildLoopBody(const Graph& graph, Frame* frame,
  BuildRetvalNode(output, dtype, i));
  if (arg.is_loop_invariant) {
  // Argument is loop-invariant. Forward it from the Arg to the Retval.
  - // DT_RESOURCE falls into this case.
  node_map[arg.enter->id()] = arg_node;
  output->AddEdge(arg_node, 0, retval_node, 0);
  } else {
  - // Argument is loop-varying.
  + // Argument is loop-varying. Note that DT_RESOURCE is always loop
  + // invariant in the graph generated from tf.while and should not fall
  + // into this case.
  + TF_RET_CHECK(dtype != DT_RESOURCE);
  node_map[arg.switch_node->id()] = arg_node;
  // The Switch node has two outputs, but _Arg only has one. This tells
  // the CopySubgraph function to rewrite the output number of edges from
  