Storing kRead kinds doesn't have any effect, but might take a lot of RAM.

PiperOrigin-RevId: 301392884
Change-Id: I3b866f93546b16559f0a5551bbe525138844744c
This commit is contained in:
A. Unique TensorFlower 2020-03-17 09:47:08 -07:00 committed by TensorFlower Gardener
parent b62d3ccac5
commit c3c2104933

View File

@ -299,7 +299,11 @@ Status ComputeIncompatibleResourceOperationPairs(
result->push_back({incoming_op.first, n->id()});
}
resource_op_set->Add({n->id(), *op_kind});
// Some graphs might have a lot of 'kRead' kinds, but they are always safe
// for incoming ops, so not storing them might save a lot of memory.
if (op_kind != XlaResourceOpKind::kRead) {
resource_op_set->Add({n->id(), *op_kind});
}
}
if (vlog) {