pytorch/caffe2/python
Hexus (Shihao Xu) bd95f8f948 Resolve name conflict of ContextManager (#7244)
* Resolve conflicting name, ContextManager

Concept name `Context Manager` is taken by Python. See https://docs.python.org/3.6/reference/datamodel.html#with-statement-context-managers

It says,
A context manager is an object that defines the runtime context to be established when executing a with statement. The context manager handles the entry into, and the exit from, the desired runtime context for the execution of the block of code.

The `ContextManager` here is more like a registry. 
And there is a C++ registry in caffe2 codebase `caffe2/caffe2/core/registry.h`.
There is also a Caffe2DBRegistry, declared by calling `CAFFE_DECLARE_REGISTRY(Caffe2DBRegistry, DB, const string&, Mode);` in `caffe2/caffe2/core/db.h`.

I think we can follow the concept name `Registry`, calling it `ContextRegistry`.

* Make Classes and Functions internal to this module start with "_"

Make Classes and Functions internal to this module start with "_"

* Update context.py

* Update context.py
2018-06-22 00:41:51 -04:00
..
docs Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
examples Update from Facebook (#6692) 2018-04-17 23:36:40 -07:00
helpers [Caffe2] Add full impl of GroupNorm (#7058) 2018-04-29 11:26:40 -07:00
ideep Add depthwise convolution test for IDEEP (#8301) 2018-06-09 08:44:13 -07:00
layers Update from facebook (#8384) 2018-06-13 13:10:45 -07:00
mint Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
mkl Update from facebook (#8384) 2018-06-13 13:10:45 -07:00
modeling Update from Facebook (#6692) 2018-04-17 23:36:40 -07:00
models [Caffe2] Revamp the convnet benchmark code by using models from model zoo (#7351) 2018-05-08 08:53:52 -07:00
onnx Update from facebook (#8384) 2018-06-13 13:10:45 -07:00
operator_test New operator 'expand' (#8263) 2018-06-18 16:33:47 -07:00
predictor Update from facebook (#8384) 2018-06-13 13:10:45 -07:00
rnn Fix a typo 2018-03-30 21:00:44 -07:00
test Fix occasional test timeouts 2018-01-19 20:08:58 -08:00
trt [caffe2] Change iteritems in trt/transform.py to items for python3 compatibility (#7599) 2018-05-15 20:32:06 -07:00
__init__.py Experimental support for setup.py develop mode install 2018-02-12 23:36:18 -08:00
_import_c_extension.py caffe2 hip python binding (#8491) 2018-06-14 19:56:56 -07:00
allcompare_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
attention.py [Caffe2] Update elementwise ops to support numpy style boradcast (#8070) 2018-06-05 15:49:16 -07:00
benchmark_generator.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
binarysize.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
brew_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
brew.py [Caffe2] Changes done inside Facebook (#6378) 2018-04-10 21:11:43 -07:00
build.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
cached_reader.py Update from facebook (#7451) 2018-05-10 23:14:27 -07:00
caffe_translator_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
caffe_translator.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
checkpoint_test.py Update from facebook (#6871) 2018-04-23 15:01:56 -07:00
checkpoint.py Update from facebook (#6871) 2018-04-23 15:01:56 -07:00
CMakeLists.txt caffe2 hip python binding (#8491) 2018-06-14 19:56:56 -07:00
cnn.py [Caffe2] Changes done inside Facebook (#6378) 2018-04-10 21:11:43 -07:00
context_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
context.py Resolve name conflict of ContextManager (#7244) 2018-06-22 00:41:51 -04:00
control_ops_grad.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
control_ops_util.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
control_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
control.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
convnet_benchmarks_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
convnet_benchmarks.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
core_gradients_test.py [Caffe2] Update elementwise ops to support numpy style boradcast (#8070) 2018-06-05 15:49:16 -07:00
core_test.py Update from facebook 1ee4edd286a3 (#8040) 2018-06-01 17:41:09 -04:00
core.py Update from facebook 1ee4edd286a3 (#8040) 2018-06-01 17:41:09 -04:00
crf.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
data_parallel_model_test.py Update from facebook (#7451) 2018-05-10 23:14:27 -07:00
data_parallel_model.py Update from facebook (#7451) 2018-05-10 23:14:27 -07:00
data_workers_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
data_workers.py Update from facebook (#7696) 2018-05-19 23:10:48 -07:00
dataio_test.py Update from facebook (#7451) 2018-05-10 23:14:27 -07:00
dataio.py Add return value to setup() function of PipedReaderBuilder (#7476) 2018-05-10 15:39:54 -07:00
dataset.py Update from facebook (#7855) 2018-05-29 11:38:02 -07:00
db_file_reader.py Update from facebook (#7855) 2018-05-29 11:38:02 -07:00
db_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
device_checker.py Update from facebook (#7451) 2018-05-10 23:14:27 -07:00
dlpack.h Support for DLPack in Python op 2017-12-21 17:02:16 -08:00
dyndep.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
embedding_generation_benchmark.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
experiment_util.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
extension_loader.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
functional_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
functional.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
fused_8bit_rowwise_conversion_ops_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
gradient_check_test.py [Caffe2] Update elementwise ops to support numpy style boradcast (#8070) 2018-06-05 15:49:16 -07:00
gradient_checker.py Update from facebook (#7451) 2018-05-10 23:14:27 -07:00
gru_cell.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
hsm_util.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
hypothesis_test_util.py Update from facebook (#7451) 2018-05-10 23:14:27 -07:00
hypothesis_test.py Fix flaky atomic iter test (#7649) 2018-05-17 21:17:29 -07:00
ideep_test_util.py [feature request] [Caffe2] Enable MKLDNN support for inference (#6699) 2018-04-22 21:58:14 -07:00
layer_model_helper.py Update from facebook (#8384) 2018-06-13 13:10:45 -07:00
layer_model_instantiator.py [caffe2] Fbcode to GitHub sync (#6208) 2018-04-02 16:35:27 -07:00
layer_parameter_sharing_test.py [layer model] remove duplicated init ops 2018-03-27 18:10:39 -07:00
layer_test_util.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
layers_test.py Update from facebook (#8384) 2018-06-13 13:10:45 -07:00
lengths_reducer_fused_8bit_rowwise_ops_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
lengths_reducer_rowwise_8bit_ops_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
lstm_benchmark.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
memonger_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
memonger.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
mkl_test_util.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
model_device_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
model_helper.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
modifier_context.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
mpi_python.cc Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
muji_test.py [Caffe2] Support non peer access in muji and fix bug when reduced_affix is empty (#6896) 2018-06-05 03:14:43 +08:00
muji.py [Caffe2] Support non peer access in muji and fix bug when reduced_affix is empty (#6896) 2018-06-05 03:14:43 +08:00
net_builder_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
net_builder.py Update from Facebook (#6692) 2018-04-17 23:36:40 -07:00
net_drawer.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
net_printer_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
net_printer.py [DT] [38/n] Rename add_stop_signal to add_stop_condition (#6825) 2018-04-23 10:39:37 -07:00
numa_benchmark.py Update from facebook (#6871) 2018-04-23 15:01:56 -07:00
numa_test.py [core] NUMA-aware pinned allocator 2018-03-06 00:33:11 -08:00
observer_test.py Fix RNN scoping situation 2018-02-07 17:35:29 -08:00
optimizer_context.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
optimizer_test_util.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
optimizer_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
optimizer.py Update from facebook (#7696) 2018-05-19 23:10:48 -07:00
parallel_workers_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
parallel_workers.py Update from facebook (#7696) 2018-05-19 23:10:48 -07:00
parallelize_bmuf_distributed_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
pipeline_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
pipeline.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
predictor_constants.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
pybind_state_dlpack.cc Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
pybind_state_dlpack.h TypeId improvements (#8350) 2018-06-14 09:16:26 -07:00
pybind_state_gpu.cc [Caffe2] Provide option to initialize the TensorRT engine at Operator constructor time (#6809) 2018-04-23 13:09:35 -07:00
pybind_state_hip.cc [Caffe2] Enable AMD/MIOPEN ops for Caffe2 (#8306) 2018-06-13 04:00:39 -07:00
pybind_state_ideep.cc Fix build error in pybind_state_ideep (#8684) 2018-06-20 08:29:48 -07:00
pybind_state_int8.cc [C2 Int8][C2 Core]fetch int8 blob 2018-03-30 21:00:44 -07:00
pybind_state_mkl.cc Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
pybind_state.cc Update from facebook (#7696) 2018-05-19 23:10:48 -07:00
pybind_state.h caffe2 export (#8642) 2018-06-19 00:50:33 -07:00
python_op_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
queue_util.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
record_queue.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
recurrent.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
regularizer_context.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
regularizer_test.py add dense regularization 2018-01-08 13:03:17 -08:00
regularizer.py Update from facebook (#8384) 2018-06-13 13:10:45 -07:00
rnn_cell.py Fix typo in comment (#7183) 2018-05-02 11:58:30 -07:00
schema_test.py Update from facebook (#7855) 2018-05-29 11:38:02 -07:00
schema.py Update from facebook (#7855) 2018-05-29 11:38:02 -07:00
scope_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
scope.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
session_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
session.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
sparse_to_dense_mask_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
sparse_to_dense_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
task.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
test_util.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
text_file_reader.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
timeout_guard.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
toy_regression_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
transformations_test.py [caffe2][nomnigraph] Batchnorm + Conv Fusion (#7057) 2018-05-08 15:40:34 -07:00
transformations.py [caffe2][nomnigraph] Batchnorm + Conv Fusion (#7057) 2018-05-08 15:40:34 -07:00
tt_core_test.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
tt_core.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
utils.py [Caffe2][fbcode=>GH sync] Update from facebook 4323b18ce13c (#7116) 2018-05-01 20:49:00 -07:00
visualize.py Remove Apache headers from source. 2018-03-27 13:10:18 -07:00
workspace_test.py [feature request] [Caffe2] Enable MKLDNN support for inference (#6699) 2018-04-22 21:58:14 -07:00
workspace.py Update from facebook (#7696) 2018-05-19 23:10:48 -07:00