/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__/session.cpython-36.pyc (7346B)
3 Eg@s\ddlmZmZddlmZmZmZmZGdddeZ GdddeZ Gddde Z d S) )core workspace)ClusterTask TaskGroup WorkspaceTypec@seZdZdZddZdS)CompiledRunnablez? Wrapper for compiled runnable returned from session.compile() cCs||_||_dS)N)obj session_class)selfr r r A/usr/local/lib64/python3.6/site-packages/caffe2/python/session.py__init__szCompiledRunnable.__init__N)__name__ __module__ __qualname____doc__rr r r r r src@szeZdZdZiZddZddZedddZdd d Z d d Z d dZ ddZ edddZ ddZddZddZdS)SessionaD Allows to run Nets, ExecutionSteps, Plans, Tasks and TaskGroups. A session can potentially run in multiple nodes concurrently. Example: from core import Net from caffe2.python.task import Task, TaskGroup, WorkspaceType net = Net('test1') net.Add([net.Const(1), net.Const(2)]) net2 = net.Clone() step = core.execution_step('step1', [net2]) with TaskGroup(WorkspaceType.GLOBAL) as init_tg: with Node('node1'): n1setup = net.Net('n1setup') n1msg = n1setup.Const('Hello from node 1.') Task(step=n1setup) with TaskGroup() as private_tg: with Node('node1'): n1 = net.Net('n1') n1.Print(n1msg, 0) Task(step=n1) with Node('node2'): n2 = net.Net('n2') n2.Print(n2.Const('Hello from node 2.'), 0) Task(step=n2) session = LocalSession() session.run(net) session.run(step) session.run(init_tg) session.run(private_tg) Global Workspace: At the beginning of the session, a global workspace is created and kept alive for the duration of the session. Private Workspace: Tasks can be run either directly on the global workspace, or they can instantiate a private child workspace that is released after each run. Blob visibility: Tasks running in different nodes in parallel will always run under different workspaces, so it must be assumed that they won't be able to access each other's blobs. Tasks running on the same node will follow Workspace hierarchy rules: tasks running on separate private workspaces will only be able to share blobs defined on a common parent Workspace. cCs d|_dS)NT)_open)r r r r rNszSession.__init__cCs|jS)N)r)r r r r is_openQszSession.is_openNcCsxt|tr2||jks.tdd|j|jjf|S||jkrF|j|St|tr|r|jr~|j|kstdj||jn||_ |}n|dkrt j }t|d}t|t r|j |nt|tjr|j t |dnt|tjr:t|jdkstt|jdkr$|j t |jddn|j t |jdntjd|}|j t |dt|j|||d }||j|<|S) Nz2Runnable was compiled for different session type. zNeed: %s, got: %szRequire {} but already have {})workspace_type)steprrunnable)r ) isinstancerr AssertionErrorr_compiled_cacherrformatZ_workspace_typerGLOBALraddrZ ExecutionStepPlanlenZStepsZexecution_step_compile_task_group)clsrrsetup_net_listtgrcompiledr r r compileTsD           zSession.compilecCs:|jstd|dk s td|j|j|||jdS)aRun the given runnable. Args: runnable: Object recognized by the Session. Currently, we support TaskGroup, Task, Plan, ExecutionStep, and Net. workspace_type: A string defined in the WorkspaceType object. setup_net_list: A list of Net objects or a list of NetDef protos. So far this is only used by the DistributedSession, in which we need to pass a list of special nets to setup the master. zSession is closed.NzGot a none runnable.)rr _run_compiledr'r )r rrr$r r r runs  z Session.runcCs|jr|jd|_dS)NF)r _do_closer)r r r r closesz Session.closecCs tdS)N)NotImplementedError)r outputr r r fetch_outputszSession.fetch_outputcCs tdS)N)r,)r task_groupr r r r(szSession._run_compiledcCs|S)Nr )r#r/r$r r r r"szSession._compile_task_groupcCsdS)Nr )r r r r r*szSession._do_closecCs|jstd|S)NzSession already closed.)rr)r r r r __enter__szSession.__enter__cCs|dkr|jdS)N)r+)r Zex_typevalue tracebackr r r __exit__szSession.__exit__)NN)NN)N)rrrrrrr classmethodr'r)r+r.r(r"r*r0r3r r r r rs6 0  rc@s8eZdZdZd ddZed ddZddZd d ZdS) LocalSessionaQ Session that runs in a single node. Tasks are all remapped to run in parallel in the 'local' node. Currently, LocalSession runs all parallel tasks in the same workspace, but this behavior may change in the future. Only tasks pointing to the same logical node are guaranteed to always run in the same workspace. NcCstj||ptjjj|_dS)N)rrrC Workspacecurrent_ws)r wsr r r rs zLocalSession.__init__c CsDt|j}WdQRXtjd}|j|j||j|jfS)NZtask_group_plan)rZto_taskrr ZAddStepZget_step output_listr)r#r/r$taskplanr r r r"s  z LocalSession._compile_task_groupc Cs|\}}}g}x4|jD](}|jjt||jtjt|qW|j||jd|t j krlt j j |jn|j}t j||j|WdQRXdS)N)Z _fetch_func)namesr9Z create_blobstrappendrZ BlobReferenceZ set_values _fetch_outputrZPRIVATErr6r7ZWorkspaceGuardr))r r&r=r;routputsnameZtask_wsr r r r(s  zLocalSession._run_compiledcCs|jjt|jS)N)r9Zblobsr?fetch)r r-r r r rAszLocalSession._fetch_output)N)N) rrrrrr4r"r(rAr r r r r5s   r5N) Z caffe2.pythonrrZcaffe2.python.taskrrrrobjectrrr5r r r r  s