It is common knowledge that
with fp.open()
the fp.close() will happen automatically after indented lines afterward with opening statement finished executing.
I came across:
with torch.nograd(), does it mean at the end, it will re-enable back gradient back? How does context manager know to turn back on if so?