MCPcopy Index your code
hub / github.com/pytorch/pytorch / __enter__

Method __enter__

caffe2/python/task.py:537–548  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

535 self._num_instances = num_instances
536
537 def __enter__(self):
538 super().__enter__()
539
540 # temporarily remove from _tasks_to_add to ensure correct order
541 if self.group is not None:
542 self.group._tasks_to_add.remove(self)
543 self._assert_not_used()
544 assert self._step is None, 'This Task already has an execution step.'
545 from caffe2.python import net_builder
546 self._net_builder = net_builder.NetBuilder(_fullname=self.name)
547 self._net_builder.__enter__()
548 return self
549
550 def __exit__(self, type, value, traceback):
551 super().__exit__(type, value, traceback)

Callers

nothing calls this directly

Calls 2

_assert_not_usedMethod · 0.95
removeMethod · 0.45

Tested by

no test coverage detected