/usr/local/lib64/python3.6/site-packages/caffe2/python/__pycache__
NameSizeModeActions
allcompare_test.cpython-36.pyc27100644editdlrm
attention.cpython-36.pyc49380644editdlrm
benchmark_generator.cpython-36.pyc39100644editdlrm
binarysize.cpython-36.pyc48530644editdlrm
brew.cpython-36.pyc38490644editdlrm
brew_test.cpython-36.pyc104520644editdlrm
build.cpython-36.pyc3400644editdlrm
cached_reader.cpython-36.pyc29540644editdlrm
caffe_translator.cpython-36.pyc241650644editdlrm
caffe_translator_test.cpython-36.pyc29290644editdlrm
checkpoint.cpython-36.pyc279730644editdlrm
checkpoint_test.cpython-36.pyc94620644editdlrm
cnn.cpython-36.pyc84350644editdlrm
context.cpython-36.pyc40080644editdlrm
context_test.cpython-36.pyc26650644editdlrm
control.cpython-36.pyc144660644editdlrm
control_ops_grad.cpython-36.pyc163650644editdlrm
control_ops_grad_test.cpython-36.pyc15020644editdlrm
control_ops_util.cpython-36.pyc83320644editdlrm
control_test.cpython-36.pyc118700644editdlrm
convert.cpython-36.pyc1480644editdlrm
convert_test.cpython-36.pyc5680644editdlrm
convnet_benchmarks.cpython-36.pyc129450644editdlrm
convnet_benchmarks_test.cpython-36.pyc10900644editdlrm
core.cpython-36.pyc944280644editdlrm
core_gradients_test.cpython-36.pyc248250644editdlrm
core_test.cpython-36.pyc339420644editdlrm
crf.cpython-36.pyc76220644editdlrm
crf_predict.cpython-36.pyc10440644editdlrm
crf_viterbi_test.cpython-36.pyc16770644editdlrm
dataio.cpython-36.pyc239780644editdlrm
dataio_test.cpython-36.pyc132670644editdlrm
dataset.cpython-36.pyc128790644editdlrm
data_parallel_model.cpython-36.pyc514160644editdlrm
data_parallel_model_test.cpython-36.pyc389230644editdlrm
data_workers.cpython-36.pyc131420644editdlrm
data_workers_test.cpython-36.pyc45220644editdlrm
db_file_reader.cpython-36.pyc53610644editdlrm
db_test.cpython-36.pyc13280644editdlrm
device_checker.cpython-36.pyc40140644editdlrm
dyndep.cpython-36.pyc15680644editdlrm
embedding_generation_benchmark.cpython-36.pyc42030644editdlrm
experiment_util.cpython-36.pyc32330644editdlrm
extension_loader.cpython-36.pyc5430644editdlrm
fakefp16_transform_lib.cpython-36.pyc5460644editdlrm
filler_test.cpython-36.pyc9250644editdlrm
functional.cpython-36.pyc35310644editdlrm
functional_test.cpython-36.pyc41320644editdlrm
fused_8bit_rowwise_conversion_ops_test.cpython-36.pyc36310644editdlrm
gradient_checker.cpython-36.pyc106220644editdlrm
gradient_check_test.cpython-36.pyc167880644editdlrm
gru_cell.cpython-36.pyc25960644editdlrm
hip_test_util.cpython-36.pyc6690644editdlrm
hsm_util.cpython-36.pyc18230644editdlrm
hypothesis_test.cpython-36.pyc843120644editdlrm
hypothesis_test_util.cpython-36.pyc200390644editdlrm
ideep_test_util.cpython-36.pyc10810644editdlrm
layers_test.cpython-36.pyc573720644editdlrm
layer_model_helper.cpython-36.pyc216410644editdlrm
layer_model_instantiator.cpython-36.pyc36650644editdlrm
layer_parameter_sharing_test.cpython-36.pyc56260644editdlrm
layer_test_util.cpython-36.pyc52730644editdlrm
lazy.cpython-36.pyc4240644editdlrm
lazy_dyndep.cpython-36.pyc24750644editdlrm
lazy_dyndep_test.cpython-36.pyc48070644editdlrm
lengths_reducer_fused_8bit_rowwise_ops_test.cpython-36.pyc43920644editdlrm
lengths_reducer_rowwise_8bit_ops_test.cpython-36.pyc36840644editdlrm
lstm_benchmark.cpython-36.pyc72820644editdlrm
memonger.cpython-36.pyc321700644editdlrm
memonger_test.cpython-36.pyc231000644editdlrm
mkl_test_util.cpython-36.pyc11910644editdlrm
model_device_test.cpython-36.pyc33760644editdlrm
model_helper.cpython-36.pyc186180644editdlrm
model_helper_test.cpython-36.pyc19910644editdlrm
modifier_context.cpython-36.pyc26500644editdlrm
muji.cpython-36.pyc55660644editdlrm
muji_test.cpython-36.pyc35670644editdlrm
net_builder.cpython-36.pyc267860644editdlrm
net_builder_test.cpython-36.pyc92550644editdlrm
net_drawer.cpython-36.pyc100560644editdlrm
net_printer.cpython-36.pyc143670644editdlrm
net_printer_test.cpython-36.pyc33230644editdlrm
nomnigraph.cpython-36.pyc51250644editdlrm
nomnigraph_test.cpython-36.pyc145910644editdlrm
nomnigraph_transformations.cpython-36.pyc24310644editdlrm
nomnigraph_transformations_test.cpython-36.pyc40730644editdlrm
normalizer.cpython-36.pyc19410644editdlrm
normalizer_context.cpython-36.pyc15530644editdlrm
normalizer_test.cpython-36.pyc8700644editdlrm
numa_benchmark.cpython-36.pyc18860644editdlrm
numa_test.cpython-36.pyc16260644editdlrm
observer_test.cpython-36.pyc41810644editdlrm
operator_fp_exceptions_test.cpython-36.pyc13050644editdlrm
optimizer.cpython-36.pyc456060644editdlrm
optimizer_context.cpython-36.pyc20080644editdlrm
optimizer_test.cpython-36.pyc247470644editdlrm
optimizer_test_util.cpython-36.pyc68080644editdlrm
parallelize_bmuf_distributed_test.cpython-36.pyc69900644editdlrm
parallel_workers.cpython-36.pyc91480644editdlrm
parallel_workers_test.cpython-36.pyc38240644editdlrm
pipeline.cpython-36.pyc129400644editdlrm
pipeline_test.cpython-36.pyc27150644editdlrm
predictor_constants.cpython-36.pyc3040644editdlrm
python_op_test.cpython-36.pyc105020644editdlrm
queue_util.cpython-36.pyc50550644editdlrm
record_queue.cpython-36.pyc42250644editdlrm
recurrent.cpython-36.pyc98930644editdlrm
regularizer.cpython-36.pyc186040644editdlrm
regularizer_context.cpython-36.pyc15620644editdlrm
regularizer_test.cpython-36.pyc88250644editdlrm
rnn_cell.cpython-36.pyc447850644editdlrm
schema.cpython-36.pyc417630644editdlrm
schema_test.cpython-36.pyc137870644editdlrm
scope.cpython-36.pyc26000644editdlrm
scope_test.cpython-36.pyc40680644editdlrm
session.cpython-36.pyc73460644editdlrm
session_test.cpython-36.pyc23530644editdlrm
sparse_to_dense_mask_test.cpython-36.pyc52980644editdlrm
sparse_to_dense_test.cpython-36.pyc30030644editdlrm
task.cpython-36.pyc222070644editdlrm
task_test.cpython-36.pyc11780644editdlrm
test_util.cpython-36.pyc37290644editdlrm
text_file_reader.cpython-36.pyc22390644editdlrm
timeout_guard.cpython-36.pyc31060644editdlrm
toy_regression_test.cpython-36.pyc23600644editdlrm
transformations.cpython-36.pyc18330644editdlrm
transformations_test.cpython-36.pyc96080644editdlrm
tt_core.cpython-36.pyc64680644editdlrm
tt_core_test.cpython-36.pyc18240644editdlrm
utils.cpython-36.pyc122450644editdlrm
utils_test.cpython-36.pyc14160644editdlrm
visualize.cpython-36.pyc60270644editdlrm
workspace.cpython-36.pyc226900644editdlrm
workspace_test.cpython-36.pyc290550644editdlrm
_import_c_extension.cpython-36.pyc15240644editdlrm
__init__.cpython-36.pyc26070644editdlrm
Edit: /usr/local/lib64/python3.6/site-packages/caffe2/python/__pycache__/task.cpython-36.pyc (22207B)
3 Eg^@sddlmZmZddlmZmZddlmZddlmZddl m Z ddZ Gdd d ej Z Gd d d ej ZGd d d eZddZddZGdddejZGdddeZddZGdddeZGdddejZGdddeZdS))corecontext)Fieldfrom_blob_list) defaultdict)copy) viewitemscCs.|dkr |S|dkr|St|}|j||S)N)rupdate)abcr >/usr/local/lib64/python3.6/site-packages/caffe2/python/task.py_merge_node_kwargs s rc@s8eZdZdZddZddZddZdd Zd d Zd S) Clusterz Context that keeps track of all the node names used. Users shouldn't have to use them directly, since a Cluster is automatically generated at the first usage of 'Node'. cCsg|_i|_dS)N)_nodes _node_kwargs)selfr r r__init__szCluster.__init__cCsFt||jkr|jjt|t|j|jjt||jt|<dS)N)strrappendrkwargsrget)rnoder r radd_node"s zCluster.add_nodecCs|jS)zQ Returns the list of unique node names used within this context. )r)rr r rnodes)sz Cluster.nodescCs|jS)N)r)rr r r node_kwargs/szCluster.node_kwargscCsdj|j|jS)Nz!Cluster(nodes={}, node_kwargs={}))formatrr)rr r r__repr__2szCluster.__repr__N) __name__ __module__ __qualname____doc__rrrrrr r r rrs rc@s2eZdZdZd ddZddZddZd d Zd S) Nodea A Node context is used to indicate that all Tasks instantiated within will run on the given node name. (Only the name of the node actually counts.) Example: with TaskGroup() as tg: with Node('node1'): s1 = execution_step(...) Task(step=s1) with Node('node2'): s2 = execution_step(...) with Node('node1'): s3 = execution_step(...) In this example, all three execution steps will run in parallel. Moreover, s1 and s3 will run on the same node, and can see each others blobs. Additionally, a Node can be passed implementation-specific kwargs, in order to specify properties of the node. localcKs"t||_||_tjj|dS)N)r_name_kwargsrcurrentr)rrrr r rrNs z Node.__init__cCs|jS)N)r%)rr r r__str__Ssz Node.__str__cCsdj|j|jS)NzNode(name={}, kwargs={}))rr%r&)rr r rrVsz Node.__repr__cCs|jS)N)r&)rr r rrYsz Node.kwargsN)r$)rr r!r"rr(rrr r r rr#7s  r#c@seZdZdZdZdZdS) WorkspaceTypez Determines whether tasks of a TaskGroup will run directly at the global workspace, which is kept alive across runs, or whether a new child workspace will be created for the run and destroyed afterwards. privateglobalN)rr r!r"PRIVATEGLOBALr r r rr)]sr)c Cstj|d}tj|d}g}g}g}x>|D]6}t|drL||j|7}q.t|dr.||j|7}q.Wx|D]} t| dr| jrqpt| dr| j|krqpt| dr | j|} t| t t fr|| 7}n8t| tjtj fr|j | n| dk rt dt| d | _t| d rp| j|} t| t t fr8|| 7}n:t| tjtj frX|j | n| dk rrt dt| d | _qpWt|jjd kr|jd |t|jjd kr|jd |||fS) Nz/initz/exitget_all_attributesget_attributes _setup_used _setup_targetsetupzUnsupported type for setup: %sTexitr)rNethasattrr.r/r0r1r2 isinstancelisttuple ExecutionStepr TypeErrortyper3lenProtoopinsert) keyZ steps_or_netstargetinit_netexit_net init_nets exit_netsobjsZ step_or_netobjnetsr r rget_setup_netsgsL                rIcCsf| r| r|Sg}|r.|jtjd|||j|t|dkrZ|jtjd||tj||S)Nz%s:initrz%s:exit)rrexecution_stepr<)steprDrEnamestepsr r radd_setup_stepss   rNc@seZdZdZdZd ddZddZdd Zd d Zd d Z ddZ ddZ d!ddZ d"ddZ d#ddZd$ddZddZddZdS)% TaskGroupa Context that gathers tasks which will run concurrently, potentially on multiple nodes. All tasks in the same node will share the same workspace and thus can share blobs, while tasks running in different nodes won't be able to directly share data. All tasks of the task group will start concurrently, and the task group will finish execution when the last task of the group finishes. Example: # suppose that s1 ... s5 are execution steps or nets. with TaskGroup() as tg: # these tasks go to default node 'local' Task(step=s1) Task(step=s2) with Node('n2'): Task(step=s3) with Node('n1'): Task(step=s4) with Node('n2'): Task(step=s5) # this will run all steps in parallel. # s1 and s2 will run at default node 'local' # s3 and s5 will run at node 'n2' # s4 will run at node 'n1' session.run(tg) Z local_setupNcCs@d|_g|_d|_d|_g|_i|_g|_||_d|_g|_ dS)NF) Z _plan_cache_tasks _already_usedZ _prev_active _tasks_to_add _report_nets _report_steps_workspace_type_tasks_by_node _remote_nets)rworkspace_typer r rrszTaskGroup.__init__cCs|jj|dS)N)rWr)rnetr r radd_remote_netszTaskGroup.add_remote_netcCs|jS)N)rW)rr r r remote_netsszTaskGroup.remote_netscCsv|j std|jdks4|jdks4|j|jks4t|jdkrL|jpHtj|_|jdkr^|j|_|j|jj|dS)Nz-Cannot add Task to an already used TaskGroup.)rQAssertionErrorrUr)r, _notify_usedrPr)rtaskr r radds     z TaskGroup.addcCs,x|jD]}|j|qWg|_d|_|jS)NT)rRr_rQrP)rr^r r rtaskss  zTaskGroup.taskscCst|jt|jS)N)r<rRrP)rr r rnum_registered_tasksszTaskGroup.num_registered_taskscCs4g}x*|j|jD]}|j|kr|j|jqW|S)N)rPrRrr)rusedr^r r r used_nodess  zTaskGroup.used_nodescCs6tj|}|j||jjt|p(tj||fdS)a6 Add a "report step" to this TaskGroup. This step will run repeatedly every `interval_ms` milliseconds for the duration of the TaskGroup execution on each of the nodes. It is guaranteed that this step will be run at least once after every Task in the node has finished. N)rto_execution_stepRunEveryMillisrTrrr#r')rrKr interval_msr r r report_steps  zTaskGroup.report_stepcCs`t|ptj|}|dks(||jks(t||jkrR|r:|n tjd||f|j|<|j|dS)z6 DEPRECATED. Use report_step instead. Nz %s/reporterr)rr#r'rSr\rr4)rrYrZreport_intervalr r r report_nets   zTaskGroup.report_netc Csi}x*|jD]}|r ||jn|j||j<qW|jdk rX|j\}}||ksTtd|Sx.t|jD] \}\}}|j|||ddqdWi|_tt}x(|jD]}||j} || j |qWtt} x$|j D]\} } | || j | qWt } xt|D]\}}| |}t t j dd|D||\}}|}g}tj}x`|D]X}|j} | j|jtjk| dk rz|j | ||j7}|jtjkrFtj}qFWt|dkr|j tjdgt|dkr|d} ntjd ||d d } t|dks t|dkrlg}t|dkr2|j tjd |||j | t|dkr`|j tjd ||tj||} t|| |d| |dqW| |f|_| S)Nz)Cannot call tasks_by_node multiple times.i)rrgcSsg|] }|jqSr )get_step).0tr r r )sz+TaskGroup.tasks_by_node..remptyz%s:bodyT)Zconcurrent_substepsz%s:initz%s:exitgrouped_by_node)rrKoutputsrLgrouprX)r`rrVr\rrSrhrr7rrTrOrI LOCAL_SETUPr)r,rkSetCreateWorkspacerXrrr-r<rrJTask)rZ node_remapZnode_mapr^ tasks_by_nodeZ prev_node_maprrYintervalZ mapped_nodeZreport_steps_by_nodeZ original_noderKrqr` report_stepsZ node_initsZ node_exitsrMrrZgrouped_workspace_typer r rrw sv              zTaskGroup.tasks_by_nodecs>ttj|jfddj}t|dkr6tS|dS)NcsS)Nr )x)rr rTsz#TaskGroup.to_task..r)rr#r'rwr`r<rv)rrr`r )rrto_taskRs  zTaskGroup.to_taskcCs|jS)N)rU)rr r rrXYszTaskGroup.workspace_typecCsdj|j|j|j|jS)Nz6TaskGroup(tasks={}, workspace_type={}, remote_nets={}))rrPrRrXr[)rr r rr\s zTaskGroup.__repr__)N)NNrd)NNri)N)N)rr r!r"rtrrZr[r_r`rarcrhrjrwr|rXrr r r rrOs  I rOc@s:eZdZdZddZd ddZddZd d Zd d ZdS) TaskOutputzd Represents the output of a task. An output can be a blob, a list of blob, or a record. cCsTd|_d|_t|tr&||_|jj}t|ttfk|_|jrD|g}||_d|_ dS)NF) _schema _is_scalarr6rZ field_blobsr;r8r7names_values)rrr r rris  zTaskOutput.__init__NcCs&t|t|jkst||_||_dS)N)r<rr\r _fetch_func)rvaluesrr r rsetuszTaskOutput.setcCs@|jdk std|jr"|jdS|jr6t|j|jS|jSdS)NzOutput value not set yet.r)rr\rr~r)rr r rrzs  zTaskOutput.getcsNjdk stdfddjD}jr4|dSjrFtj|S|SdS)Nz#Cannot fetch value for this output.csg|]}j|qSr )r)rlv)rr rrnsz$TaskOutput.fetch..r)rr\rrr~r)rZ fetched_valsr )rrfetchs  zTaskOutput.fetchcCsdj|j|jS)NzTaskOutput(names={}, values={}))rrr)rr r rrszTaskOutput.__repr__)N) rr r!r"rrrrrr r r rr}cs    r}cCstjddpt}|j|S)a  Adds an output to the current Task, or if no task is active, create a dummy task that returns the given blob or record to the client. This will return the value of the blob or record when the last task of the TaskGroup for a given node finishes. F)required)rvr' add_output)Zblob_or_recordZcur_taskr r r final_outputsrc@s4eZdZdZd ddZddZd ddZd d ZdS) TaskOutputListz$ Keeps a list of outputs for a task NcCs|pg|_dS)N)rr)rrrr r rrszTaskOutputList.__init__cCs"g}x|jD]}||j7}q W|S)z[ Retrive the output names. TODO(azzolini): make this schema-based. )rrr)rror r rrs zTaskOutputList.namescCsVd}x8|jD].}t|j}|j|||||||7}q W|t|ksRtddS)NrzWrong number of output values.)rrr<rrr\)rrroffsetrnumr r r set_valuess    zTaskOutputList.set_valuescCs dj|jS)NzTaskOutputList(outputs={}))rrr)rr r rrszTaskOutputList.__repr__)N)N)rr r!r"rrrrr r r rrs   rcseZdZdZdZdZdZeZe ddZ d"dd Z fd d Z fd d Z ddZddZddZddZddZddZddZddZddZd d!ZZS)#rvaA A Task is composed of an execution step and zero or more outputs. Tasks are executed in the context of a TaskGroup, which, in turn, can be run by a Session. Task outputs are fetched by the session at the end of the run. The recommended way of creating a task is by using `net_builder.ops`. Example: from net_builder import ops with Node('trainer'), Task(name='my_task', num_instances=2): with ops.task_init(): globl = ops.Const(0) with ops.task_instance_init(): local = ops.Const(0) with ops.loop(100): ops.Copy(globl, local) with ops.task_instance_exit(): ops.Add([globl, local], [globl]) with ops.task_exit(): ops.Mul([globl, globl], [globl]) The task above will create 2 instances that will run in parallel. Each instance will copy `local` to `globl` 100 times, Then Add `local` to `globl` once. The `Mul` will only execute once, after all the instances of the task have finished. Z task_setupZtask_instance_setuprhcCsdt|dt|}|dkr"tjntdd|jD}|}d}x ||kr^|d7}d||f}q@W|S)N/css|] }|jVqdS)N)rL)rlrmr r r sz&Task._get_next_name..rrpz%s:%d)rrv_global_names_usedrrR)rrsrLbasenameZ names_usedZcur_nameir r r_get_next_names zTask._get_next_nameNcCs| rt|tjr|jj}|s$d}ttj|dkr6dnt||_t j|dd|_ t j |j|j ||_|j dk r|j j j|d|_d|_d|_g|_|dk r|j||dk r|j|d|_d|_||_d|_||_dS)aV Instantiate a Task and add it to the current TaskGroup and Node. Args: step: If provided, this task will run this ExecutionStep. outputs: If provided, the task will return the provided outputs to the client at completion time. node: If provided, force task execution on the given node. name: Name of the Task. num_instances: If provided, this task will be cloned num_instances times at runtime, and all instances will run concurrently. r^NF)r)r6rr9r=rLrr#r'rrOrsrvrrRrrQ_step_step_with_setup_outputsset_step add_outputsZ _pipelineZ_is_pipeline_contextrUZ _report_net_num_instances)rrKrrrXrsrrLZ num_instancesr r rrs,     z Task.__init__csjtt|j|jdk r&|jjj||j|jdks@tdddl m }|j |j d|_ |j j|S)Nz(This Task already has an execution step.r) net_builder)Z _fullname)superrv __enter__rsrRremove_assert_not_usedrr\ caffe2.pythonrZ NetBuilderrL _net_builder)rr) __class__r rrs   zTask.__enter__csZtt|j||||jj||||dkr8|j|j|jdk rP|jjj|d|_dS)N)rrv__exit__rrrsrRr)rr;value traceback)rr rr's  z Task.__exit__cCs|jS)N)rU)rr r rrX1szTask.workspace_typecCs|j stddS)Nz1Cannot modify task since it is already been used.)rQr\)rr r rr4s zTask._assert_not_usedcCs.|jt|tr|nt|}|jj||S)N)rr6r}rr)routputr r rr8s zTask.add_outputcs8jt|ttfkr"j|Sfdd|DSdS)Ncsg|]}j|qSr )r)rlr)rr rrnDsz$Task.add_outputs..)rr;r7r8r)rrrr )rrr?s zTask.add_outputscCs|jtj||_dS)N)rrrer)rrKr r rrFsz Task.set_stepc Csj|jdk r|jS|jdkr0tj|jg|_|jSdd|jjtjD}x&|D]}d|_|j j sN|j dqNWt tj |jg||\}}t tj|jg||\}}t|jdkrtjd|j}|j|jgdtjjdd|j||s|jntjd |j||jg}t||||jd } |jrR|jdkrR| jdtjd | g|jd } t| |||j|_|jS) NcSsg|]}t|ds|qS)_report_step_used)r5)rlsr r rrnSsz!Task.get_step..Tirz %s:outputrp)Zdtyperz%s:bodyz :instancez %s:parallel)Znum_concurrent_instances)rrrrJrLr.rv REPORT_STEPrr=Z run_every_msrfrI TASK_SETUPTASK_INSTANCE_SETUPr<rr4rZ ConstantFillZDataTypeZINT32rrNrru) rryrKZtask_init_netsZtask_exit_netsZinstance_init_netsZinstance_exit_netsZ output_netbodyZstep_with_instance_setupr r rrkJsD        z Task.get_stepcCs t|jS)N)rr)rr r r output_listyszTask.output_listcCs|jS)N)r)rr r rrr|sz Task.outputscCs|jd|_dS)NT)rkrQ)rr r rr]szTask._notify_usedcCsdj|j|j|jS)Nz"Task(name={}, node={}, outputs={}))rrLrrr)rr r rrsz Task.__repr__)NNNNNNN)rr r!r"rrrrr staticmethodrrrrrXrrrrrkrrrr]r __classcell__r r )rrrvs*  + /rvc@s2eZdZdZd ddZddZddZd d ZdS) SetupNetsa 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. NcCs||_||_dS)N)rDrE)rrDrEr r rrszSetupNets.__init__cCs|jS)N)rD)rrBr r rr2szSetupNets.setupcCs|jS)N)rE)rrCr r rr3szSetupNets.exitcCsdj|j|jS)Nz%SetupNets(init_nets={}, exit_nets={}))rrDrE)rr r rrszSetupNets.__repr__)NN)rr r!r"rr2r3rr r r rrs  rN)rrrZcaffe2.python.schemarr collectionsrrZ future.utilsrrZDefaultManagedrr#objectr)rIrNZManagedrOr}rrrvrr r r rs$    !& , E/ Q