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

Method task_exit

caffe2/python/net_builder.py:389–407  ·  view source on GitHub ↗

Define operations to be executed once at task shutdown. Useful when implementing processors, that don't have access to the Task top-level structure. This shutdown will be run only once, after all concurrent instances of the task have already finished. For in

(self)

Source from the content-addressed store, hash-verified

387 return setup
388
389 def task_exit(self):
390 """
391 Define operations to be executed once at task shutdown.
392 Useful when implementing processors, that don't have access to the Task
393 top-level structure.
394
395 This shutdown will be run only once, after all concurrent instances of
396 the task have already finished. For instance-local shutdown,
397 use `task_instance_exit` instead.
398
399 Example:
400 def read_queue(queue):
401 with ops.task_exit():
402 queue.close(ops.net())
403 return queue.read(ops.net())
404 """
405 setup = _SetupBuilder(_SetupBuilder.EXIT)
406 self.net().add_attribute(Task.TASK_SETUP, setup)
407 return setup
408
409 def task_instance_init(self):
410 """

Callers 7

test_setupMethod · 0.80
test_multi_instanceMethod · 0.80
_runtime_threads_taskFunction · 0.80
_timed_taskMethod · 0.80
example_taskFunction · 0.80
procMethod · 0.80

Calls 3

netMethod · 0.95
_SetupBuilderClass · 0.85
add_attributeMethod · 0.80

Tested by 5

test_setupMethod · 0.64
test_multi_instanceMethod · 0.64
example_taskFunction · 0.64
procMethod · 0.64