MCPcopy Create free account
hub / github.com/pytorch/pytorch / __exit__

Method __exit__

caffe2/python/net_builder.py:486–495  ·  view source on GitHub ↗
(self, etype, *args)

Source from the content-addressed store, hash-verified

484 self.interval_ms = interval_ms
485
486 def __exit__(self, etype, *args):
487 if etype is None:
488 step = core.to_execution_step(self)
489 step.RunEveryMillis(self.interval_ms)
490 if self._net:
491 self._net.add_attribute(Task.REPORT_STEP, step)
492 else:
493 TaskGroup.current().report_step(
494 step, interval_ms=self.interval_ms)
495 NetBuilder.__exit__(self, etype, *args)
496
497
498class _SetupBuilder(NetBuilder):

Callers

nothing calls this directly

Calls 5

RunEveryMillisMethod · 0.80
add_attributeMethod · 0.80
report_stepMethod · 0.80
currentMethod · 0.80
__exit__Method · 0.45

Tested by

no test coverage detected