class_docstr: Allow to register a list of nets to be run at initialization
  and finalization of Tasks or TaskGroups.
  For example, let's say you have the following:
  
      init_net = core.Net('init')
      my_val = init_net.ConstantFill([], 'my_val', value=0)
  
      net = core.Net('counter')
      net.Add([my_val, net.Const(1),], [my_val])
  
      with TaskGroup() as task_group:
          with Node('trainer'):
              my_task = Task(step=[net])
  
  In order to have `init_net` run once before `net` runs for the
  first time, you can do one of the following:
  
      net.add_attribute(Task.TASK_SETUP, SetupNets([init_net]))
  
  or
  
      net.add_attribute(TaskGroup.LOCAL_SETUP, SetupNets([init_net]))
  
  - With Task.TASK_SETUP, init_net will run once at my_task startup.
  - With TaskGroup.LOCAL_SETUP, init_net will run once on node 'trainer',
    before any task of the task group is run on that node.
  
  The same SetupNets object can be added to multiple nets. It will only
  run once per Task/TaskGroup run.
class_docstr_tok: ["Allow","to","register","a","list","of","nets","to","be","run","at","initialization","and","finalization","of","Tasks","or","TaskGroups",".","For","example",",","let","'s","say","you","have","the","following",":","init_net","=","core.Net","(","'init","'",")","my_val","=","init_net.ConstantFill","(","[","]",",","'my_val","'",",","value=0",")","net","=","core.Net","(","'counter","'",")","net.Add","(","[","my_val",",","net.Const","(","1",")",",","]",",","[","my_val","]",")","with","TaskGroup","(",")","as","task_group",":","with","Node","(","'trainer","'",")",":","my_task","=","Task","(","step=","[","net","]",")","In","order","to","have","`","init_net","`","run","once","before","`","net","`","runs","for","the","first","time",",","you","can","do","one","of","the","following",":","net.add_attribute","(","Task.TASK_SETUP",",","SetupNets","(","[","init_net","]",")",")","or","net.add_attribute","(","TaskGroup.LOCAL_SETUP",",","SetupNets","(","[","init_net","]",")",")","-","With","Task.TASK_SETUP",",","init_net","will","run","once","at","my_task","startup",".","-","With","TaskGroup.LOCAL_SETUP",",","init_net","will","run","once","on","node","'trainer","'",",","before","any","task","of","the","task","group","is","run","on","that","node",".","The","same","SetupNets","object","can","be","added","to","multiple","nets",".","It","will","only","run","once","per","Task\/TaskGroup","run","."]
code: def exit(self, exit_net):
      return self.exit_nets
  
imports: from caffe2.python import core, context
  from caffe2.python.schema import Field, from_blob_list
  from collections import defaultdict
  from copy import copy
label_desc: Use image node_id 3 for calling the SetupNets obj's underlying member method code with example usage: obj.exit(exit_net) and returns: self