Skip to content

Commit f38ea25

Browse files
committed
Fixed misunderstanding of test_and_set
1 parent 48f9e5f commit f38ea25

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

torch/csrc/jit/passes/utils/memory_dag.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,10 @@ void collectAllContainedMemoryLocations(
5555
MemoryLocations& cont) {
5656
// we have already recursed on this element
5757
unsigned compIdx = Element::toIndex(elem);
58-
if (cont.test_and_set(compIdx)) {
58+
if (cont.test(compIdx)) {
5959
return;
6060
}
61+
cont.set(compIdx);
6162

6263
for (const auto& mem_loc : elem->getMemoryLocations()) {
6364
collectAllContainedMemoryLocations(Element::toElement(mem_loc), cont);

0 commit comments

Comments
 (0)