tensorflow/compiler/jit/resource_operation_safety_analysis.cc
// Returns true if a control or data dependence from a TensorFlow operation of
// resource op kind `from` to a TensorFlow operation of resource op kind `to`
// can be represented by an XLA cluster and needs no special handling around
// auto-jit.
Returns true if a control or data dependence from a TensorFlow operation of
resource op kind `from` to a TensorFlow operation of resource op kind `to`
can be represented by an XLA cluster and needs no special handling around
auto-jit.
Returns true if a control or data dependence from a TensorFlow operation of resource op kind ` from ` to a TensorFlow operation of resource op kind ` to ` can be represented by an XLA cluster and needs no special handling around auto - jit .
bool IsEdgeSafe(XlaResourceOpKind from, XlaResourceOpKind to) {
  return from == XlaResourceOpKind::kRead || to == XlaResourceOpKind::kWrite;
}
bool IsEdgeSafe ( XlaResourceOpKind from , XlaResourceOpKind to ) { return from == XlaResourceOpKind :: kRead || to == XlaResourceOpKind :: kWrite ; }
Returns true if a control or data dependence from a TensorFlow operation of
resource op kind `from` to a TensorFlow operation of resource op kind `to`
can be represented by an XLA cluster and needs no special handling around
auto-jit.
Returns true if a control or data dependence from a TensorFlow operation of resource op kind ` from ` to a TensorFlow operation of resource op kind ` to ` can be represented by an XLA cluster and needs no special handling around auto - jit .
// XLA clusters force all reads to happen before all writes.  Moreover the set // of reads are executed as one atomic operation, and the set of writes are as // another atomic operation.  This means we can faithfully represent the // following edges: Read->*, *->Write.