Copy disabled (too large)
Download .txt
Showing preview only (19,010K chars total). Download the full file to get everything.
Repository: Yangqing/caffe2
Branch: master
Commit: 28523ff1ff33
Files: 1931
Total size: 17.8 MB
Directory structure:
gitextract_2u1ieaci/
├── .gitattributes
├── .github/
│ ├── CONTRIBUTING.md
│ ├── ISSUE_TEMPLATE.md
│ └── PULL_REQUEST_TEMPLATE.md
├── .gitignore
├── .gitmodules
├── .jenkins/
│ ├── README.md
│ ├── build.sh
│ └── test.sh
├── .travis/
│ ├── build.sh
│ ├── install.sh
│ ├── setup.sh
│ └── test.sh
├── .travis.yml
├── CMakeLists.txt
├── LICENSE
├── Makefile
├── NOTICE
├── README.md
├── VERSION_NUMBER
├── appveyor.yml
├── binaries/
│ ├── CMakeLists.txt
│ ├── caffe2_benchmark.cc
│ ├── convert_caffe_image_db.cc
│ ├── convert_db.cc
│ ├── convert_encoded_to_raw_leveldb.cc
│ ├── core_overhead_benchmark.cc
│ ├── db_throughput.cc
│ ├── inspect_gpus.cc
│ ├── make_cifar_db.cc
│ ├── make_image_db.cc
│ ├── make_mnist_db.cc
│ ├── predictor_verifier.cc
│ ├── print_core_object_sizes.cc
│ ├── print_registered_core_operators.cc
│ ├── run_plan.cc
│ ├── run_plan_mpi.cc
│ ├── speed_benchmark.cc
│ ├── split_db.cc
│ ├── tutorial_blob.cc
│ └── zmq_feeder.cc
├── caffe/
│ ├── __init__.py
│ └── proto/
│ ├── CMakeLists.txt
│ ├── __init__.py
│ └── caffe.proto
├── caffe2/
│ ├── .clang-format
│ ├── CMakeLists.txt
│ ├── __init__.py
│ ├── contrib/
│ │ ├── CMakeLists.txt
│ │ ├── __init__.py
│ │ ├── aten/
│ │ │ ├── CMakeLists.txt
│ │ │ ├── README.md
│ │ │ ├── aten_op.cc
│ │ │ ├── aten_op.h
│ │ │ ├── aten_op_cuda.cc
│ │ │ ├── aten_op_template.h
│ │ │ ├── aten_test.py
│ │ │ ├── docs/
│ │ │ │ ├── pytorch_to_caffe2.md
│ │ │ │ └── sample.py
│ │ │ └── gen_op.py
│ │ ├── cuda-convnet2/
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── build.sh
│ │ │ ├── convdata.py
│ │ │ ├── convnet.py
│ │ │ ├── cudaconv3/
│ │ │ │ ├── Makefile
│ │ │ │ ├── include/
│ │ │ │ │ ├── conv_util.cuh
│ │ │ │ │ └── cudaconv2.cuh
│ │ │ │ └── src/
│ │ │ │ ├── conv_util.cu
│ │ │ │ ├── filter_acts.cu
│ │ │ │ ├── img_acts.cu
│ │ │ │ └── weight_acts.cu
│ │ │ ├── cudaconvnet/
│ │ │ │ ├── Makefile
│ │ │ │ ├── __init__.py
│ │ │ │ ├── include/
│ │ │ │ │ ├── actbroadcaster.cuh
│ │ │ │ │ ├── convnet.cuh
│ │ │ │ │ ├── copypipeline.cuh
│ │ │ │ │ ├── cost.cuh
│ │ │ │ │ ├── data.cuh
│ │ │ │ │ ├── gradreducer.cuh
│ │ │ │ │ ├── jpeg.h
│ │ │ │ │ ├── layer.cuh
│ │ │ │ │ ├── layer_kernels.cuh
│ │ │ │ │ ├── lr.cuh
│ │ │ │ │ ├── memorysource.cuh
│ │ │ │ │ ├── messages.cuh
│ │ │ │ │ ├── neuron.cuh
│ │ │ │ │ ├── pipedispenser.cuh
│ │ │ │ │ ├── pyconvnet.cuh
│ │ │ │ │ ├── reducepipeline.cuh
│ │ │ │ │ ├── streambroadcast.cuh
│ │ │ │ │ ├── timer.cuh
│ │ │ │ │ ├── util.cuh
│ │ │ │ │ ├── weights.cuh
│ │ │ │ │ └── worker.cuh
│ │ │ │ └── src/
│ │ │ │ ├── actbroadcaster.cu
│ │ │ │ ├── convnet.cu
│ │ │ │ ├── copypipeline.cu
│ │ │ │ ├── cost.cu
│ │ │ │ ├── data.cu
│ │ │ │ ├── gradreducer.cu
│ │ │ │ ├── jpeg.cpp
│ │ │ │ ├── layer.cu
│ │ │ │ ├── layer_kernels.cu
│ │ │ │ ├── lr.cu
│ │ │ │ ├── memorysource.cu
│ │ │ │ ├── neuron.cu
│ │ │ │ ├── pyconvnet.cu
│ │ │ │ ├── reducepipeline.cu
│ │ │ │ ├── streambroadcast.cu
│ │ │ │ ├── util.cu
│ │ │ │ ├── weights.cu
│ │ │ │ └── worker.cu
│ │ │ ├── initw.py
│ │ │ ├── layer.py
│ │ │ ├── layers/
│ │ │ │ ├── layer-params-cifar10-11pct.cfg
│ │ │ │ ├── layer-params-imagenet-1gpu.cfg
│ │ │ │ ├── layer-params-imagenet-2gpu-data.cfg
│ │ │ │ ├── layer-params-imagenet-2gpu-model.cfg
│ │ │ │ ├── layer-params-imagenet-4gpu-data-model.cfg
│ │ │ │ ├── layer-params-imagenet-4gpu-data.cfg
│ │ │ │ ├── layers-cifar10-11pct.cfg
│ │ │ │ ├── layers-imagenet-1gpu.cfg
│ │ │ │ ├── layers-imagenet-2gpu-data.cfg
│ │ │ │ ├── layers-imagenet-2gpu-model.cfg
│ │ │ │ ├── layers-imagenet-4gpu-data-model.cfg
│ │ │ │ └── layers-imagenet-4gpu-data.cfg
│ │ │ ├── make-data/
│ │ │ │ ├── input_meta
│ │ │ │ ├── make-data.py
│ │ │ │ └── pyext/
│ │ │ │ ├── Makefile
│ │ │ │ ├── __init__.py
│ │ │ │ ├── include/
│ │ │ │ │ └── pyext.h
│ │ │ │ └── src/
│ │ │ │ └── pyext.cpp
│ │ │ ├── nvmatrix/
│ │ │ │ ├── Makefile
│ │ │ │ ├── include/
│ │ │ │ │ ├── memory.cuh
│ │ │ │ │ ├── nvmatrix.cuh
│ │ │ │ │ ├── nvmatrix_kernels.cuh
│ │ │ │ │ └── nvmatrix_operators.cuh
│ │ │ │ └── src/
│ │ │ │ ├── memory.cu
│ │ │ │ ├── nvmatrix.cu
│ │ │ │ └── nvmatrix_kernels.cu
│ │ │ ├── python_util/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── data.py
│ │ │ │ ├── gpumodel.py
│ │ │ │ ├── options.py
│ │ │ │ └── util.py
│ │ │ ├── shownet.py
│ │ │ └── util/
│ │ │ ├── Makefile
│ │ │ ├── include/
│ │ │ │ ├── matrix.h
│ │ │ │ ├── matrix_funcs.h
│ │ │ │ ├── queue.h
│ │ │ │ ├── sync.h
│ │ │ │ └── thread.h
│ │ │ └── src/
│ │ │ └── matrix.cpp
│ │ ├── docker-ubuntu-14.04/
│ │ │ └── Dockerfile
│ │ ├── gloo/
│ │ │ ├── CMakeLists.txt
│ │ │ ├── allgather_ops.cc
│ │ │ ├── allgather_ops.h
│ │ │ ├── allreduce_ops.cc
│ │ │ ├── allreduce_ops.h
│ │ │ ├── allreduce_ops_gpu.cc
│ │ │ ├── barrier_ops.cc
│ │ │ ├── barrier_ops.h
│ │ │ ├── broadcast_ops.cc
│ │ │ ├── broadcast_ops.h
│ │ │ ├── broadcast_ops_gpu.cc
│ │ │ ├── common.cc
│ │ │ ├── common.h
│ │ │ ├── common_world_ops.cc
│ │ │ ├── common_world_ops.h
│ │ │ ├── common_world_ops_gpu.cc
│ │ │ ├── context.cc
│ │ │ ├── context.h
│ │ │ ├── gloo_test.py
│ │ │ ├── py_export.cc
│ │ │ ├── reduce_scatter_ops.cc
│ │ │ ├── reduce_scatter_ops.h
│ │ │ ├── store_handler.cc
│ │ │ └── store_handler.h
│ │ ├── nccl/
│ │ │ ├── CMakeLists.txt
│ │ │ ├── cuda_nccl_gpu.cc
│ │ │ ├── cuda_nccl_gpu.h
│ │ │ ├── cuda_nccl_op_gpu.cc
│ │ │ └── nccl_ops_test.py
│ │ ├── nervana/
│ │ │ ├── CMakeLists.txt
│ │ │ ├── nervana.h
│ │ │ ├── nervana_c_api.cu
│ │ │ ├── nervana_c_api.h
│ │ │ ├── nervana_fc_op_gpu.cc
│ │ │ ├── nervana_fc_op_gpu_test.cc
│ │ │ ├── nervana_init_gpu.cc
│ │ │ └── nervana_math_gpu.cc
│ │ ├── nnpack/
│ │ │ ├── nnpack_ops.cc
│ │ │ └── nnpack_ops_test.py
│ │ ├── playground/
│ │ │ ├── AnyExp.py
│ │ │ ├── AnyExpOnTerm.py
│ │ │ ├── ModuleRegister.py
│ │ │ ├── README.md
│ │ │ ├── __init__.py
│ │ │ ├── checkpoint.py
│ │ │ ├── compute_loss.py
│ │ │ ├── compute_topk_accuracy.py
│ │ │ ├── meter.py
│ │ │ ├── module_map.py
│ │ │ ├── output_generator.py
│ │ │ └── resnet50demo/
│ │ │ ├── IN1k_resnet50.py
│ │ │ ├── __init__.py
│ │ │ ├── caffe2_resnet50_default_forward.py
│ │ │ ├── caffe2_resnet50_default_param_update.py
│ │ │ ├── explicit_resnet_forward.py
│ │ │ ├── explicit_resnet_param_update.py
│ │ │ ├── gfs_IN1k.py
│ │ │ └── rendezvous_filestore.py
│ │ ├── prof/
│ │ │ ├── CMakeLists.txt
│ │ │ ├── cuda_profile_ops.cc
│ │ │ ├── cuda_profile_ops_test.py
│ │ │ ├── htrace_async_dag_net_gpu.cc
│ │ │ ├── htrace_conf.cc
│ │ │ ├── htrace_conf.h
│ │ │ ├── htrace_dag_net.cc
│ │ │ ├── htrace_to_chrome.py
│ │ │ ├── prof_dag_net.cc
│ │ │ ├── prof_dag_net.h
│ │ │ ├── prof_dag_stats_op.cc
│ │ │ └── prof_dag_stats_op.h
│ │ ├── script/
│ │ │ ├── CMakeLists.txt
│ │ │ ├── caffe2_script_test.py
│ │ │ ├── compiler.cc
│ │ │ ├── compiler.h
│ │ │ ├── error_report.h
│ │ │ ├── examples/
│ │ │ │ ├── example_beam_search.c2s
│ │ │ │ ├── example_post_eos_penalty.c2s
│ │ │ │ └── run_examples.py
│ │ │ ├── lexer.cc
│ │ │ ├── lexer.h
│ │ │ ├── parser.h
│ │ │ ├── tree.h
│ │ │ └── tree_views.h
│ │ ├── shm_mutex/
│ │ │ ├── CMakeLists.txt
│ │ │ ├── shm_mutex.cc
│ │ │ └── shm_mutex.h
│ │ ├── tensorboard/
│ │ │ ├── __init__.py
│ │ │ ├── tensorboard.md
│ │ │ ├── tensorboard.py
│ │ │ ├── tensorboard_exporter.py
│ │ │ ├── tensorboard_exporter_test.py
│ │ │ └── tensorboard_test.py
│ │ ├── torch/
│ │ │ ├── th_ops.cc
│ │ │ ├── th_ops_gpu.cu
│ │ │ ├── th_ops_test.py
│ │ │ ├── torch_op.cpp
│ │ │ ├── torch_op.h
│ │ │ ├── torch_op_gpu.cpp
│ │ │ └── torch_ops_test.py
│ │ └── warpctc/
│ │ ├── ctc_op.cpp
│ │ ├── ctc_op.h
│ │ ├── ctc_op_gpu.cpp
│ │ └── ctc_ops_test.py
│ ├── core/
│ │ ├── CMakeLists.txt
│ │ ├── allocator.cc
│ │ ├── allocator.h
│ │ ├── asan.h
│ │ ├── blob.h
│ │ ├── blob_gpu_test.cc
│ │ ├── blob_serialization.cc
│ │ ├── blob_serialization.h
│ │ ├── blob_serialization_gpu.cc
│ │ ├── blob_serializer_base.h
│ │ ├── blob_stats.cc
│ │ ├── blob_stats.h
│ │ ├── blob_test.cc
│ │ ├── common.cc
│ │ ├── common.h
│ │ ├── common_cudnn.cc
│ │ ├── common_cudnn.h
│ │ ├── common_gpu.cc
│ │ ├── common_gpu.h
│ │ ├── common_omp.h
│ │ ├── common_test.cc
│ │ ├── context.cc
│ │ ├── context.h
│ │ ├── context_gpu.cu
│ │ ├── context_gpu.h
│ │ ├── context_gpu_test.cc
│ │ ├── context_test.cc
│ │ ├── cudnn_wrappers.h
│ │ ├── db.cc
│ │ ├── db.h
│ │ ├── event.cc
│ │ ├── event.h
│ │ ├── event_cpu.h
│ │ ├── event_gpu.cc
│ │ ├── event_gpu_test.cc
│ │ ├── event_test.cc
│ │ ├── flags.cc
│ │ ├── flags.h
│ │ ├── graph.cc
│ │ ├── graph.h
│ │ ├── graph_test.cc
│ │ ├── init.cc
│ │ ├── init.h
│ │ ├── init_intrinsics_check.cc
│ │ ├── init_omp.cc
│ │ ├── init_test.cc
│ │ ├── logging.cc
│ │ ├── logging.h
│ │ ├── logging_is_google_glog.h
│ │ ├── logging_is_not_google_glog.h
│ │ ├── logging_test.cc
│ │ ├── macros.h
│ │ ├── macros.h.in
│ │ ├── memonger.cc
│ │ ├── memonger.h
│ │ ├── module.cc
│ │ ├── module.h
│ │ ├── module_test.cc
│ │ ├── net.cc
│ │ ├── net.h
│ │ ├── net_async_base.cc
│ │ ├── net_async_base.h
│ │ ├── net_async_dag_gpu.cc
│ │ ├── net_async_dag_gpu.h
│ │ ├── net_async_gpu_thread_pool.h
│ │ ├── net_async_gpu_thread_pool_gpu.cc
│ │ ├── net_async_polling.cc
│ │ ├── net_async_polling.h
│ │ ├── net_async_scheduling.cc
│ │ ├── net_async_scheduling.h
│ │ ├── net_dag.cc
│ │ ├── net_dag.h
│ │ ├── net_dag_utils.cc
│ │ ├── net_dag_utils.h
│ │ ├── net_gpu_test.cc
│ │ ├── net_simple.cc
│ │ ├── net_simple.h
│ │ ├── net_simple_async.cc
│ │ ├── net_simple_async.h
│ │ ├── net_singlethread_async_gpu.cc
│ │ ├── net_test.cc
│ │ ├── numa.cc
│ │ ├── numa.h
│ │ ├── observer.h
│ │ ├── observer_test.cc
│ │ ├── operator.cc
│ │ ├── operator.h
│ │ ├── operator_gpu_test.cc
│ │ ├── operator_gradient.h
│ │ ├── operator_schema.cc
│ │ ├── operator_schema.h
│ │ ├── operator_schema_test.cc
│ │ ├── operator_test.cc
│ │ ├── parallel_net_test.cc
│ │ ├── plan_executor.cc
│ │ ├── plan_executor.h
│ │ ├── predictor.cc
│ │ ├── predictor.h
│ │ ├── predictor_test.cc
│ │ ├── qtensor.cc
│ │ ├── qtensor.h
│ │ ├── qtensor_serialization.cc
│ │ ├── qtensor_serialization.h
│ │ ├── registry.h
│ │ ├── registry_test.cc
│ │ ├── scope_guard.h
│ │ ├── static_tracepoint.h
│ │ ├── static_tracepoint_elfx86.h
│ │ ├── stats.cc
│ │ ├── stats.h
│ │ ├── stats_test.cc
│ │ ├── tensor.cc
│ │ ├── tensor.h
│ │ ├── timer.h
│ │ ├── timer_test.cc
│ │ ├── transform.cc
│ │ ├── transform.h
│ │ ├── transform_test.cc
│ │ ├── typeid.cc
│ │ ├── typeid.h
│ │ ├── typeid_test.cc
│ │ ├── types.cc
│ │ ├── types.h
│ │ ├── workspace.cc
│ │ ├── workspace.h
│ │ └── workspace_test.cc
│ ├── cuda_rtc/
│ │ ├── CMakeLists.txt
│ │ ├── common_rtc.h
│ │ ├── elemenntwise_rtc_gpu.cc
│ │ └── pool_op_rtc_gpu.cc
│ ├── db/
│ │ ├── CMakeLists.txt
│ │ ├── create_db_op.cc
│ │ ├── create_db_op.h
│ │ ├── create_db_op_gpu.cc
│ │ ├── db_test.cc
│ │ ├── leveldb.cc
│ │ ├── lmdb.cc
│ │ ├── protodb.cc
│ │ └── zmqdb.cc
│ ├── distributed/
│ │ ├── CMakeLists.txt
│ │ ├── file_store_handler.cc
│ │ ├── file_store_handler.h
│ │ ├── file_store_handler_op.cc
│ │ ├── file_store_handler_op.h
│ │ ├── file_store_handler_op_gpu.cc
│ │ ├── file_store_handler_op_test.py
│ │ ├── py_export.cc
│ │ ├── redis_store_handler.cc
│ │ ├── redis_store_handler.h
│ │ ├── redis_store_handler_op.cc
│ │ ├── redis_store_handler_op.h
│ │ ├── redis_store_handler_op_gpu.cc
│ │ ├── redis_store_handler_op_test.py
│ │ ├── store_handler.cc
│ │ ├── store_handler.h
│ │ ├── store_ops.cc
│ │ ├── store_ops.h
│ │ └── store_ops_test_util.py
│ ├── experiments/
│ │ ├── operators/
│ │ │ ├── fully_connected_op_decomposition.cc
│ │ │ ├── fully_connected_op_decomposition.h
│ │ │ ├── fully_connected_op_decomposition_gpu.cc
│ │ │ ├── fully_connected_op_prune.cc
│ │ │ ├── fully_connected_op_prune.h
│ │ │ ├── fully_connected_op_sparse.cc
│ │ │ ├── fully_connected_op_sparse.h
│ │ │ ├── funhash_op.cc
│ │ │ ├── funhash_op.h
│ │ │ ├── sparse_funhash_op.cc
│ │ │ ├── sparse_funhash_op.h
│ │ │ ├── sparse_matrix_reshape_op.cc
│ │ │ ├── sparse_matrix_reshape_op.h
│ │ │ ├── tt_contraction_op.cc
│ │ │ ├── tt_contraction_op.h
│ │ │ ├── tt_contraction_op_gpu.cc
│ │ │ ├── tt_pad_op.cc
│ │ │ └── tt_pad_op.h
│ │ └── python/
│ │ ├── SparseTransformer.py
│ │ ├── convnet_benchmarks.py
│ │ ├── device_reduce_sum_bench.py
│ │ ├── funhash_op_test.py
│ │ ├── net_construct_bench.py
│ │ ├── sparse_funhash_op_test.py
│ │ ├── sparse_reshape_op_test.py
│ │ ├── tt_contraction_op_test.py
│ │ └── tt_pad_op_test.py
│ ├── image/
│ │ ├── CMakeLists.txt
│ │ ├── image_input_op.cc
│ │ ├── image_input_op.h
│ │ ├── image_input_op_gpu.cc
│ │ ├── transform_gpu.cu
│ │ └── transform_gpu.h
│ ├── mkl/
│ │ ├── CMakeLists.txt
│ │ ├── mkl_operator.cc
│ │ ├── mkl_utils.h
│ │ ├── mkl_utils_test.cc
│ │ ├── mklmemory_serialization.cc
│ │ ├── mklmemory_serialization_test.cc
│ │ ├── operators/
│ │ │ ├── concat_op.cc
│ │ │ ├── conv_op.cc
│ │ │ ├── conv_op_mkldnn.cc
│ │ │ ├── elementwise_sum_op.cc
│ │ │ ├── fully_connected_op.cc
│ │ │ ├── local_response_normalization_op.cc
│ │ │ ├── operator_fallback_mkl.cc
│ │ │ ├── operator_fallback_mkl.h
│ │ │ ├── packed_fc_op.cc
│ │ │ ├── pool_op.cc
│ │ │ ├── relu_op.cc
│ │ │ ├── spatial_batch_norm_op.cc
│ │ │ ├── squeeze_op.cc
│ │ │ └── utility_ops.cc
│ │ └── utils/
│ │ ├── mkl_context.cc
│ │ ├── mkl_context.h
│ │ ├── mkl_dnn_cppwrapper.h
│ │ ├── mkl_memory.cc
│ │ ├── mkl_memory.h
│ │ ├── mkl_operator.h
│ │ ├── mkl_version_check.h
│ │ └── sgemm_pack.h
│ ├── mobile/
│ │ ├── CMakeLists.txt
│ │ └── contrib/
│ │ ├── CMakeLists.txt
│ │ ├── arm-compute/
│ │ │ ├── CMakeLists.txt
│ │ │ ├── README.md
│ │ │ ├── core/
│ │ │ │ ├── CMakeLists.txt
│ │ │ │ ├── context.cc
│ │ │ │ ├── context.h
│ │ │ │ ├── net_gl.cc
│ │ │ │ ├── net_gl.h
│ │ │ │ ├── operator.cc
│ │ │ │ ├── operator.h
│ │ │ │ ├── rewrite_net.cc
│ │ │ │ └── rewrite_net.h
│ │ │ ├── models/
│ │ │ │ ├── squeezenet_init.pb
│ │ │ │ └── squeezenet_predict.pb
│ │ │ ├── operators/
│ │ │ │ ├── CMakeLists.txt
│ │ │ │ ├── activation_ops.cc
│ │ │ │ ├── activation_ops.h
│ │ │ │ ├── concat_op.cc
│ │ │ │ ├── conv_op.cc
│ │ │ │ ├── copy_op.cc
│ │ │ │ ├── elementwise_sum_op.cc
│ │ │ │ ├── fully_connected_op.cc
│ │ │ │ ├── norm_planar_yuv_op.cc
│ │ │ │ ├── pool_op.cc
│ │ │ │ ├── reshape_op.cc
│ │ │ │ ├── resize_op.cc
│ │ │ │ ├── softmax_op.cc
│ │ │ │ └── spatial_batch_norm_op.cc
│ │ │ ├── run_tests.sh
│ │ │ └── test/
│ │ │ ├── CMakeLists.txt
│ │ │ ├── gl_activation_ops_test.cc
│ │ │ ├── gl_alignment_test.cc
│ │ │ ├── gl_concat_op_test.cc
│ │ │ ├── gl_context_test.cc
│ │ │ ├── gl_conv_op_test.cc
│ │ │ ├── gl_copy_op_test.cc
│ │ │ ├── gl_elementwise_sum_op_test.cc
│ │ │ ├── gl_fully_connected_op_test.cc
│ │ │ ├── gl_model_test.cc
│ │ │ ├── gl_model_test.h
│ │ │ ├── gl_norm_planar_yuv_op_test.cc
│ │ │ ├── gl_operator_test.h
│ │ │ ├── gl_pool_op_test.cc
│ │ │ ├── gl_resize_op_test.cc
│ │ │ ├── gl_softmax_op_test.cc
│ │ │ └── gl_spatial_batch_norm_op_test.cc
│ │ ├── ios/
│ │ │ ├── CMakeLists.txt
│ │ │ ├── ios_caffe.cc
│ │ │ ├── ios_caffe.h
│ │ │ ├── ios_caffe_defines.h
│ │ │ ├── ios_caffe_predictor.cc
│ │ │ ├── ios_caffe_predictor.h
│ │ │ ├── mpscnn/
│ │ │ │ ├── CMakeLists.txt
│ │ │ │ ├── MPSCNN.metal
│ │ │ │ ├── mpscnn.h
│ │ │ │ ├── mpscnn.mm
│ │ │ │ ├── mpscnn_context.h
│ │ │ │ ├── mpscnn_context.mm
│ │ │ │ ├── mpscnn_graph.mm
│ │ │ │ ├── mpscnn_graph_mask.h
│ │ │ │ ├── mpscnn_graph_mask.mm
│ │ │ │ ├── mpscnn_kernels.h
│ │ │ │ ├── mpscnn_test.h
│ │ │ │ └── mpscnn_test.mm
│ │ │ ├── pool_test.cc
│ │ │ └── resize_test.cc
│ │ ├── libopencl-stub/
│ │ │ ├── Android.mk
│ │ │ ├── LICENSE
│ │ │ ├── Makefile
│ │ │ ├── README.md
│ │ │ ├── include/
│ │ │ │ ├── CL/
│ │ │ │ │ ├── cl.h
│ │ │ │ │ ├── cl.hpp
│ │ │ │ │ ├── cl_ext.h
│ │ │ │ │ ├── cl_gl.h
│ │ │ │ │ ├── cl_gl_ext.h
│ │ │ │ │ ├── cl_platform.h
│ │ │ │ │ └── opencl.h
│ │ │ │ └── libopencl.h
│ │ │ └── src/
│ │ │ └── libopencl.c
│ │ ├── libvulkan-stub/
│ │ │ ├── include/
│ │ │ │ ├── libvulkan-stub.h
│ │ │ │ └── vulkan/
│ │ │ │ ├── vk_platform.h
│ │ │ │ └── vulkan.h
│ │ │ └── src/
│ │ │ └── libvulkan-stub.c
│ │ ├── nnapi/
│ │ │ ├── CMakeLists.txt
│ │ │ ├── NeuralNetworks.h
│ │ │ ├── dlnnapi.c
│ │ │ ├── dlnnapi.h
│ │ │ ├── nnapi.cc
│ │ │ ├── nnapi.h
│ │ │ ├── nnapi_benchmark.cc
│ │ │ └── nnapi_test.cc
│ │ ├── opengl/
│ │ │ ├── CMakeLists.txt
│ │ │ ├── android/
│ │ │ │ ├── AndroidGLContext.cc
│ │ │ │ ├── AndroidGLContext.h
│ │ │ │ ├── CMakeLists.txt
│ │ │ │ ├── GLContext.cc
│ │ │ │ ├── GLImageAllocator.cc
│ │ │ │ ├── arm_neon_support.h
│ │ │ │ ├── gl3stub.c
│ │ │ │ └── gl3stub.h
│ │ │ ├── core/
│ │ │ │ ├── CMakeLists.txt
│ │ │ │ ├── DataTransfer.cc
│ │ │ │ ├── DataTransfer.h
│ │ │ │ ├── GL.h
│ │ │ │ ├── GLContext.cc
│ │ │ │ ├── GLContext.h
│ │ │ │ ├── GLFilter.cc
│ │ │ │ ├── GLFilter.h
│ │ │ │ ├── GLImage.cc
│ │ │ │ ├── GLImage.h
│ │ │ │ ├── GLImageAllocator.cc
│ │ │ │ ├── GLImageAllocator.h
│ │ │ │ ├── GLLogging.h
│ │ │ │ ├── GLPBO.cc
│ │ │ │ ├── GLPBO.h
│ │ │ │ ├── GLPlainTexture.cc
│ │ │ │ ├── GLPlainTexture.h
│ │ │ │ ├── GLPredictor.cc
│ │ │ │ ├── GLPredictor.h
│ │ │ │ ├── GLTexture.cc
│ │ │ │ ├── GLTexture.h
│ │ │ │ ├── ImageAllocator.h
│ │ │ │ ├── arm_neon_support.h
│ │ │ │ ├── rewrite_net.cc
│ │ │ │ └── rewrite_net.h
│ │ │ ├── ios/
│ │ │ │ ├── CMakeLists.txt
│ │ │ │ ├── GLContext.cc
│ │ │ │ ├── GLImageAllocator.cc
│ │ │ │ ├── IOSGLContext.h
│ │ │ │ ├── IOSGLContext.mm
│ │ │ │ ├── IOSGLImageAllocator.cc
│ │ │ │ ├── IOSGLImageAllocator.h
│ │ │ │ ├── IOSGLTexture.h
│ │ │ │ └── IOSGLTexture.mm
│ │ │ ├── operators/
│ │ │ │ ├── CMakeLists.txt
│ │ │ │ ├── GLAdd.cc
│ │ │ │ ├── GLConcat.cc
│ │ │ │ ├── GLConvolution.cc
│ │ │ │ ├── GLConvolution.h
│ │ │ │ ├── GLCopyOps.cc
│ │ │ │ ├── GLInstanceNorm.cc
│ │ │ │ ├── GLMul.cc
│ │ │ │ ├── GLNormPlanarYUV.cc
│ │ │ │ ├── GLPRelu.cc
│ │ │ │ ├── GLPadImage.cc
│ │ │ │ ├── GLPool.cc
│ │ │ │ ├── GLResize.cc
│ │ │ │ ├── GLSigmoid.cc
│ │ │ │ ├── GLSoftmax.cc
│ │ │ │ ├── GLStylizer.cc
│ │ │ │ ├── GLSub.cc
│ │ │ │ └── gl_tiling_utils.h
│ │ │ └── test/
│ │ │ ├── TestGLConvolution.cc
│ │ │ ├── TestGLConvolution.h
│ │ │ ├── opengl_test.cc
│ │ │ └── opengl_test.h
│ │ ├── snpe/
│ │ │ ├── CMakeLists.txt
│ │ │ ├── README.md
│ │ │ ├── snpe_ffi.cc
│ │ │ ├── snpe_ffi.h
│ │ │ ├── snpe_globals.cc
│ │ │ ├── snpe_op.cc
│ │ │ └── snpe_op_benchmark.cc
│ │ └── ulp2/
│ │ ├── ulp.cc
│ │ ├── ulp.h
│ │ ├── ulp_neon.cc
│ │ ├── ulp_neon.h
│ │ └── ulp_test.cc
│ ├── mpi/
│ │ ├── CMakeLists.txt
│ │ ├── mpi_common.cc
│ │ ├── mpi_common.h
│ │ ├── mpi_gpu_test.cc
│ │ ├── mpi_ops.cc
│ │ ├── mpi_ops.h
│ │ ├── mpi_ops_gpu.cc
│ │ └── mpi_test.cc
│ ├── observers/
│ │ ├── CMakeLists.txt
│ │ ├── README.md
│ │ ├── operator_attaching_net_observer.h
│ │ ├── runcnt_observer.cc
│ │ ├── runcnt_observer.h
│ │ ├── time_observer.cc
│ │ ├── time_observer.h
│ │ └── time_observer_test.cc
│ ├── onnx/
│ │ ├── CMakeLists.txt
│ │ ├── backend.cc
│ │ ├── backend.h
│ │ ├── backend_rep.cc
│ │ ├── backend_rep.h
│ │ ├── device.cc
│ │ ├── device.h
│ │ ├── helper.cc
│ │ └── helper.h
│ ├── operators/
│ │ ├── CMakeLists.txt
│ │ ├── abs_op.cc
│ │ ├── abs_op.cu
│ │ ├── accumulate_op.cc
│ │ ├── accumulate_op.cu
│ │ ├── accumulate_op.h
│ │ ├── accuracy_op.cc
│ │ ├── accuracy_op.cu
│ │ ├── accuracy_op.h
│ │ ├── apmeter_op.cc
│ │ ├── apmeter_op.h
│ │ ├── assert_op.cc
│ │ ├── assert_op.cu
│ │ ├── assert_op.h
│ │ ├── atomic_ops.cc
│ │ ├── batch_box_cox_op.cc
│ │ ├── batch_box_cox_op.h
│ │ ├── batch_gather_ops.cc
│ │ ├── batch_gather_ops.cu
│ │ ├── batch_gather_ops.h
│ │ ├── batch_matmul_op.cc
│ │ ├── batch_matmul_op.cu
│ │ ├── batch_matmul_op.h
│ │ ├── batch_matmul_op_gpu_test.cc
│ │ ├── batch_matmul_op_test.cc
│ │ ├── batch_sparse_to_dense_op.cc
│ │ ├── batch_sparse_to_dense_op.h
│ │ ├── bbox_transform_op.cc
│ │ ├── bbox_transform_op.h
│ │ ├── boolean_mask_ops.cc
│ │ ├── boolean_mask_ops.cu
│ │ ├── boolean_mask_ops.h
│ │ ├── boolean_unmask_ops.cc
│ │ ├── boolean_unmask_ops.cu
│ │ ├── boolean_unmask_ops.h
│ │ ├── boolean_unmask_ops_test.cc
│ │ ├── box_with_nms_limit_op.cc
│ │ ├── box_with_nms_limit_op.h
│ │ ├── cast_op.cc
│ │ ├── cast_op.cu
│ │ ├── cast_op.h
│ │ ├── ceil_op.cc
│ │ ├── ceil_op.cu
│ │ ├── ceil_op.h
│ │ ├── channel_backprop_stats_op.cc
│ │ ├── channel_backprop_stats_op.h
│ │ ├── channel_shuffle_op.cc
│ │ ├── channel_shuffle_op.h
│ │ ├── channel_shuffle_op_gpu.cu
│ │ ├── channel_stats_op.cc
│ │ ├── channel_stats_op.cu
│ │ ├── channel_stats_op.h
│ │ ├── clip_op.cc
│ │ ├── clip_op.cu
│ │ ├── clip_op.h
│ │ ├── communicator_op.cc
│ │ ├── communicator_op_gpu.cc
│ │ ├── concat_split_op.cc
│ │ ├── concat_split_op.h
│ │ ├── concat_split_op_gpu.cc
│ │ ├── conditional_op.cc
│ │ ├── conditional_op.h
│ │ ├── conv_gradient_op.cc
│ │ ├── conv_op.cc
│ │ ├── conv_op.h
│ │ ├── conv_op_cache_cudnn.cc
│ │ ├── conv_op_cache_cudnn.h
│ │ ├── conv_op_cache_cudnn_test.cc
│ │ ├── conv_op_cudnn.cc
│ │ ├── conv_op_eigen.cc
│ │ ├── conv_op_gpu.cc
│ │ ├── conv_op_impl.h
│ │ ├── conv_op_shared.cc
│ │ ├── conv_op_shared.h
│ │ ├── conv_op_shared_gpu.cc
│ │ ├── conv_pool_op_base.h
│ │ ├── conv_transpose_gradient_op.cc
│ │ ├── conv_transpose_op.cc
│ │ ├── conv_transpose_op.h
│ │ ├── conv_transpose_op_cudnn.cc
│ │ ├── conv_transpose_op_gpu.cc
│ │ ├── conv_transpose_op_impl.h
│ │ ├── conv_transpose_op_mobile.cc
│ │ ├── conv_transpose_op_mobile.h
│ │ ├── conv_transpose_op_mobile_impl.h
│ │ ├── conv_transpose_op_mobile_test.cc
│ │ ├── conv_transpose_unpool_op_base.h
│ │ ├── cos_op.cc
│ │ ├── cos_op.cu
│ │ ├── cosine_embedding_criterion_op.cc
│ │ ├── cosine_embedding_criterion_op.cu
│ │ ├── cosine_embedding_criterion_op.h
│ │ ├── counter_ops.cc
│ │ ├── counter_ops.h
│ │ ├── counter_ops_gpu.cc
│ │ ├── create_scope_op.cc
│ │ ├── create_scope_op.h
│ │ ├── cross_entropy_op.cc
│ │ ├── cross_entropy_op.cu
│ │ ├── cross_entropy_op.h
│ │ ├── dataset_ops.cc
│ │ ├── dataset_ops.h
│ │ ├── deform_conv_gradient_op.cc
│ │ ├── deform_conv_op.cc
│ │ ├── deform_conv_op.cu
│ │ ├── deform_conv_op.h
│ │ ├── deform_conv_op_impl.h
│ │ ├── distance_op.cc
│ │ ├── distance_op.cu
│ │ ├── distance_op.h
│ │ ├── do_op.cc
│ │ ├── do_op.h
│ │ ├── do_op_gpu.cc
│ │ ├── dropout_op.cc
│ │ ├── dropout_op.cu
│ │ ├── dropout_op.h
│ │ ├── dropout_op_cudnn.cc
│ │ ├── elementwise_add_op.cc
│ │ ├── elementwise_div_op.cc
│ │ ├── elementwise_linear_op.cc
│ │ ├── elementwise_linear_op.cu
│ │ ├── elementwise_linear_op.h
│ │ ├── elementwise_logical_ops.cc
│ │ ├── elementwise_logical_ops.h
│ │ ├── elementwise_mul_op.cc
│ │ ├── elementwise_op.cc
│ │ ├── elementwise_op.cu
│ │ ├── elementwise_op.h
│ │ ├── elementwise_op_gpu_test.cc
│ │ ├── elementwise_op_schema.cc
│ │ ├── elementwise_op_test.cc
│ │ ├── elementwise_op_test.h
│ │ ├── elementwise_sub_op.cc
│ │ ├── elementwise_sum_op.cc
│ │ ├── elu_op.cc
│ │ ├── elu_op.cu
│ │ ├── elu_op.h
│ │ ├── exp_op.cc
│ │ ├── exp_op.cu
│ │ ├── expand_squeeze_dims_op.cc
│ │ ├── expand_squeeze_dims_op.h
│ │ ├── expand_squeeze_dims_op_gpu.cc
│ │ ├── extend_tensor_op.cc
│ │ ├── feed_blob_op.cc
│ │ ├── feed_blob_op.h
│ │ ├── filler_op.cc
│ │ ├── filler_op.cu
│ │ ├── filler_op.h
│ │ ├── filler_op_gpu.cc
│ │ ├── find_duplicate_elements_op.cc
│ │ ├── find_duplicate_elements_op.h
│ │ ├── find_op.cc
│ │ ├── find_op.cu
│ │ ├── find_op.h
│ │ ├── flatten_op.cc
│ │ ├── flatten_op.h
│ │ ├── flexible_top_k.cc
│ │ ├── flexible_top_k.h
│ │ ├── floor_op.cc
│ │ ├── floor_op.cu
│ │ ├── floor_op.h
│ │ ├── free_op.cc
│ │ ├── free_op.h
│ │ ├── free_op_gpu.cc
│ │ ├── fully_connected_op.cc
│ │ ├── fully_connected_op.h
│ │ ├── fully_connected_op_gpu.cc
│ │ ├── fused_rowwise_8bit_conversion_ops.cc
│ │ ├── fused_rowwise_8bit_conversion_ops.h
│ │ ├── gather_fused_8bit_rowwise_op.cc
│ │ ├── gather_fused_8bit_rowwise_op.h
│ │ ├── gather_ranges_to_dense_op.cc
│ │ ├── gather_ranges_to_dense_op.h
│ │ ├── generate_proposals_op.cc
│ │ ├── generate_proposals_op.h
│ │ ├── generate_proposals_op_test.cc
│ │ ├── generate_proposals_op_util_boxes.h
│ │ ├── generate_proposals_op_util_boxes_test.cc
│ │ ├── generate_proposals_op_util_nms.h
│ │ ├── generate_proposals_op_util_nms_test.cc
│ │ ├── given_tensor_fill_op.cc
│ │ ├── given_tensor_fill_op.cu
│ │ ├── given_tensor_fill_op.h
│ │ ├── glu_op.cc
│ │ ├── glu_op.cu
│ │ ├── glu_op.h
│ │ ├── gru_unit_op.cc
│ │ ├── gru_unit_op.h
│ │ ├── gru_unit_op_gpu.cu
│ │ ├── h_softmax_op.cc
│ │ ├── h_softmax_op.h
│ │ ├── half_float_ops.cc
│ │ ├── half_float_ops.cu
│ │ ├── half_float_ops.h
│ │ ├── if_op.cc
│ │ ├── if_op.h
│ │ ├── if_op_gpu.cc
│ │ ├── im2col_op.cc
│ │ ├── im2col_op.h
│ │ ├── im2col_op_gpu.cc
│ │ ├── index_hash_ops.cc
│ │ ├── index_hash_ops.h
│ │ ├── index_ops.cc
│ │ ├── instance_norm_gradient_op.cc
│ │ ├── instance_norm_op.cc
│ │ ├── instance_norm_op.cu
│ │ ├── instance_norm_op.h
│ │ ├── jsd_op.cc
│ │ ├── jsd_op.h
│ │ ├── key_split_ops.cc
│ │ ├── key_split_ops.h
│ │ ├── last_n_window_collector.cc
│ │ ├── layer_norm_op.cc
│ │ ├── layer_norm_op.cu
│ │ ├── layer_norm_op.h
│ │ ├── leaky_relu_op.cc
│ │ ├── leaky_relu_op.cu
│ │ ├── leaky_relu_op.h
│ │ ├── lengths_reducer_fused_8bit_rowwise_ops.cc
│ │ ├── lengths_reducer_fused_8bit_rowwise_ops.h
│ │ ├── lengths_reducer_ops.cc
│ │ ├── lengths_reducer_ops.h
│ │ ├── lengths_reducer_rowwise_8bit_ops.cc
│ │ ├── lengths_reducer_rowwise_8bit_ops.h
│ │ ├── lengths_tile_op.cc
│ │ ├── lengths_tile_op.h
│ │ ├── lengths_tile_op_gpu.cc
│ │ ├── lengths_top_k_op.cc
│ │ ├── lengths_top_k_op.h
│ │ ├── listwise_l2r_op.cc
│ │ ├── listwise_l2r_op.h
│ │ ├── load_save_op.cc
│ │ ├── load_save_op.h
│ │ ├── load_save_op_gpu.cc
│ │ ├── local_response_normalization_op.cc
│ │ ├── local_response_normalization_op.cu
│ │ ├── local_response_normalization_op.h
│ │ ├── local_response_normalization_op_cudnn.cc
│ │ ├── locally_connected_op.cc
│ │ ├── locally_connected_op.h
│ │ ├── locally_connected_op_gpu.cc
│ │ ├── locally_connected_op_impl.h
│ │ ├── locally_connected_op_util.cc
│ │ ├── locally_connected_op_util.h
│ │ ├── log_op.cc
│ │ ├── log_op.cu
│ │ ├── logit_op.cc
│ │ ├── logit_op.cu
│ │ ├── logit_op.h
│ │ ├── loss_op.cc
│ │ ├── loss_op.cu
│ │ ├── loss_op.h
│ │ ├── lp_pool_op.cc
│ │ ├── lp_pool_op.cu
│ │ ├── lpnorm_op.cc
│ │ ├── lpnorm_op.h
│ │ ├── lstm_unit_op.cc
│ │ ├── lstm_unit_op.h
│ │ ├── lstm_unit_op_gpu.cu
│ │ ├── map_ops.cc
│ │ ├── map_ops.h
│ │ ├── margin_ranking_criterion_op.cc
│ │ ├── margin_ranking_criterion_op.cu
│ │ ├── margin_ranking_criterion_op.h
│ │ ├── math_ops.cc
│ │ ├── math_ops.cu
│ │ ├── math_ops.h
│ │ ├── matmul_op.cc
│ │ ├── matmul_op.h
│ │ ├── matmul_op_gpu.cc
│ │ ├── max_pool_with_index.cu
│ │ ├── max_pool_with_index.h
│ │ ├── mean_op.cc
│ │ ├── mean_op.cu
│ │ ├── mean_op.h
│ │ ├── mem_query_op.cu
│ │ ├── merge_id_lists_op.cc
│ │ ├── merge_id_lists_op.h
│ │ ├── minmax_gradient_ops.cc
│ │ ├── minmax_ops.cc
│ │ ├── minmax_ops.h
│ │ ├── mod_op.cc
│ │ ├── mod_op.h
│ │ ├── multi_class_accuracy_op.cc
│ │ ├── multi_class_accuracy_op.cu
│ │ ├── multi_class_accuracy_op.h
│ │ ├── negate_gradient_op.cc
│ │ ├── negate_gradient_op.h
│ │ ├── negate_gradient_op_gpu.cc
│ │ ├── negative_op.cc
│ │ ├── negative_op.cu
│ │ ├── ngram_ops.cc
│ │ ├── ngram_ops.h
│ │ ├── no_default_engine_op.h
│ │ ├── norm_planar_yuv_op.cc
│ │ ├── normalize_l1_op.cc
│ │ ├── normalize_l1_op.h
│ │ ├── normalize_op.cc
│ │ ├── normalize_op.h
│ │ ├── normalize_ops.cu
│ │ ├── one_hot_ops.cc
│ │ ├── one_hot_ops.cu
│ │ ├── one_hot_ops.h
│ │ ├── onnx_while_op.cc
│ │ ├── onnx_while_op.h
│ │ ├── op_utils_cudnn.h
│ │ ├── operator_fallback_gpu.h
│ │ ├── operator_fallback_gpu_test.cc
│ │ ├── order_switch_ops.cc
│ │ ├── order_switch_ops.cu
│ │ ├── order_switch_ops.h
│ │ ├── pack_rnn_sequence_op.cc
│ │ ├── pack_rnn_sequence_op.h
│ │ ├── pack_segments.cc
│ │ ├── pack_segments.cu
│ │ ├── pack_segments.h
│ │ ├── pad_op.cc
│ │ ├── pad_op.h
│ │ ├── pad_op_gpu.cu
│ │ ├── partition_ops.cc
│ │ ├── partition_ops.h
│ │ ├── percentile_op.cc
│ │ ├── percentile_op.h
│ │ ├── perplexity_op.cc
│ │ ├── perplexity_op.cu
│ │ ├── perplexity_op.h
│ │ ├── piecewise_linear_transform_op.cc
│ │ ├── piecewise_linear_transform_op.cu
│ │ ├── piecewise_linear_transform_op.h
│ │ ├── pool_gradient_op.cc
│ │ ├── pool_op.cc
│ │ ├── pool_op.cu
│ │ ├── pool_op.h
│ │ ├── pool_op_cudnn.cu
│ │ ├── pow_op.cc
│ │ ├── pow_op.cu
│ │ ├── pow_op.h
│ │ ├── prefetch_op.h
│ │ ├── prelu_op.cc
│ │ ├── prelu_op.cu
│ │ ├── prelu_op.h
│ │ ├── prepend_dim_op.cc
│ │ ├── prepend_dim_op.h
│ │ ├── prepend_dim_op_gpu.cc
│ │ ├── quant_decode_op.cc
│ │ ├── quant_decode_op.h
│ │ ├── rank_loss_op.cc
│ │ ├── rank_loss_op.h
│ │ ├── recurrent_network_blob_fetcher_op.cc
│ │ ├── recurrent_network_blob_fetcher_op.h
│ │ ├── recurrent_network_blob_fetcher_op_gpu.cc
│ │ ├── recurrent_network_executor.cc
│ │ ├── recurrent_network_executor.h
│ │ ├── recurrent_network_executor_gpu.cc
│ │ ├── recurrent_network_executor_gpu.h
│ │ ├── recurrent_network_executor_incl.h
│ │ ├── recurrent_network_op.cc
│ │ ├── recurrent_network_op.h
│ │ ├── recurrent_network_op_gpu.cu
│ │ ├── recurrent_op_cudnn.cc
│ │ ├── recurrent_op_cudnn.h
│ │ ├── reduce_ops.cc
│ │ ├── reduce_ops.h
│ │ ├── reducer_functors.h
│ │ ├── reduction_front_back_ops.cc
│ │ ├── reduction_front_back_ops.cu
│ │ ├── reduction_front_back_ops.h
│ │ ├── reduction_ops.cc
│ │ ├── reduction_ops.cu
│ │ ├── reduction_ops.h
│ │ ├── relu_op.cc
│ │ ├── relu_op.cu
│ │ ├── relu_op.h
│ │ ├── relu_op_cudnn.cc
│ │ ├── relu_op_fp16.cu
│ │ ├── remove_data_blocks_op.cc
│ │ ├── remove_data_blocks_op.h
│ │ ├── replace_nan_op.cc
│ │ ├── replace_nan_op.cu
│ │ ├── replace_nan_op.h
│ │ ├── reservoir_sampling.cc
│ │ ├── reshape_op.cc
│ │ ├── reshape_op.h
│ │ ├── reshape_op_gpu.cc
│ │ ├── reshape_op_gpu_test.cc
│ │ ├── resize_op.cc
│ │ ├── resize_op.cu
│ │ ├── resize_op.h
│ │ ├── reverse_packed_segs_op.cc
│ │ ├── reverse_packed_segs_op.cu
│ │ ├── reverse_packed_segs_op.h
│ │ ├── rmac_regions_op.cc
│ │ ├── rmac_regions_op.cu
│ │ ├── rmac_regions_op.h
│ │ ├── roi_align_gradient_op.cc
│ │ ├── roi_align_gradient_op.cu
│ │ ├── roi_align_gradient_op.h
│ │ ├── roi_align_op.cc
│ │ ├── roi_align_op.cu
│ │ ├── roi_align_op.h
│ │ ├── roi_align_op_gpu_test.cc
│ │ ├── roi_pool_op.cc
│ │ ├── roi_pool_op.cu
│ │ ├── roi_pool_op.h
│ │ ├── rowmul_op.cc
│ │ ├── rowmul_op.h
│ │ ├── scale_op.cc
│ │ ├── scale_op.h
│ │ ├── scale_op_gpu.cc
│ │ ├── segment_reduction_op.cc
│ │ ├── segment_reduction_op.h
│ │ ├── segment_reduction_op_gpu.cu
│ │ ├── selu_op.cc
│ │ ├── selu_op.cu
│ │ ├── selu_op.h
│ │ ├── sequence_ops.cc
│ │ ├── sequence_ops.cu
│ │ ├── sequence_ops.h
│ │ ├── shape_op.cc
│ │ ├── shape_op.h
│ │ ├── shape_op_gpu.cc
│ │ ├── sigmoid_op.cc
│ │ ├── sigmoid_op.cu
│ │ ├── sin_op.cc
│ │ ├── sin_op.cu
│ │ ├── sinusoid_position_encoding_op.cc
│ │ ├── sinusoid_position_encoding_op.h
│ │ ├── slice_op.cc
│ │ ├── slice_op.cu
│ │ ├── slice_op.h
│ │ ├── softmax_op.cc
│ │ ├── softmax_op.h
│ │ ├── softmax_op_cudnn.cc
│ │ ├── softmax_ops.cu
│ │ ├── softmax_shared.cc
│ │ ├── softmax_shared.h
│ │ ├── softmax_with_loss_op.cc
│ │ ├── softmax_with_loss_op.h
│ │ ├── softplus_op.cc
│ │ ├── softplus_op.cu
│ │ ├── softplus_op.h
│ │ ├── softsign_op.cc
│ │ ├── softsign_op.cu
│ │ ├── space_batch_op.cc
│ │ ├── space_batch_op.h
│ │ ├── space_batch_op_gpu.cu
│ │ ├── sparse_normalize_op.cc
│ │ ├── sparse_normalize_op.h
│ │ ├── sparse_to_dense_mask_op.cc
│ │ ├── sparse_to_dense_mask_op.h
│ │ ├── sparse_to_dense_op.cc
│ │ ├── sparse_to_dense_op.cu
│ │ ├── sparse_to_dense_op.h
│ │ ├── spatial_batch_norm_gradient_op.cc
│ │ ├── spatial_batch_norm_op.cc
│ │ ├── spatial_batch_norm_op.h
│ │ ├── spatial_batch_norm_op_cudnn.cc
│ │ ├── spatial_softmax_with_loss_op.cc
│ │ ├── spatial_softmax_with_loss_op.h
│ │ ├── sqrt_op.cc
│ │ ├── sqrt_op.cu
│ │ ├── square_root_divide_op.cc
│ │ ├── square_root_divide_op.h
│ │ ├── stats_ops.cc
│ │ ├── stop_gradient.cc
│ │ ├── stop_gradient.h
│ │ ├── stop_gradient_gpu.cc
│ │ ├── string_ops.cc
│ │ ├── string_ops.h
│ │ ├── string_ops_test.cc
│ │ ├── stylizer_ops.cc
│ │ ├── summarize_op.cc
│ │ ├── summarize_op.cu
│ │ ├── summarize_op.h
│ │ ├── swish_op.cc
│ │ ├── swish_op.cu
│ │ ├── swish_op.h
│ │ ├── tanh_op.cc
│ │ ├── tanh_op.cu
│ │ ├── tensor_protos_db_input.cc
│ │ ├── tensor_protos_db_input.h
│ │ ├── tensor_protos_db_input_gpu.cc
│ │ ├── text_file_reader.cc
│ │ ├── text_file_reader_utils.cc
│ │ ├── text_file_reader_utils.h
│ │ ├── text_file_reader_utils_test.cc
│ │ ├── thresholded_relu_op.cc
│ │ ├── thresholded_relu_op.cu
│ │ ├── thresholded_relu_op.h
│ │ ├── tile_op.cc
│ │ ├── tile_op.cu
│ │ ├── tile_op.h
│ │ ├── top_k.cc
│ │ ├── top_k.cu
│ │ ├── top_k.h
│ │ ├── top_k_heap_selection.cuh
│ │ ├── top_k_radix_selection.cuh
│ │ ├── transpose_op.cc
│ │ ├── transpose_op.cu
│ │ ├── transpose_op.h
│ │ ├── transpose_op_cudnn.cc
│ │ ├── tt_linear_op.cc
│ │ ├── tt_linear_op.h
│ │ ├── utility_ops.cc
│ │ ├── utility_ops.cu
│ │ ├── utility_ops.h
│ │ ├── utility_ops_gpu.cc
│ │ ├── utility_ops_gpu_test.cc
│ │ ├── utility_ops_test.cc
│ │ ├── variable_length_sequence_padding.cc
│ │ ├── variable_length_sequence_padding.h
│ │ ├── weighted_sample_op.cc
│ │ ├── weighted_sample_op.cu
│ │ ├── weighted_sample_op.h
│ │ ├── while_op.cc
│ │ ├── while_op.h
│ │ ├── while_op_gpu.cc
│ │ ├── workspace_ops.cc
│ │ ├── zero_gradient_op.cc
│ │ ├── zero_gradient_op.h
│ │ └── zero_gradient_op_gpu.cc
│ ├── perfkernels/
│ │ ├── CMakeLists.txt
│ │ ├── common.h
│ │ ├── common_avx.cc
│ │ ├── common_avx2.cc
│ │ ├── cvtsh_ss_bugfix.h
│ │ ├── embedding_lookup.cc
│ │ ├── embedding_lookup.h
│ │ ├── embedding_lookup_avx2.cc
│ │ ├── embedding_lookup_fused_8bit_rowwise_avx2.cc
│ │ ├── fused_8bit_rowwise_embedding_lookup.cc
│ │ ├── fused_8bit_rowwise_embedding_lookup.h
│ │ ├── hp_emblookup_codegen.py
│ │ ├── typed_axpy.cc
│ │ ├── typed_axpy.h
│ │ ├── typed_axpy_avx.cc
│ │ └── typed_axpy_avx2.cc
│ ├── proto/
│ │ ├── CMakeLists.txt
│ │ ├── __init__.py
│ │ ├── caffe2.proto
│ │ ├── caffe2_legacy.proto
│ │ ├── hsm.proto
│ │ ├── metanet.proto
│ │ ├── predictor_consts.proto
│ │ └── prof_dag.proto
│ ├── python/
│ │ ├── CMakeLists.txt
│ │ ├── __init__.py
│ │ ├── _import_c_extension.py
│ │ ├── allcompare_test.py
│ │ ├── attention.py
│ │ ├── benchmark_generator.py
│ │ ├── binarysize.py
│ │ ├── brew.py
│ │ ├── brew_test.py
│ │ ├── build.py
│ │ ├── cached_reader.py
│ │ ├── caffe_translator.py
│ │ ├── caffe_translator_test.py
│ │ ├── checkpoint.py
│ │ ├── checkpoint_test.py
│ │ ├── cnn.py
│ │ ├── context.py
│ │ ├── context_test.py
│ │ ├── control.py
│ │ ├── control_ops_grad.py
│ │ ├── control_ops_util.py
│ │ ├── control_test.py
│ │ ├── convnet_benchmarks.py
│ │ ├── convnet_benchmarks_test.py
│ │ ├── core.py
│ │ ├── core_gradients_test.py
│ │ ├── core_test.py
│ │ ├── crf.py
│ │ ├── data_parallel_model.py
│ │ ├── data_parallel_model_test.py
│ │ ├── data_parallel_model_utils.py
│ │ ├── data_workers.py
│ │ ├── data_workers_test.py
│ │ ├── dataio.py
│ │ ├── dataio_test.py
│ │ ├── dataset.py
│ │ ├── db_test.py
│ │ ├── device_checker.py
│ │ ├── dlpack.h
│ │ ├── docs/
│ │ │ ├── formatter.py
│ │ │ ├── generator.py
│ │ │ ├── github.py
│ │ │ └── parser.py
│ │ ├── dyndep.py
│ │ ├── embedding_generation_benchmark.py
│ │ ├── examples/
│ │ │ ├── char_rnn.py
│ │ │ ├── lmdb_create_example.py
│ │ │ └── resnet50_trainer.py
│ │ ├── experiment_util.py
│ │ ├── extension_loader.py
│ │ ├── functional.py
│ │ ├── functional_test.py
│ │ ├── fused_8bit_rowwise_conversion_ops_test.py
│ │ ├── gradient_check_test.py
│ │ ├── gradient_checker.py
│ │ ├── gru_cell.py
│ │ ├── helpers/
│ │ │ ├── __init__.py
│ │ │ ├── algebra.py
│ │ │ ├── arg_scope.py
│ │ │ ├── array_helpers.py
│ │ │ ├── control_ops.py
│ │ │ ├── conv.py
│ │ │ ├── db_input.py
│ │ │ ├── dropout.py
│ │ │ ├── elementwise_linear.py
│ │ │ ├── fc.py
│ │ │ ├── nonlinearity.py
│ │ │ ├── normalization.py
│ │ │ ├── pooling.py
│ │ │ ├── tools.py
│ │ │ └── train.py
│ │ ├── hsm_util.py
│ │ ├── hypothesis_test.py
│ │ ├── hypothesis_test_util.py
│ │ ├── layer_model_helper.py
│ │ ├── layer_model_instantiator.py
│ │ ├── layer_parameter_sharing_test.py
│ │ ├── layer_test_util.py
│ │ ├── layers/
│ │ │ ├── __init__.py
│ │ │ ├── add_bias.py
│ │ │ ├── arc_cosine_feature_map.py
│ │ │ ├── batch_distill_lr_loss.py
│ │ │ ├── batch_lr_loss.py
│ │ │ ├── batch_mse_loss.py
│ │ │ ├── batch_normalization.py
│ │ │ ├── batch_sigmoid_cross_entropy_loss.py
│ │ │ ├── batch_softmax_loss.py
│ │ │ ├── concat.py
│ │ │ ├── conv.py
│ │ │ ├── dropout.py
│ │ │ ├── fc.py
│ │ │ ├── fc_without_bias.py
│ │ │ ├── feature_sparse_to_dense.py
│ │ │ ├── functional.py
│ │ │ ├── gather_record.py
│ │ │ ├── last_n_window_collector.py
│ │ │ ├── layers.py
│ │ │ ├── margin_rank_loss.py
│ │ │ ├── merge_id_lists.py
│ │ │ ├── pairwise_dot_product.py
│ │ │ ├── position_weighted.py
│ │ │ ├── random_fourier_features.py
│ │ │ ├── reservoir_sampling.py
│ │ │ ├── sampling_train.py
│ │ │ ├── sampling_trainable_mixin.py
│ │ │ ├── select_record_by_context.py
│ │ │ ├── semi_random_features.py
│ │ │ ├── sparse_feature_hash.py
│ │ │ ├── sparse_lookup.py
│ │ │ ├── split.py
│ │ │ ├── tags.py
│ │ │ └── uniform_sampling.py
│ │ ├── layers_test.py
│ │ ├── lengths_reducer_fused_8bit_rowwise_ops_test.py
│ │ ├── lengths_reducer_rowwise_8bit_ops_test.py
│ │ ├── lstm_benchmark.py
│ │ ├── memonger.py
│ │ ├── memonger_test.py
│ │ ├── mint/
│ │ │ ├── app.py
│ │ │ ├── static/
│ │ │ │ └── css/
│ │ │ │ └── simple-sidebar.css
│ │ │ └── templates/
│ │ │ └── index.html
│ │ ├── mkl/
│ │ │ ├── convnet_benchmarks.py
│ │ │ ├── mkl_LRN_op_test.py
│ │ │ ├── mkl_LRN_speed_test.py
│ │ │ ├── mkl_concat_op_test.py
│ │ │ ├── mkl_conv_op_test.py
│ │ │ ├── mkl_copy_op_test.py
│ │ │ ├── mkl_elementwise_add_op_test.py
│ │ │ ├── mkl_elementwise_sum_op_test.py
│ │ │ ├── mkl_fc_op_test.py
│ │ │ ├── mkl_fc_speed_test.py
│ │ │ ├── mkl_fill_op_test.py
│ │ │ ├── mkl_pool_op_test.py
│ │ │ ├── mkl_pool_speed_test.py
│ │ │ ├── mkl_relu_op_test.py
│ │ │ ├── mkl_sbn_op_test.py
│ │ │ ├── mkl_sbn_speed_test.py
│ │ │ ├── mkl_sigmoid_op_test.py
│ │ │ ├── mkl_speed_test.py
│ │ │ ├── mkl_squeeze_op_test.py
│ │ │ ├── rewrite_graph.py
│ │ │ └── rewrite_graph_test.py
│ │ ├── mkl_test_util.py
│ │ ├── model_device_test.py
│ │ ├── model_helper.py
│ │ ├── modeling/
│ │ │ ├── __init__.py
│ │ │ ├── compute_norm_for_blobs.py
│ │ │ ├── compute_norm_for_blobs_test.py
│ │ │ ├── compute_statistics_for_blobs.py
│ │ │ ├── compute_statistics_for_blobs_test.py
│ │ │ ├── initializers.py
│ │ │ ├── initializers_test.py
│ │ │ ├── net_modifier.py
│ │ │ ├── parameter_info.py
│ │ │ ├── parameter_sharing.py
│ │ │ └── parameter_sharing_test.py
│ │ ├── models/
│ │ │ ├── __init__.py
│ │ │ ├── __sym_init__.py
│ │ │ ├── download.py
│ │ │ ├── resnet.py
│ │ │ ├── resnet_test.py
│ │ │ └── seq2seq/
│ │ │ ├── __init__.py
│ │ │ ├── beam_search.py
│ │ │ ├── seq2seq_beam_search_test.py
│ │ │ ├── seq2seq_model_helper.py
│ │ │ ├── seq2seq_model_helper_test.py
│ │ │ ├── seq2seq_util.py
│ │ │ ├── train.py
│ │ │ └── translate.py
│ │ ├── modifier_context.py
│ │ ├── mpi_python.cc
│ │ ├── muji.py
│ │ ├── muji_test.py
│ │ ├── net_builder.py
│ │ ├── net_builder_test.py
│ │ ├── net_drawer.py
│ │ ├── net_printer.py
│ │ ├── net_printer_test.py
│ │ ├── numa_benchmark.py
│ │ ├── numa_test.py
│ │ ├── observer_test.py
│ │ ├── onnx/
│ │ │ ├── ONNXOpCoverage.md
│ │ │ ├── README.md
│ │ │ ├── __init__.py
│ │ │ ├── backend.py
│ │ │ ├── backend_cpp_rep.py
│ │ │ ├── backend_rep.py
│ │ │ ├── bin/
│ │ │ │ ├── __init__.py
│ │ │ │ └── conversion.py
│ │ │ ├── error.py
│ │ │ ├── frontend.py
│ │ │ ├── helper.py
│ │ │ ├── tests/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── c2_ref_test.py
│ │ │ │ ├── conversion_test.py
│ │ │ │ ├── helper_test.py
│ │ │ │ ├── onnx_backend_test.py
│ │ │ │ ├── optimize_onnx_test.py
│ │ │ │ ├── ssa_test.py
│ │ │ │ └── test_utils.py
│ │ │ └── workspace.py
│ │ ├── operator_test/
│ │ │ ├── activation_ops_test.py
│ │ │ ├── adagrad_test.py
│ │ │ ├── adam_test.py
│ │ │ ├── apmeter_test.py
│ │ │ ├── assert_test.py
│ │ │ ├── atomic_ops_test.py
│ │ │ ├── basic_rnn_test.py
│ │ │ ├── batch_box_cox_test.py
│ │ │ ├── batch_sparse_to_dense_op_test.py
│ │ │ ├── bbox_transform_test.py
│ │ │ ├── blobs_queue_db_test.py
│ │ │ ├── boolean_mask_test.py
│ │ │ ├── boolean_unmask_test.py
│ │ │ ├── cast_op_test.py
│ │ │ ├── ceil_op_test.py
│ │ │ ├── channel_backprop_stats_op_test.py
│ │ │ ├── channel_shuffle_test.py
│ │ │ ├── channel_stats_op_test.py
│ │ │ ├── checkpoint_test.py
│ │ │ ├── clip_op_test.py
│ │ │ ├── clip_tensor_op_test.py
│ │ │ ├── concat_split_op_test.py
│ │ │ ├── conditional_test.py
│ │ │ ├── conv_test.py
│ │ │ ├── conv_transpose_test.py
│ │ │ ├── copy_ops_test.py
│ │ │ ├── cosine_embedding_criterion_op_test.py
│ │ │ ├── counter_ops_test.py
│ │ │ ├── crf_test.py
│ │ │ ├── cross_entropy_ops_test.py
│ │ │ ├── cudnn_recurrent_test.py
│ │ │ ├── dataset_ops_test.py
│ │ │ ├── deform_conv_test.py
│ │ │ ├── distance_op_test.py
│ │ │ ├── dropout_op_test.py
│ │ │ ├── duplicate_operands_test.py
│ │ │ ├── elementwise_linear_op_test.py
│ │ │ ├── elementwise_logical_ops_test.py
│ │ │ ├── elementwise_op_broadcast_test.py
│ │ │ ├── elementwise_ops_test.py
│ │ │ ├── emptysample_ops_test.py
│ │ │ ├── extend_tensor_op_test.py
│ │ │ ├── fc_operator_test.py
│ │ │ ├── filler_ops_test.py
│ │ │ ├── find_op_test.py
│ │ │ ├── flatten_op_test.py
│ │ │ ├── flexible_top_k_test.py
│ │ │ ├── floor_op_test.py
│ │ │ ├── gather_ops_test.py
│ │ │ ├── gather_ranges_op_test.py
│ │ │ ├── given_tensor_fill_op_test.py
│ │ │ ├── glu_op_test.py
│ │ │ ├── group_conv_test.py
│ │ │ ├── gru_test.py
│ │ │ ├── hsm_test.py
│ │ │ ├── im2col_col2im_test.py
│ │ │ ├── image_input_op_test.py
│ │ │ ├── index_hash_ops_test.py
│ │ │ ├── index_ops_test.py
│ │ │ ├── instance_norm_test.py
│ │ │ ├── jsd_ops_test.py
│ │ │ ├── key_split_ops_test.py
│ │ │ ├── lars_test.py
│ │ │ ├── layer_norm_op_test.py
│ │ │ ├── lc_operator_test.py
│ │ │ ├── leaky_relu_test.py
│ │ │ ├── learning_rate_op_test.py
│ │ │ ├── lengths_tile_op_test.py
│ │ │ ├── lengths_top_k_ops_test.py
│ │ │ ├── listwise_l2r_operator_test.py
│ │ │ ├── load_save_test.py
│ │ │ ├── loss_ops_test.py
│ │ │ ├── lpnorm_op_test.py
│ │ │ ├── map_ops_test.py
│ │ │ ├── margin_ranking_criterion_op_test.py
│ │ │ ├── math_ops_test.py
│ │ │ ├── matmul_op_test.py
│ │ │ ├── mean_op_test.py
│ │ │ ├── merge_id_lists_op_test.py
│ │ │ ├── mkl_conv_op_test.py
│ │ │ ├── mkl_packed_fc_op_test.py
│ │ │ ├── mkl_speed_test.py
│ │ │ ├── mod_op_test.py
│ │ │ ├── momentum_sgd_test.py
│ │ │ ├── mpi_test.py
│ │ │ ├── negate_gradient_op_test.py
│ │ │ ├── ngram_ops_test.py
│ │ │ ├── normalize_op_test.py
│ │ │ ├── one_hot_ops_test.py
│ │ │ ├── onnx_while_test.py
│ │ │ ├── pack_ops_test.py
│ │ │ ├── pack_rnn_sequence_op_test.py
│ │ │ ├── pad_test.py
│ │ │ ├── partition_ops_test.py
│ │ │ ├── percentile_op_test.py
│ │ │ ├── piecewise_linear_transform_test.py
│ │ │ ├── pooling_test.py
│ │ │ ├── prepend_dim_test.py
│ │ │ ├── python_op_test.py
│ │ │ ├── rank_loss_operator_test.py
│ │ │ ├── rebatching_queue_test.py
│ │ │ ├── record_queue_test.py
│ │ │ ├── recurrent_net_executor_test.py
│ │ │ ├── recurrent_network_test.py
│ │ │ ├── reduce_ops_test.py
│ │ │ ├── reduction_ops_test.py
│ │ │ ├── relu_op_test.py
│ │ │ ├── reshape_ops_test.py
│ │ │ ├── resize_op_test.py
│ │ │ ├── rmac_regions_op_test.py
│ │ │ ├── rnn_cell_test.py
│ │ │ ├── segment_ops_test.py
│ │ │ ├── selu_op_test.py
│ │ │ ├── sequence_ops_test.py
│ │ │ ├── shape_inference_test.py
│ │ │ ├── sinusoid_position_encoding_op_test.py
│ │ │ ├── softmax_ops_test.py
│ │ │ ├── softplus_op_test.py
│ │ │ ├── sparse_gradient_checker_test.py
│ │ │ ├── sparse_lengths_sum_benchmark.py
│ │ │ ├── sparse_normalize_test.py
│ │ │ ├── sparse_ops_test.py
│ │ │ ├── sparse_to_dense_mask_op_test.py
│ │ │ ├── spatial_bn_op_test.py
│ │ │ ├── specialized_segment_ops_test.py
│ │ │ ├── square_root_divide_op_test.py
│ │ │ ├── stats_ops_test.py
│ │ │ ├── string_ops_test.py
│ │ │ ├── text_file_reader_test.py
│ │ │ ├── thresholded_relu_op_test.py
│ │ │ ├── tile_op_test.py
│ │ │ ├── top_k_test.py
│ │ │ ├── unique_uniform_fill_op_test.py
│ │ │ ├── utility_ops_test.py
│ │ │ ├── video_input_op_test.py
│ │ │ ├── weighted_sample_test.py
│ │ │ └── weighted_sum_test.py
│ │ ├── optimizer.py
│ │ ├── optimizer_context.py
│ │ ├── optimizer_test.py
│ │ ├── optimizer_test_util.py
│ │ ├── parallel_workers.py
│ │ ├── parallel_workers_test.py
│ │ ├── parallelize_bmuf_distributed_test.py
│ │ ├── pipeline.py
│ │ ├── pipeline_test.py
│ │ ├── predictor/
│ │ │ ├── __init__.py
│ │ │ ├── mobile_exporter.py
│ │ │ ├── mobile_exporter_test.py
│ │ │ ├── predictor_exporter.py
│ │ │ ├── predictor_exporter_test.py
│ │ │ ├── predictor_py_utils.py
│ │ │ ├── predictor_test.py
│ │ │ └── serde.py
│ │ ├── predictor_constants.py
│ │ ├── pybind_state.cc
│ │ ├── pybind_state.h
│ │ ├── pybind_state_dlpack.cc
│ │ ├── pybind_state_dlpack.h
│ │ ├── pybind_state_gpu.cc
│ │ ├── pybind_state_mkl.cc
│ │ ├── python_op_test.py
│ │ ├── queue_util.py
│ │ ├── record_queue.py
│ │ ├── recurrent.py
│ │ ├── regularizer.py
│ │ ├── regularizer_context.py
│ │ ├── regularizer_test.py
│ │ ├── rnn/
│ │ │ ├── lstm_comparison.py
│ │ │ └── rnn_cell_test_util.py
│ │ ├── rnn_cell.py
│ │ ├── schema.py
│ │ ├── schema_test.py
│ │ ├── scope.py
│ │ ├── scope_test.py
│ │ ├── session.py
│ │ ├── session_test.py
│ │ ├── sparse_to_dense_mask_test.py
│ │ ├── sparse_to_dense_test.py
│ │ ├── task.py
│ │ ├── test/
│ │ │ ├── blob_deallocation_test.py
│ │ │ ├── do_op_test.py
│ │ │ ├── executor_test.py
│ │ │ └── executor_test_util.py
│ │ ├── test_util.py
│ │ ├── text_file_reader.py
│ │ ├── timeout_guard.py
│ │ ├── toy_regression_test.py
│ │ ├── tt_core.py
│ │ ├── tt_core_test.py
│ │ ├── tutorials/
│ │ │ ├── Basics.ipynb
│ │ │ ├── Control_Ops.ipynb
│ │ │ ├── Getting_Caffe1_Models_for_Translation.ipynb
│ │ │ ├── Image_Pre-Processing_Pipeline.ipynb
│ │ │ ├── Loading_Pretrained_Models.ipynb
│ │ │ ├── MNIST.ipynb
│ │ │ ├── MNIST_Dataset_and_Databases.ipynb
│ │ │ ├── Model_Quickload.ipynb
│ │ │ ├── Multi-GPU_Training.ipynb
│ │ │ ├── Python_Op.ipynb
│ │ │ ├── README.md
│ │ │ ├── Toy_Regression.ipynb
│ │ │ ├── Training_a_Model.ipynb
│ │ │ ├── create_your_own_dataset.ipynb
│ │ │ ├── experimental/
│ │ │ │ └── Immediate.ipynb
│ │ │ ├── helpers.py
│ │ │ ├── inference_codes.txt
│ │ │ ├── jupyter_notebook_config.py
│ │ │ ├── py_gen/
│ │ │ │ ├── Basics.py
│ │ │ │ ├── Control_Ops.py
│ │ │ │ ├── Getting_Caffe1_Models_for_Translation.py
│ │ │ │ ├── Image_Pre-Processing_Pipeline.py
│ │ │ │ ├── Loading_Pretrained_Models.py
│ │ │ │ ├── MNIST.py
│ │ │ │ ├── MNIST_Dataset_and_Databases.py
│ │ │ │ ├── Model_Quickload.py
│ │ │ │ ├── Multi-GPU_Training.py
│ │ │ │ ├── Python_Op.py
│ │ │ │ ├── Toy_Regression.py
│ │ │ │ ├── Training_a_Model.py
│ │ │ │ ├── create_your_own_dataset.py
│ │ │ │ └── sparseNN.py
│ │ │ ├── start_ipython_notebook.sh
│ │ │ └── tutorials_to_script_converter.py
│ │ ├── utils.py
│ │ ├── visualize.py
│ │ ├── workspace.py
│ │ └── workspace_test.py
│ ├── queue/
│ │ ├── CMakeLists.txt
│ │ ├── blobs_queue.cc
│ │ ├── blobs_queue.h
│ │ ├── blobs_queue_db.cc
│ │ ├── blobs_queue_db.h
│ │ ├── queue_ops.cc
│ │ ├── queue_ops.h
│ │ ├── queue_ops_gpu.cc
│ │ ├── rebatching_queue.cc
│ │ ├── rebatching_queue.h
│ │ ├── rebatching_queue_ops.cc
│ │ └── rebatching_queue_ops.h
│ ├── sgd/
│ │ ├── CMakeLists.txt
│ │ ├── adagrad_op.cc
│ │ ├── adagrad_op.h
│ │ ├── adagrad_op_gpu.cu
│ │ ├── adam_op.cc
│ │ ├── adam_op.h
│ │ ├── adam_op_gpu.cu
│ │ ├── clip_tensor_op.cc
│ │ ├── clip_tensor_op.h
│ │ ├── fp16_momentum_sgd_op.cu
│ │ ├── fp16_momentum_sgd_op.h
│ │ ├── fp32_momentum_sgd_op.cu
│ │ ├── fp32_momentum_sgd_op.h
│ │ ├── ftrl_op.cc
│ │ ├── ftrl_op.h
│ │ ├── iter_op.cc
│ │ ├── iter_op.h
│ │ ├── iter_op_gpu.cc
│ │ ├── lars_op.cc
│ │ ├── lars_op.h
│ │ ├── lars_op_gpu.cu
│ │ ├── learning_rate_functors.h
│ │ ├── learning_rate_op.cc
│ │ ├── learning_rate_op.h
│ │ ├── learning_rate_op_gpu.cc
│ │ ├── momentum_sgd_op.cc
│ │ ├── momentum_sgd_op.h
│ │ ├── momentum_sgd_op_gpu.cu
│ │ ├── rmsprop_op.cc
│ │ ├── rmsprop_op.h
│ │ ├── rmsprop_op_gpu.cu
│ │ ├── yellowfin_op.cc
│ │ ├── yellowfin_op.h
│ │ └── yellowfin_op_gpu.cu
│ ├── share/
│ │ ├── CMakeLists.txt
│ │ └── contrib/
│ │ ├── CMakeLists.txt
│ │ ├── nnpack/
│ │ │ ├── CMakeLists.txt
│ │ │ ├── conv_op.cc
│ │ │ └── conv_op_test.cc
│ │ └── zstd/
│ │ ├── CMakeLists.txt
│ │ ├── quant_decomp_zstd_op.cc
│ │ └── quant_decomp_zstd_op.h
│ ├── test/
│ │ ├── assets/
│ │ │ └── squeeze_predict_net.pb
│ │ └── caffe2_gtest_main.cc
│ ├── transforms/
│ │ ├── CMakeLists.txt
│ │ ├── common_subexpression_elimination.cc
│ │ ├── common_subexpression_elimination.h
│ │ ├── common_subexpression_elimination_test.cc
│ │ ├── conv_to_nnpack_transform.cc
│ │ ├── conv_to_nnpack_transform.h
│ │ ├── conv_to_nnpack_transform_test.cc
│ │ ├── pattern_net_transform.cc
│ │ ├── pattern_net_transform.h
│ │ ├── pattern_net_transform_test.cc
│ │ ├── single_op_transform.cc
│ │ └── single_op_transform.h
│ ├── utils/
│ │ ├── CMakeLists.txt
│ │ ├── GpuBitonicSort.cuh
│ │ ├── GpuDefs.cuh
│ │ ├── GpuScanUtils.cuh
│ │ ├── cast.h
│ │ ├── cblas.h
│ │ ├── conversions.h
│ │ ├── cpu_neon.h
│ │ ├── cpuid.cc
│ │ ├── cpuid.h
│ │ ├── cpuid_test.cc
│ │ ├── eigen_utils.h
│ │ ├── fatal_signal_asan_no_sig_test.cc
│ │ ├── fixed_divisor.h
│ │ ├── fixed_divisor_test.cc
│ │ ├── math-detail.h
│ │ ├── math.h
│ │ ├── math_cpu.cc
│ │ ├── math_gpu.cu
│ │ ├── math_gpu_test.cc
│ │ ├── math_test.cc
│ │ ├── mixed_utils.h
│ │ ├── murmur_hash3.cc
│ │ ├── murmur_hash3.h
│ │ ├── proto_utils.cc
│ │ ├── proto_utils.h
│ │ ├── proto_utils_test.cc
│ │ ├── signal_handler.cc
│ │ ├── signal_handler.h
│ │ ├── simple_queue.h
│ │ ├── simple_queue_test.cc
│ │ ├── smart_tensor_printer.cc
│ │ ├── smart_tensor_printer.h
│ │ ├── smart_tensor_printer_test.cc
│ │ ├── string_utils.cc
│ │ ├── string_utils.h
│ │ ├── thread_pool.h
│ │ ├── threadpool/
│ │ │ ├── ThreadPool.cc
│ │ │ ├── ThreadPool.h
│ │ │ ├── ThreadPoolCommon.h
│ │ │ ├── WorkersPool.h
│ │ │ ├── pthreadpool.cc
│ │ │ ├── pthreadpool.h
│ │ │ ├── pthreadpool_impl.cc
│ │ │ └── pthreadpool_impl.h
│ │ └── zmq_helper.h
│ └── video/
│ ├── CMakeLists.txt
│ ├── optical_flow.cc
│ ├── optical_flow.h
│ ├── video_decoder.cc
│ ├── video_decoder.h
│ ├── video_input_op.cc
│ ├── video_input_op.h
│ ├── video_input_op_gpu.cc
│ ├── video_io.cc
│ └── video_io.h
├── cmake/
│ ├── BuildVariables.cmake
│ ├── Caffe2Config.cmake.in
│ ├── Caffe2ConfigVersion.cmake.in
│ ├── Dependencies.cmake
│ ├── External/
│ │ ├── nccl.cmake
│ │ └── nnpack.cmake
│ ├── MiscCheck.cmake
│ ├── Modules/
│ │ ├── FindAtlas.cmake
│ │ ├── FindBenchmark.cmake
│ │ ├── FindCUB.cmake
│ │ ├── FindFFmpeg.cmake
│ │ ├── FindGloo.cmake
│ │ ├── FindHiredis.cmake
│ │ ├── FindLAPACK.cmake
│ │ ├── FindLMDB.cmake
│ │ ├── FindLevelDB.cmake
│ │ ├── FindMKL.cmake
│ │ ├── FindMatlabMex.cmake
│ │ ├── FindNCCL.cmake
│ │ ├── FindNNPACK.cmake
│ │ ├── FindNumPy.cmake
│ │ ├── FindNuma.cmake
│ │ ├── FindOpenBLAS.cmake
│ │ ├── FindRocksDB.cmake
│ │ ├── FindSnappy.cmake
│ │ ├── FindZMQ.cmake
│ │ ├── Findpybind11.cmake
│ │ └── FindvecLib.cmake
│ ├── Modules_CUDA_fix/
│ │ ├── FindCUDA/
│ │ │ ├── make2cmake.cmake
│ │ │ ├── parse_cubin.cmake
│ │ │ ├── run_nvcc.cmake
│ │ │ └── select_compute_arch.cmake
│ │ ├── FindCUDA.cmake
│ │ ├── FindPackageHandleStandardArgs.cmake
│ │ ├── FindPackageMessage.cmake
│ │ └── README.txt
│ ├── ProtoBuf.cmake
│ ├── Summary.cmake
│ ├── Utils.cmake
│ ├── Whitelist.cmake
│ ├── cmake_uninstall.cmake.in
│ └── public/
│ ├── cuda.cmake
│ ├── gflags.cmake
│ ├── glog.cmake
│ ├── protobuf.cmake
│ ├── threads.cmake
│ └── utils.cmake
├── conda/
│ ├── cuda/
│ │ ├── build.sh
│ │ ├── conda_build_config.yaml
│ │ └── meta.yaml
│ ├── cuda_full/
│ │ ├── build.sh
│ │ ├── conda_build_config.yaml
│ │ └── meta.yaml
│ └── no_cuda/
│ ├── build.sh
│ ├── conda_build_config.yaml
│ └── meta.yaml
├── docker/
│ ├── jenkins/
│ │ ├── README.md
│ │ ├── build.sh
│ │ ├── centos/
│ │ │ ├── .gitignore
│ │ │ └── Dockerfile
│ │ ├── centos-cuda/
│ │ │ ├── .gitignore
│ │ │ └── Dockerfile
│ │ ├── common/
│ │ │ ├── add_jenkins_user.sh
│ │ │ ├── install_anaconda.sh
│ │ │ ├── install_android.sh
│ │ │ ├── install_base.sh
│ │ │ ├── install_ccache.sh
│ │ │ ├── install_clang.sh
│ │ │ ├── install_cmake.sh
│ │ │ ├── install_cuda.sh
│ │ │ ├── install_gcc.sh
│ │ │ ├── install_mkl.sh
│ │ │ ├── install_nccl.sh
│ │ │ └── install_python.sh
│ │ ├── ubuntu/
│ │ │ ├── .gitignore
│ │ │ └── Dockerfile
│ │ └── ubuntu-cuda/
│ │ ├── .gitignore
│ │ └── Dockerfile
│ ├── readme.md
│ ├── ubuntu-14.04-cpu-all-options/
│ │ └── Dockerfile
│ ├── ubuntu-14.04-cpu-minimal/
│ │ └── Dockerfile
│ ├── ubuntu-16.04-cpu-all-options/
│ │ └── Dockerfile
│ ├── ubuntu-16.04-cpu-minimal/
│ │ └── Dockerfile
│ ├── ubuntu-16.04-cuda8-cudnn6-all-options/
│ │ └── Dockerfile
│ ├── ubuntu-16.04-cuda8-cudnn7-all-options/
│ │ └── Dockerfile
│ └── ubuntu-16.04-gpu-tutorial/
│ └── Dockerfile
├── docs/
│ ├── .Doxyfile-c
│ ├── .Doxyfile-python
│ ├── DOXYGEN.md
│ ├── DoxygenLayout-c.xml
│ ├── DoxygenLayout-python.xml
│ ├── README.md
│ ├── footer.html
│ ├── header.html
│ ├── installation.md
│ ├── main.css
│ ├── process.py
│ └── stylesheet.css
├── modules/
│ ├── CMakeLists.txt
│ ├── detectron/
│ │ ├── CMakeLists.txt
│ │ ├── affine_channel_op.cc
│ │ ├── affine_channel_op.cu
│ │ ├── affine_channel_op.h
│ │ ├── batch_permutation_op.cc
│ │ ├── batch_permutation_op.cu
│ │ ├── batch_permutation_op.h
│ │ ├── group_spatial_softmax_op.cc
│ │ ├── group_spatial_softmax_op.cu
│ │ ├── group_spatial_softmax_op.h
│ │ ├── ps_roi_pool_op.cc
│ │ ├── ps_roi_pool_op.cu
│ │ ├── ps_roi_pool_op.h
│ │ ├── roi_pool_f_op.cc
│ │ ├── roi_pool_f_op.cu
│ │ ├── roi_pool_f_op.h
│ │ ├── sample_as_op.cc
│ │ ├── sample_as_op.cu
│ │ ├── sample_as_op.h
│ │ ├── select_smooth_l1_loss_op.cc
│ │ ├── select_smooth_l1_loss_op.cu
│ │ ├── select_smooth_l1_loss_op.h
│ │ ├── sigmoid_cross_entropy_loss_op.cc
│ │ ├── sigmoid_cross_entropy_loss_op.cu
│ │ ├── sigmoid_cross_entropy_loss_op.h
│ │ ├── sigmoid_focal_loss_op.cc
│ │ ├── sigmoid_focal_loss_op.cu
│ │ ├── sigmoid_focal_loss_op.h
│ │ ├── smooth_l1_loss_op.cc
│ │ ├── smooth_l1_loss_op.cu
│ │ ├── smooth_l1_loss_op.h
│ │ ├── softmax_focal_loss_op.cc
│ │ ├── softmax_focal_loss_op.cu
│ │ ├── softmax_focal_loss_op.h
│ │ ├── spatial_narrow_as_op.cc
│ │ ├── spatial_narrow_as_op.cu
│ │ ├── spatial_narrow_as_op.h
│ │ ├── upsample_nearest_op.cc
│ │ ├── upsample_nearest_op.cu
│ │ └── upsample_nearest_op.h
│ ├── module_test/
│ │ ├── CMakeLists.txt
│ │ └── module_test_dynamic.cc
│ ├── observers/
│ │ ├── CMakeLists.txt
│ │ ├── net_observer_reporter.h
│ │ ├── net_observer_reporter_print.cc
│ │ ├── net_observer_reporter_print.h
│ │ ├── observer_config.cc
│ │ ├── observer_config.h
│ │ ├── perf_observer.cc
│ │ └── perf_observer.h
│ └── rocksdb/
│ ├── CMakeLists.txt
│ └── rocksdb.cc
├── release-notes.md
├── scripts/
│ ├── add_apache_header.sh
│ ├── apache_header.txt
│ ├── appveyor/
│ │ ├── install.bat
│ │ └── install_cuda.bat
│ ├── diagnose_protobuf.py
│ ├── get_python_cmake_flags.py
│ ├── read_conda_versions.sh
│ ├── start_ipython_notebook.sh
│ └── temp.sh
└── setup.py
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitattributes
================================================
*.ipynb linguist-documentation
================================================
FILE: .github/CONTRIBUTING.md
================================================
================================================
FILE: .github/ISSUE_TEMPLATE.md
================================================
If this is a build issue, please fill out the template below.
### System information
* Operating system:
* Compiler version:
* CMake version:
* CMake arguments:
* Relevant libraries/versions (e.g. CUDA):
### CMake summary output
```
******** Summary ********
<please paste summary output here>
```
================================================
FILE: .github/PULL_REQUEST_TEMPLATE.md
================================================
================================================
FILE: .gitignore
================================================
## General
# Compiled Object files
*.slo
*.lo
*.o
*.cuo
*.obj
# Compiled Dynamic libraries
*.so
*.dylib
*.dll
# Compiled Static libraries
*.lai
*.la
*.a
*.lib
# Compiled protocol buffers
*.pb.h
*.pb.cc
*_pb2.py
# Compiled python
*.pyc
*.pyd
# Compiled MATLAB
*.mex*
# IPython notebook checkpoints
.ipynb_checkpoints
# Editor temporaries
*.swn
*.swo
*.swp
*~
# Sublime Text settings
*.sublime-workspace
*.sublime-project
# Eclipse Project settings
*.*project
.settings
# QtCreator files
*.user
# PyCharm files
.idea
# Visual Studio Code files
.vscode
.vs
# OSX dir files
.DS_Store
## Caffe2
# build, distribute, and bins (+ python proto bindings)
build
build_host_protoc
build_android
build_ios
build_*
.build_debug/*
.build_release/*
distribute/*
*.testbin
*.bin
cmake_build
.cmake_build
gen
.setuptools-cmake-build
.pytest_cache
# Bram
plsdontbreak
# Generated documentation
docs/_site
docs/gathered
_site
doxygen
docs/dev
# LevelDB files
*.sst
*.ldb
LOCK
LOG*
CURRENT
MANIFEST-*
# generated version file
caffe2/version.py
# setup.py intermediates
.eggs
caffe2.egg-info
# Atom/Watchman required file
.watchmanconfig
================================================
FILE: .gitmodules
================================================
[submodule "third_party/pybind11"]
path = third_party/pybind11
url = https://github.com/pybind/pybind11.git
[submodule "third_party/nccl"]
path = third_party/nccl
url = https://github.com/nvidia/nccl.git
[submodule "third_party/cub"]
path = third_party/cub
url = https://github.com/NVlabs/cub.git
[submodule "third_party/eigen"]
path = third_party/eigen
url = https://github.com/RLovelett/eigen.git
[submodule "third_party/googletest"]
path = third_party/googletest
url = https://github.com/google/googletest.git
[submodule "third_party/nervanagpu"]
path = third_party/nervanagpu
url = https://github.com/NervanaSystems/nervanagpu.git
[submodule "third_party/benchmark"]
path = third_party/benchmark
url = https://github.com/google/benchmark.git
[submodule "third_party/protobuf"]
path = third_party/protobuf
url = https://github.com/google/protobuf.git
[submodule "third_party/ios-cmake"]
path = third_party/ios-cmake
url = https://github.com/Yangqing/ios-cmake.git
[submodule "third_party/NNPACK"]
path = third_party/NNPACK
url = https://github.com/Maratyszcza/NNPACK.git
[submodule "third_party/gloo"]
path = third_party/gloo
url = https://github.com/facebookincubator/gloo
[submodule "third_party/NNPACK_deps/pthreadpool"]
path = third_party/pthreadpool
url = https://github.com/Maratyszcza/pthreadpool.git
[submodule "third_party/NNPACK_deps/FXdiv"]
path = third_party/FXdiv
url = https://github.com/Maratyszcza/FXdiv.git
[submodule "third_party/NNPACK_deps/FP16"]
path = third_party/FP16
url = https://github.com/Maratyszcza/FP16.git
[submodule "third_party/NNPACK_deps/psimd"]
path = third_party/psimd
url = https://github.com/Maratyszcza/psimd.git
[submodule "third_party/aten"]
path = third_party/aten
url = https://github.com/zdevito/aten
[submodule "third_party/zstd"]
path = third_party/zstd
url = https://github.com/facebook/zstd.git
[submodule "third-party/cpuinfo"]
path = third_party/cpuinfo
url = https://github.com/Maratyszcza/cpuinfo.git
[submodule "third_party/python-enum"]
path = third_party/python-enum
url = https://github.com/PeachPy/enum34.git
[submodule "third_party/python-peachpy"]
path = third_party/python-peachpy
url = https://github.com/Maratyszcza/PeachPy.git
[submodule "third_party/python-six"]
path = third_party/python-six
url = https://github.com/benjaminp/six.git
[submodule "third_party/ComputeLibrary"]
path = third_party/ComputeLibrary
url = https://github.com/ARM-software/ComputeLibrary.git
[submodule "third_party/onnx"]
path = third_party/onnx
url = https://github.com/onnx/onnx.git
================================================
FILE: .jenkins/README.md
================================================
# Jenkins
The scripts in this directory are the entrypoint for testing Caffe2.
The environment variable `BUILD_ENVIRONMENT` is expected to be set to
the build environment you intend to test. It is a hint for the build
and test scripts to configure Caffe2 a certain way and include/exclude
tests. Docker images, they equal the name of the image itself. For
example: `py2-cuda9.0-cudnn7-ubuntu16.04`. The Docker images that are
built on Jenkins and are used in triggered builds already have this
environment variable set in their manifest. Also see
`./docker/jenkins/*/Dockerfile` and search for `BUILD_ENVIRONMENT`.
Our Jenkins installation is located at https://ci.pytorch.org/jenkins/.
================================================
FILE: .jenkins/build.sh
================================================
#!/bin/bash
set -ex
LOCAL_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
ROOT_DIR=$(cd "$LOCAL_DIR"/.. && pwd)
# Setup sccache if SCCACHE_BUCKET is set
if [ -n "${SCCACHE_BUCKET}" ]; then
mkdir -p ./sccache
SCCACHE="$(which sccache)"
if [ -z "${SCCACHE}" ]; then
echo "Unable to find sccache..."
exit 1
fi
# Setup wrapper scripts
for compiler in cc c++ gcc g++ x86_64-linux-gnu-gcc; do
(
echo "#!/bin/sh"
echo "exec $SCCACHE $(which $compiler) \"\$@\""
) > "./sccache/$compiler"
chmod +x "./sccache/$compiler"
done
# CMake must find these wrapper scripts
export PATH="$PWD/sccache:$PATH"
fi
# Setup ccache if configured to use it (and not sccache)
if [ -z "${SCCACHE}" ] && which ccache > /dev/null; then
mkdir -p ./ccache
ln -sf "$(which ccache)" ./ccache/cc
ln -sf "$(which ccache)" ./ccache/c++
ln -sf "$(which ccache)" ./ccache/gcc
ln -sf "$(which ccache)" ./ccache/g++
ln -sf "$(which ccache)" ./ccache/x86_64-linux-gnu-gcc
export CCACHE_WRAPPER_DIR="$PWD/ccache"
export PATH="$CCACHE_WRAPPER_DIR:$PATH"
fi
CMAKE_ARGS=("-DBUILD_BINARY=ON")
CMAKE_ARGS+=("-DUSE_OBSERVERS=ON")
CMAKE_ARGS+=("-DUSE_ZSTD=ON")
# Run build script from scripts if applicable
if [[ "${BUILD_ENVIRONMENT}" == *-android* ]]; then
export ANDROID_NDK=/opt/ndk
"${ROOT_DIR}/scripts/build_android.sh" ${CMAKE_ARGS[*]} "$@"
exit 0
fi
if [[ "${BUILD_ENVIRONMENT}" == conda* ]]; then
# click (required by onnx) wants these set
export LANG=C.UTF-8
export LC_ALL=C.UTF-8
# SKIP_CONDA_TESTS refers to only the 'test' section of the meta.yaml
export SKIP_CONDA_TESTS=1
export CONDA_INSTALL_LOCALLY=1
"${ROOT_DIR}/scripts/build_anaconda.sh" "$@"
# The tests all need hypothesis, tabulate, and pydot, which aren't included
# in the conda packages
conda install -y hypothesis tabulate pydot
# This build will be tested against onnx tests, which needs onnx installed.
# Onnx should be built against the same protobuf that Caffe2 uses, which is
# only installed in the conda environment when Caffe2 is.
# This path comes from install_anaconda.sh which installs Anaconda into the
# docker image
PROTOBUF_INCDIR=/opt/conda/include pip install "${ROOT_DIR}/third_party/onnx"
exit 0
fi
# Run cmake from ./build directory
mkdir -p ./build
cd ./build
INSTALL_PREFIX="/usr/local/caffe2"
CMAKE_ARGS+=("-DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX}")
# Explicitly set Python executable.
# On Ubuntu 16.04 the default Python is still 2.7.
PYTHON="$(which python)"
if [[ "${BUILD_ENVIRONMENT}" == py3* ]]; then
PYTHON=/usr/bin/python3
CMAKE_ARGS+=("-DPYTHON_EXECUTABLE=${PYTHON}")
fi
case "${BUILD_ENVIRONMENT}" in
*-mkl*)
CMAKE_ARGS+=("-DBLAS=MKL")
;;
*-cuda*)
CMAKE_ARGS+=("-DUSE_CUDA=ON")
CMAKE_ARGS+=("-DCUDA_ARCH_NAME=Maxwell")
CMAKE_ARGS+=("-DUSE_NNPACK=OFF")
# Add ccache symlink for nvcc
ln -sf "$(which ccache)" "${CCACHE_WRAPPER_DIR}/nvcc"
# Explicitly set path to NVCC such that the symlink to ccache is used
CMAKE_ARGS+=("-DCUDA_NVCC_EXECUTABLE=${CCACHE_WRAPPER_DIR}/nvcc")
# Ensure FindCUDA.cmake can infer the right path to the CUDA toolkit.
# Setting PATH to resolve to the right nvcc alone isn't enough.
# See /usr/share/cmake-3.5/Modules/FindCUDA.cmake, block at line 589.
export CUDA_PATH="/usr/local/cuda"
# Ensure the ccache symlink can still find the real nvcc binary.
export PATH="/usr/local/cuda/bin:$PATH"
;;
esac
# Try to include Redis support for Linux builds
if [ "$(uname)" == "Linux" ]; then
CMAKE_ARGS+=("-DUSE_REDIS=ON")
fi
# Currently, on Jenkins mac os, we will use custom protobuf. Mac OS
# contbuild at the moment is minimal dependency - it doesn't use glog
# or gflags either.
if [ "$(uname)" == "Darwin" ]; then
CMAKE_ARGS+=("-DBUILD_CUSTOM_PROTOBUF=ON")
fi
# We test the presence of cmake3 (for platforms like Centos and Ubuntu 14.04)
# and use that if so.
if [[ -x "$(command -v cmake3)" ]]; then
CMAKE_BINARY=cmake3
else
CMAKE_BINARY=cmake
fi
# Configure
${CMAKE_BINARY} "${ROOT_DIR}" ${CMAKE_ARGS[*]} "$@"
# Build
if [ "$(uname)" == "Linux" ]; then
make "-j$(nproc)" install
else
echo "Don't know how to build on $(uname)"
exit 1
fi
# Install ONNX into a local directory
ONNX_INSTALL_PATH="/usr/local/onnx"
pip install "${ROOT_DIR}/third_party/onnx" -t "${ONNX_INSTALL_PATH}"
# Symlink the caffe2 base python path into the system python path,
# so that we can import caffe2 without having to change $PYTHONPATH.
# Run in a subshell to contain environment set by /etc/os-release.
#
# This is only done when running on Jenkins! We don't want to pollute
# the user environment with Python symlinks and ld.so.conf.d hacks.
#
if [ -n "${JENKINS_URL}" ]; then
(
source /etc/os-release
function python_version() {
"$PYTHON" -c 'import sys; print("python%d.%d" % sys.version_info[0:2])'
}
# Debian/Ubuntu
if [[ "$ID_LIKE" == *debian* ]]; then
python_path="/usr/local/lib/$(python_version)/dist-packages"
sudo ln -sf "${INSTALL_PREFIX}/caffe2" "${python_path}"
sudo ln -sf "${ONNX_INSTALL_PATH}/onnx" "${python_path}"
fi
# RHEL/CentOS
if [[ "$ID_LIKE" == *rhel* ]]; then
python_path="/usr/lib64/$(python_version)/site-packages/"
sudo ln -sf "${INSTALL_PREFIX}/caffe2" "${python_path}"
sudo ln -sf "${ONNX_INSTALL_PATH}/onnx" "${python_path}"
fi
# /etc/ld.so.conf.d is used on both Debian and RHEL
echo "${INSTALL_PREFIX}/lib" | sudo tee /etc/ld.so.conf.d/caffe2.conf
sudo ldconfig
)
fi
================================================
FILE: .jenkins/test.sh
================================================
#!/bin/bash
set -ex
# Figure out which Python to use
PYTHON="python"
if [ -n "$BUILD_ENVIRONMENT" ]; then
if [[ "$BUILD_ENVIRONMENT" == py2* ]]; then
PYTHON="python2"
elif [[ "$BUILD_ENVIRONMENT" == py3* ]]; then
PYTHON="python3"
fi
fi
# The prefix must mirror the setting from build.sh
INSTALL_PREFIX="/usr/local/caffe2"
# Anaconda builds have a special install prefix and python
if [[ "$BUILD_ENVIRONMENT" == conda* ]]; then
# This path comes from install_anaconda.sh which installs Anaconda into the
# docker image
PYTHON="/opt/conda/bin/python"
INSTALL_PREFIX="/opt/conda/"
fi
# Add the site-packages in the caffe2 install prefix to the PYTHONPATH
SITE_DIR=$($PYTHON -c "from distutils import sysconfig; print(sysconfig.get_python_lib(prefix=''))")
INSTALL_SITE_DIR="${INSTALL_PREFIX}/${SITE_DIR}"
LOCAL_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
ROOT_DIR=$(cd "$LOCAL_DIR"/.. && pwd)
# Skip tests in environments where they are not built/applicable
if [[ "${BUILD_ENVIRONMENT}" == *-android* ]]; then
echo 'Skipping tests'
exit 0
fi
# Set PYTHONPATH and LD_LIBRARY_PATH so that python can find the installed
# Caffe2. This shouldn't be done on Anaconda, as Anaconda should handle this.
if [[ "$BUILD_ENVIRONMENT" != conda* ]]; then
export PYTHONPATH="${PYTHONPATH}:$INSTALL_SITE_DIR"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${INSTALL_PREFIX}/lib"
fi
exit_code=0
cd "$ROOT_DIR"/caffe2/python/tutorials
python tutorials_to_script_converter.py
git status
if git diff --quiet HEAD; then
echo "Source tree is clean."
else
echo "After running a tutorial -> script sync there are changes. This probably means you edited an ipython notebook without a proper sync to a script. Please see caffe2/python/tutorials/README.md for more information"
if [ "$exit_code" -eq 0 ]; then
exit_code=1
fi
fi
cd "$ROOT_DIR"
if [ -d ./test ]; then
echo "Directory ./test already exists; please remove it..."
exit 1
fi
mkdir -p ./test/{cpp,python}
TEST_DIR="$PWD/test"
cd ${INSTALL_PREFIX}
# Commands below may exit with non-zero status
set +e
# C++ tests
echo "Running C++ tests.."
for test in ./test/*; do
# Skip tests we know are hanging or bad
case "$(basename "$test")" in
mkl_utils_test)
continue
;;
# TODO investigate conv_op_test failures when using MKL
conv_op_test)
continue
;;
esac
"$test" --gtest_output=xml:"$TEST_DIR"/cpp/$(basename "$test").xml
tmp_exit_code="$?"
if [ "$exit_code" -eq 0 ]; then
exit_code="$tmp_exit_code"
fi
done
# Get the relative path to where the caffe2 python module was installed
CAFFE2_PYPATH="$INSTALL_SITE_DIR/caffe2"
# Collect additional tests to run (outside caffe2/python)
EXTRA_TESTS=()
# CUDA builds always include NCCL support
if [[ "$BUILD_ENVIRONMENT" == *-cuda* ]]; then
EXTRA_TESTS+=("$CAFFE2_PYPATH/contrib/nccl")
fi
# Python tests
echo "Running Python tests.."
"$PYTHON" \
-m pytest \
-x \
-v \
--junit-xml="$TEST_DIR/python/result.xml" \
--ignore "$CAFFE2_PYPATH/python/test/executor_test.py" \
--ignore "$CAFFE2_PYPATH/python/operator_test/matmul_op_test.py" \
--ignore "$CAFFE2_PYPATH/python/operator_test/pack_ops_test.py" \
--ignore "$CAFFE2_PYPATH/python/mkl/mkl_sbn_speed_test.py" \
"$CAFFE2_PYPATH/python" \
"${EXTRA_TESTS[@]}"
tmp_exit_code="$?"
if [ "$exit_code" -eq 0 ]; then
exit_code="$tmp_exit_code"
fi
# Exit with the first non-zero status we got
exit "$exit_code"
================================================
FILE: .travis/build.sh
================================================
#!/bin/bash
set -e
set -x
LOCAL_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
ROOT_DIR=$(dirname "$LOCAL_DIR")
cd "$ROOT_DIR"
mkdir build
cd build
# Special cases - run script and exit
if [ "$BUILD_ANDROID" = 'true' ]; then
export ANDROID_NDK=/opt/android_ndk
"${ROOT_DIR}/scripts/build_android.sh"
exit 0
fi
if [ "$BUILD_IOS" = 'true' ]; then
"${ROOT_DIR}/scripts/build_ios.sh" -DCMAKE_OSX_ARCHITECTURES=arm64
exit 0
fi
# Configure
CMAKE_ARGS=('-DCMAKE_VERBOSE_MAKEFILE=ON')
CMAKE_ARGS+=('-DCMAKE_INSTALL_PREFIX=../install')
if [ "$BUILD_CUDA" = 'true' ]; then
CMAKE_ARGS+=('-DUSE_CUDA=ON')
CMAKE_ARGS+=('-DCUDA_ARCH_NAME=Pascal')
CMAKE_ARGS+=('-DCUDA_NVCC_EXECUTABLE=/usr/local/bin/nvcc')
export PATH="/usr/local/cuda/bin:${PATH}"
CMAKE_ARGS+=('-DUSE_NNPACK=OFF')
else
CMAKE_ARGS+=('-DUSE_CUDA=OFF')
fi
if [ "$BUILD_MKL" = 'true' ]; then
CMAKE_ARGS+=('-DBLAS=MKL')
fi
if [ "$BUILD_TESTS" = 'false' ]; then
CMAKE_ARGS+=('-DBUILD_TEST=OFF')
fi
CMAKE_ARGS+=$(python $ROOT_DIR/scripts/get_python_cmake_flags.py)
cmake .. ${CMAKE_ARGS[*]}
# Build
if [ "$TRAVIS_OS_NAME" = 'linux' ]; then
make "-j$(nproc)" install
elif [ "$TRAVIS_OS_NAME" = 'osx' ]; then
make "-j$(sysctl -n hw.ncpu)" install
fi
================================================
FILE: .travis/install.sh
================================================
#!/bin/bash
set -e
set -x
LOCAL_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
ROOT_DIR=$(dirname "$LOCAL_DIR")
cd "$ROOT_DIR"
APT_INSTALL_CMD='sudo apt-get install -y --no-install-recommends'
if [ "$TRAVIS_OS_NAME" = 'linux' ]; then
####################
# apt dependencies #
####################
sudo apt-get update
$APT_INSTALL_CMD \
asciidoc \
autoconf \
automake \
build-essential \
ca-certificates \
ccache \
docbook-xml \
docbook-xsl \
git \
gperf \
libatlas-base-dev \
libgoogle-glog-dev \
libiomp-dev \
libleveldb-dev \
liblmdb-dev \
libopencv-dev \
libprotobuf-dev \
libpthread-stubs0-dev \
libsnappy-dev \
protobuf-compiler \
python \
python-dev \
python-pip \
python-wheel \
software-properties-common \
xsltproc
# Install ccache symlink wrappers
pushd /usr/local/bin
sudo ln -sf "$(which ccache)" gcc
sudo ln -sf "$(which ccache)" g++
popd
if [ "$BUILD_GCC5" = 'true' ]; then
################
# Install GCC5 #
################
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt-get update
$APT_INSTALL_CMD g++-5
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 60 \
--slave /usr/bin/g++ g++ /usr/bin/g++-5
fi
if [ "$BUILD_CUDA" = 'true' ]; then
##################
# Install ccache #
##################
# Needs specific branch to work with nvcc (ccache/ccache#145)
if [ -e "${BUILD_CCACHE_DIR}/ccache" ]; then
echo "Using cached ccache build at \"$BUILD_CCACHE_DIR\" ..."
else
git clone https://github.com/colesbury/ccache -b ccbin "$BUILD_CCACHE_DIR"
pushd "$BUILD_CCACHE_DIR"
./autogen.sh
./configure
make "-j$(nproc)"
popd
fi
# Overwrite ccache symlink wrappers
pushd /usr/local/bin
sudo ln -sf "${BUILD_CCACHE_DIR}/ccache" gcc
sudo ln -sf "${BUILD_CCACHE_DIR}/ccache" g++
sudo ln -sf "${BUILD_CCACHE_DIR}/ccache" nvcc
popd
#################
# Install CMake #
#################
# Newer version required to get cmake+ccache+nvcc to work
_cmake_installer=/tmp/cmake.sh
wget -O "$_cmake_installer" https://cmake.org/files/v3.8/cmake-3.8.2-Linux-x86_64.sh
sudo bash "$_cmake_installer" --prefix=/usr/local --skip-license
rm -rf "$_cmake_installer"
################
# Install CUDA #
################
CUDA_REPO_PKG='cuda-repo-ubuntu1404_8.0.44-1_amd64.deb'
CUDA_PKG_VERSION='8-0'
CUDA_VERSION='8.0'
wget "https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64/${CUDA_REPO_PKG}"
sudo dpkg -i "$CUDA_REPO_PKG"
rm -f "$CUDA_REPO_PKG"
sudo apt-get update
$APT_INSTALL_CMD \
"cuda-core-${CUDA_PKG_VERSION}" \
"cuda-cublas-dev-${CUDA_PKG_VERSION}" \
"cuda-cudart-dev-${CUDA_PKG_VERSION}" \
"cuda-curand-dev-${CUDA_PKG_VERSION}" \
"cuda-driver-dev-${CUDA_PKG_VERSION}" \
"cuda-nvrtc-dev-${CUDA_PKG_VERSION}"
# Manually create CUDA symlink
sudo ln -sf /usr/local/cuda-$CUDA_VERSION /usr/local/cuda
#################
# Install cuDNN #
#################
CUDNN_REPO_PKG='nvidia-machine-learning-repo-ubuntu1404_4.0-2_amd64.deb'
CUDNN_PKG_VERSION='6.0.20-1+cuda8.0'
wget "https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1404/x86_64/${CUDNN_REPO_PKG}"
sudo dpkg -i "$CUDNN_REPO_PKG"
rm -f "$CUDNN_REPO_PKG"
sudo apt-get update
$APT_INSTALL_CMD \
"libcudnn6=${CUDNN_PKG_VERSION}" \
"libcudnn6-dev=${CUDNN_PKG_VERSION}"
fi
if [ "$BUILD_MKL" = 'true' ]; then
###############
# Install MKL #
###############
_mkl_key=/tmp/mkl.pub
wget -O "$_mkl_key" http://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB
sudo apt-key add "$_mkl_key"
rm -f "$_mkl_key"
echo 'deb http://apt.repos.intel.com/mkl all main' | sudo tee /etc/apt/sources.list.d/intel-mkl.list
sudo apt-get update
$APT_INSTALL_CMD intel-mkl-64bit
fi
elif [ "$TRAVIS_OS_NAME" = 'osx' ]; then
#####################
# brew dependencies #
#####################
brew update
brew install python
pip uninstall -y numpy # use brew version (opencv dependency)
brew tap homebrew/science # for OpenCV
brew install \
ccache \
glog \
leveldb \
lmdb \
protobuf
# Install ccache symlink wrappers
pushd /usr/local/bin
sudo ln -sf "$(which ccache)" clang
sudo ln -sf "$(which ccache)" clang++
popd
else
echo "OS \"$TRAVIS_OS_NAME\" is unknown"
exit 1
fi
####################
# pip dependencies #
####################
sudo pip install \
future \
hypothesis \
numpy \
protobuf \
pytest \
scikit-image
if [ "$BUILD_ANDROID" = 'true' ]; then
#######################
# Install Android NDK #
#######################
_ndk_zip=/tmp/ndk.zip
if [ "$TRAVIS_OS_NAME" = 'linux' ]; then
$APT_INSTALL_CMD autotools-dev autoconf
wget -O "$_ndk_zip" https://dl.google.com/android/repository/android-ndk-r13b-linux-x86_64.zip
elif [ "$TRAVIS_OS_NAME" = 'osx' ]; then
brew install libtool
wget -O "$_ndk_zip" https://dl.google.com/android/repository/android-ndk-r13b-darwin-x86_64.zip
else
echo "OS \"$TRAVIS_OS_NAME\" is unknown"
exit 1
fi
_ndk_dir=/opt/android_ndk
sudo mkdir -p "$_ndk_dir"
sudo chmod a+rwx "$_ndk_dir"
unzip -qo "$_ndk_zip" -d "$_ndk_dir"
rm -f "$_ndk_zip"
_versioned_dir=$(find $_ndk_dir/ -mindepth 1 -maxdepth 1 -type d)
mv "$_versioned_dir"/* "$_ndk_dir"/
rmdir "$_versioned_dir"
fi
if [ "$BUILD_NNPACK" = 'true' ]; then
#################
# Install ninja #
#################
if [ "$TRAVIS_OS_NAME" = 'linux' ]; then
# NNPACK needs a recent version
if [ -e "${BUILD_NINJA_DIR}/ninja" ]; then
echo "Using cached ninja build at \"$BUILD_NINJA_DIR\" ..."
else
git clone https://github.com/ninja-build/ninja.git -b release "$BUILD_NINJA_DIR"
pushd "$BUILD_NINJA_DIR"
python configure.py --bootstrap
popd
fi
sudo install -m 755 "${BUILD_NINJA_DIR}/ninja" /usr/local/bin/ninja
elif [ "$TRAVIS_OS_NAME" = 'osx' ]; then
brew install ninja
else
echo "OS \"$TRAVIS_OS_NAME\" is unknown"
exit 1
fi
sudo pip install git+https://github.com/Maratyszcza/PeachPy
sudo pip install git+https://github.com/Maratyszcza/confu
fi
================================================
FILE: .travis/setup.sh
================================================
#!/bin/bash
# This script should be sourced, not executed
set -e
export BUILD_ANDROID=false
export BUILD_CUDA=false
export BUILD_GCC5=false
export BUILD_IOS=false
export BUILD_MKL=false
export BUILD_NNPACK=true
export BUILD_TESTS=true
if [ "$BUILD" = 'linux' ]; then
:
elif [ "$BUILD" = 'linux-gcc5' ]; then
export BUILD_GCC5=true
elif [ "$BUILD" = 'linux-cuda' ]; then
export BUILD_CUDA=true
export BUILD_NNPACK=false
export BUILD_TESTS=false
elif [ "$BUILD" = 'linux-mkl' ]; then
export BUILD_MKL=true
export BUILD_TESTS=false
elif [ "$BUILD" = 'linux-android' ]; then
export BUILD_ANDROID=true
export BUILD_TESTS=false
elif [ "$BUILD" = 'osx' ]; then
# TODO(lukeyeager): enable after caffe2/caffe2#785
export BUILD_TESTS=false
# Since Python 2.7.14, HomeBrew does not link python and pip in /usr/local/bin/,
# but they are available in /usr/local/opt/python/libexec/bin/
export PATH="/usr/local/opt/python/libexec/bin:${PATH}"
elif [ "$BUILD" = 'osx-ios' ]; then
export BUILD_IOS=true
export BUILD_TESTS=false
# Since Python 2.7.14, HomeBrew does not link python and pip in /usr/local/bin/,
# but they are available in /usr/local/opt/python/libexec/bin/
export PATH="/usr/local/opt/python/libexec/bin:${PATH}"
elif [ "$BUILD" = 'osx-android' ]; then
export BUILD_ANDROID=true
export BUILD_TESTS=false
# Since Python 2.7.14, HomeBrew does not link python and pip in /usr/local/bin/,
# but they are available in /usr/local/opt/python/libexec/bin/
export PATH="/usr/local/opt/python/libexec/bin:${PATH}"
else
echo "BUILD \"$BUILD\" is unknown"
exit 1
fi
================================================
FILE: .travis/test.sh
================================================
#!/bin/bash
set -e
set -x
LOCAL_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
ROOT_DIR=$(dirname "$LOCAL_DIR")
cd "$ROOT_DIR"
if [ "$BUILD_TESTS" = 'false' ]; then
echo 'Skipping tests'
exit 0
fi
# Ctests
pushd build
CTEST_OUTPUT_ON_FAILURE=1 make test
popd
# Python tests
export PYTHONPATH="${PYTHONPATH}:${ROOT_DIR}/install"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${ROOT_DIR}/install/lib"
python -m pytest -v install/caffe2/python
================================================
FILE: .travis.yml
================================================
os: linux
dist: trusty
sudo: required
language: cpp
compiler: gcc
env:
global:
- BUILD_CCACHE_DIR=~/build/ccache
- BUILD_NINJA_DIR=~/build/ninja
matrix:
- BUILD=linux
- BUILD=linux-gcc5
- BUILD=linux-cuda
- BUILD=linux-mkl
- BUILD=linux-android
matrix:
include:
- env: BUILD=osx
os: osx
osx_image: xcode8.3
compiler: clang
- env: BUILD=osx-ios
os: osx
osx_image: xcode8.3
compiler: clang
- env: BUILD=osx-android
os: osx
osx_image: xcode8.3
compiler: clang
cache:
directories:
- $BUILD_CCACHE_DIR
- $BUILD_NINJA_DIR
- $HOME/.ccache
before_install:
- source .travis/setup.sh
install:
- ./.travis/install.sh
- ./.travis/build.sh
script:
- ./.travis/test.sh
================================================
FILE: CMakeLists.txt
================================================
cmake_minimum_required(VERSION 3.2 FATAL_ERROR)
#cmake_policy(SET CMP0022 NEW)
#cmake_policy(SET CMP0023 NEW)
# ---[ Project and semantic versioning.
project(Caffe2 CXX C)
set(CAFFE2_VERSION_MAJOR 0)
set(CAFFE2_VERSION_MINOR 8)
set(CAFFE2_VERSION_PATCH 2)
set(CAFFE2_VERSION
"${CAFFE2_VERSION_MAJOR}.${CAFFE2_VERSION_MINOR}.${CAFFE2_VERSION_PATCH}")
# One variable that determines whether the current cmake process is being run
# with the main Caffe2 library. This is useful for building modules - if
# modules are built with the main Caffe2 library then one does not need to do
# find caffe2 in the cmake script. One can usually guard it in some way like
# if (NOT CAFFE2_CMAKE_BUILDING_WITH_MAIN_REPO)
# find_package(Caffe2 REQUIRED)
# endif()
set(CAFFE2_CMAKE_BUILDING_WITH_MAIN_REPO ON)
# ---[ Options.
# Note to developers: if you add an option below, make sure you also add it to
# cmake/Summary.cmake so that the summary prints out the option values.
include(CMakeDependentOption)
option(BUILD_BINARY "Build C++ binaries" ON)
option(BUILD_DOCS "Build documentation" OFF)
option(BUILD_CUSTOM_PROTOBUF "If set, build Caffe2's own protobuf under third_party" OFF)
option(BUILD_PYTHON "Build Python binaries" ON)
option(BUILD_SHARED_LIBS "Build libcaffe2.so" ON)
cmake_dependent_option(
CAFFE2_USE_MSVC_STATIC_RUNTIME "Using MSVC static runtime libraries" ON
"NOT BUILD_SHARED_LIBS" OFF)
option(BUILD_TEST "Build C++ test binaries (need gtest and gbenchmark)" ON)
option(USE_ACL "Use ARM Compute Library" OFF)
option(USE_ASAN "Use Address Sanitizer" OFF)
option(USE_ATEN "Use ATen" OFF)
option(USE_CUDA "Use Cuda" ON)
option(USE_FFMPEG "Use ffmpeg" OFF)
option(USE_GFLAGS "Use GFLAGS" ON)
option(USE_GLOG "Use GLOG" ON)
option(USE_GLOO "Use Gloo" ON)
option(USE_LEVELDB "Use LEVELDB" ON)
option(USE_LITE_PROTO "Use lite protobuf instead of full." OFF)
option(USE_LMDB "Use LMDB" ON)
option(USE_METAL "Use Metal for iOS build" ON)
option(USE_MOBILE_OPENGL "Use OpenGL for mobile code" ON)
option(USE_MPI "Use MPI" ON)
option(USE_NATIVE_ARCH "Use -march=native" OFF)
option(USE_NCCL "Use NCCL" ON)
option(USE_NERVANA_GPU "Use Nervana GPU backend" OFF)
option(USE_NNAPI "Use NNAPI" OFF)
option(USE_NNPACK "Use NNPACK" ON)
option(USE_NUMA "Use NUMA (only available on Linux)" ON)
option(USE_OBSERVERS "Use observers module." OFF)
option(USE_OPENCV "Use openCV" ON)
option(USE_OPENMP "Use OpenMP for parallel code" OFF)
option(USE_PROF "Use profiling" OFF)
option(USE_REDIS "Use Redis" OFF)
option(USE_ROCKSDB "Use RocksDB" OFF)
option(USE_SNPE "Use Qualcomm's SNPE library" OFF)
option(USE_THREADS "Use Threads" ON)
option(USE_ZMQ "Use ZMQ" OFF)
option(USE_ZSTD "Use ZSTD" OFF)
# ---[ CMake scripts + modules
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/Modules)
if (MSVC AND ${BUILD_SHARED_LIBS})
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
endif()
# ---[ CMake build directories
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
enable_testing()
# ---[ Misc checks to cope with various compiler modes
include(cmake/MiscCheck.cmake)
include(cmake/BuildVariables.cmake)
# External projects
include(ExternalProject)
# TODO: merge the following 3 files into cmake/public/utils.cmake.
include(cmake/Utils.cmake)
include(cmake/public/utils.cmake)
set(CAFFE2_WHITELIST "" CACHE STRING "A whitelist file of files that one should build.")
# Set default build type
if(NOT CMAKE_BUILD_TYPE)
message(STATUS "Build type not set - defaulting to Release")
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build from: Debug Release RelWithDebInfo MinSizeRel Coverage." FORCE)
endif()
# ---[ Dependencies
include(cmake/Dependencies.cmake)
# ---[ Whitelist file if whitelist is specified
include(cmake/Whitelist.cmake)
# ---[ Set link flag, handle additional deps for gcc 4.8 and above
if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.8.0 AND NOT ANDROID)
message(STATUS "GCC ${CMAKE_CXX_COMPILER_VERSION}: Adding gcc and gcc_s libs to link line")
list(APPEND Caffe2_DEPENDENCY_LIBS gcc_s gcc)
endif()
# ---[ Build flags
set(CMAKE_C_STANDARD 99)
set(CMAKE_CXX_STANDARD 11)
if(NOT MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -fPIC")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-narrowing")
# Eigen fails to build with some versions, so convert this to a warning
# Details at http://eigen.tuxfamily.org/bz/show_bug.cgi?id=1459
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-invalid-partial-specialization")
else()
foreach(flag_var
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
if (${CAFFE2_USE_MSVC_STATIC_RUNTIME})
if(${flag_var} MATCHES "/MD")
string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
endif(${flag_var} MATCHES "/MD")
else()
if(${flag_var} MATCHES "/MT")
string(REGEX REPLACE "/MT" "/MD" ${flag_var} "${${flag_var}}")
endif()
endif()
set(${flag_var} "${${flag_var}} /MP /bigobj")
endforeach(flag_var)
endif()
if(ANDROID)
if(CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s")
else()
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s")
endif()
endif()
if(NOT APPLE AND UNIX)
list(APPEND Caffe2_DEPENDENCY_LIBS dl)
endif()
# Prefix path to Caffe2 headers.
# If a directory containing installed Caffe2 headers was inadvertently
# added to the list of include directories, prefixing
# PROJECT_SOURCE_DIR means this source tree always takes precedence.
include_directories(BEFORE ${PROJECT_SOURCE_DIR})
# Prefix path to generated Caffe2 headers.
# These need to take precedence over their empty counterparts located
# in PROJECT_SOURCE_DIR.
include_directories(BEFORE ${PROJECT_BINARY_DIR})
# ---[ Old caffe protobuf.
add_subdirectory(caffe/proto)
# ---[ Main build
add_subdirectory(caffe2)
# Documentation Option
if(BUILD_DOCS)
# check if Doxygen is installed
find_package(Doxygen)
if (DOXYGEN_FOUND)
message("Generating documentation")
set(DOXYGEN_C_IN ${CMAKE_CURRENT_SOURCE_DIR}/docs/.Doxyfile-c)
set(DOXYGEN_C_OUT ${CMAKE_CURRENT_SOURCE_DIR}/docs/Doxyfile-c)
set(DOXYGEN_P_IN ${CMAKE_CURRENT_SOURCE_DIR}/docs/.Doxyfile-python)
set(DOXYGEN_P_OUT ${CMAKE_CURRENT_SOURCE_DIR}/docs/Doxyfile-python)
if(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/docs)
file(REMOVE_RECURSE ${CMAKE_CURRENT_BINARY_DIR}/docs)
endif (EXISTS ${CMAKE_CURRENT_BINARY_DIR}/docs)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/docs)
configure_file(${DOXYGEN_C_IN} ${DOXYGEN_C_OUT} @ONLY)
configure_file(${DOXYGEN_P_IN} ${DOXYGEN_P_OUT} @ONLY)
add_custom_target(doc_doxygen_c ALL
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_C_OUT}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "Generating C++ API documentation with Doxygen"
VERBATIM)
add_custom_target(doc_doxygen_python ALL
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_P_OUT}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "Generating Python API documentation with Doxygen"
VERBATIM)
else (DOXYGEN_FOUND)
message(FATAL_ERROR "Doxygen needs to be installed to generate the documentation")
endif (DOXYGEN_FOUND)
endif (BUILD_DOCS)
# ---[ CMake related files
# Uninistall option.
if(NOT TARGET caffe2_uninstall)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake
IMMEDIATE @ONLY)
add_custom_target(caffe2_uninstall
COMMAND ${CMAKE_COMMAND} -P
${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
endif()
# ---[ Make configuration files for cmake to allow dependent libraries
# easier access to Caffe2.
if ((NOT USE_GLOG) OR (NOT USE_GFLAGS) OR BUILD_CUSTOM_PROTOBUF)
message(WARNING
"Generated cmake files are only fully tested if one builds "
"with system glog, gflags, and protobuf. Other settings may "
"generate files that are not well tested.")
endif()
if (USE_CUDA)
# TODO: check if we should include other cuda dependency libraries
# to the interface as well.
endif()
# Note(jiayq): when building static libraries, all PRIVATE dependencies
# will also become interface libraries, and as a result if there are any
# dependency libraries that are not exported, the following install export
# script will fail. As a result, we will only provide the targets cmake
# files for shared lib installation. For more info, read:
# https://cmake.org/pipermail/cmake/2016-May/063400.html
if (BUILD_SHARED_LIBS)
configure_file(
${PROJECT_SOURCE_DIR}/cmake/Caffe2ConfigVersion.cmake.in
${PROJECT_BINARY_DIR}/Caffe2ConfigVersion.cmake
@ONLY)
configure_file(
${PROJECT_SOURCE_DIR}/cmake/Caffe2Config.cmake.in
${PROJECT_BINARY_DIR}/Caffe2Config.cmake
@ONLY)
install(FILES
${PROJECT_BINARY_DIR}/Caffe2ConfigVersion.cmake
${PROJECT_BINARY_DIR}/Caffe2Config.cmake
DESTINATION share/cmake/Caffe2
COMPONENT dev)
install(FILES
${PROJECT_SOURCE_DIR}/cmake/public/cuda.cmake
${PROJECT_SOURCE_DIR}/cmake/public/glog.cmake
${PROJECT_SOURCE_DIR}/cmake/public/gflags.cmake
${PROJECT_SOURCE_DIR}/cmake/public/protobuf.cmake
${PROJECT_SOURCE_DIR}/cmake/public/threads.cmake
${PROJECT_SOURCE_DIR}/cmake/public/utils.cmake
DESTINATION share/cmake/Caffe2/public
COMPONENT dev)
install(EXPORT Caffe2Targets DESTINATION share/cmake/Caffe2
FILE Caffe2Targets.cmake
COMPONENT dev)
else()
message(WARNING
"Generated cmake files are only available when building "
"shared libs.")
endif()
# ---[ Modules
add_subdirectory(modules)
# ---[ Binaries
# Binaries will be built after the Caffe2 main libraries and the modules
# are built. For the binaries, they will be linked to the Caffe2 main
# libraries, as well as all the modules that are built with Caffe2 (the ones
# built in the previous Modules section above).
if (BUILD_BINARY)
add_subdirectory(binaries)
endif()
include(cmake/Summary.cmake)
caffe2_print_configuration_summary()
================================================
FILE: LICENSE
================================================
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
================================================
FILE: Makefile
================================================
# This makefile does nothing but delegating the actual building to cmake.
all:
@mkdir -p build && cd build && cmake .. $(shell python ./scripts/get_python_cmake_flags.py) && $(MAKE)
local:
@./scripts/build_local.sh
android:
@./scripts/build_android.sh
ios:
@./scripts/build_ios.sh
clean: # This will remove ALL build folders.
@rm -r build*/
linecount:
@cloc --read-lang-def=caffe.cloc caffe2 || \
echo "Cloc is not available on the machine. You can install cloc with " && \
echo " sudo apt-get install cloc"
================================================
FILE: NOTICE
================================================
Copyright (c) 2016-present, Facebook Inc. All rights reserved.
All contributions by Facebook:
Copyright (c) 2016 Facebook Inc.
All contributions by Google:
Copyright (c) 2015 Google Inc.
All rights reserved.
All contributions by Yangqing Jia:
Copyright (c) 2015 Yangqing Jia
All rights reserved.
All contributions from Caffe:
Copyright(c) 2013, 2014, 2015, the respective contributors
All rights reserved.
All other contributions:
Copyright(c) 2015, 2016 the respective contributors
All rights reserved.
Caffe2 uses a copyright model similar to Caffe: each contributor holds
copyright over their contributions to Caffe2. The project versioning records
all such contribution and copyright details. If a contributor wants to further
mark their specific copyright on a particular contribution, they should
indicate their copyright solely in the commit message of the change when it is
committed.
=======================================================================
Software under third_party
=======================================================================
Software libraries under third_party are provided as github submodule
links, and their content is not part of the Caffe2 codebase. Their
licences can be found under the respective software repositories.
=======================================================================
Earlier BSD License
=======================================================================
Early development of Caffe2 in 2015 and early 2016 is licensed under the
BSD license. The license is attached below:
All contributions by Facebook:
Copyright (c) 2016 Facebook Inc.
All contributions by Google:
Copyright (c) 2015 Google Inc.
All rights reserved.
All contributions by Yangqing Jia:
Copyright (c) 2015 Yangqing Jia
All rights reserved.
All other contributions:
Copyright(c) 2015, 2016 the respective contributors
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
=======================================================================
Caffe's BSD License
=======================================================================
Some parts of the caffe2 code is derived from the original Caffe code, which is
created by Yangqing Jia and is now a BSD-licensed open-source project. The Caffe
license is as follows:
COPYRIGHT
All contributions by the University of California:
Copyright (c) 2014, The Regents of the University of California (Regents)
All rights reserved.
All other contributions:
Copyright (c) 2014, the respective contributors
All rights reserved.
Caffe uses a shared copyright model: each contributor holds copyright over
their contributions to Caffe. The project versioning records all such
contribution and copyright details. If a contributor wants to further mark
their specific copyright on a particular contribution, they should indicate
their copyright solely in the commit message of the change when it is
committed.
LICENSE
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
CONTRIBUTION AGREEMENT
By contributing to the BVLC/caffe repository through pull-request, comment,
or otherwise, the contributor releases their content to the
license and copyright terms herein.
================================================
FILE: README.md
================================================
# Caffe2
[](https://opensource.org/licenses/Apache-2.0)
[](https://ci.pytorch.org/jenkins/job/caffe2-master)
[](https://ci.appveyor.com/project/Yangqing/caffe2)
Caffe2 is a lightweight, modular, and scalable deep learning framework. Building on the original [Caffe](http://caffe.berkeleyvision.org), Caffe2 is designed with expression, speed, and modularity in mind.
## Questions and Feedback
Please use Github issues (https://github.com/caffe2/caffe2/issues) to ask questions, report bugs, and request new features.
Please participate in our survey (https://www.surveymonkey.com/r/caffe2). We will send you information about new releases and special developer events/webinars.
## License
Caffe2 is released under the [Apache 2.0 license](https://github.com/caffe2/caffe2/blob/master/LICENSE). See the [NOTICE](https://github.com/caffe2/caffe2/blob/master/NOTICE) file for details.
### Further Resources on [Caffe2.ai](http://caffe2.ai)
* [Installation](http://caffe2.ai/docs/getting-started.html)
* [Learn More](http://caffe2.ai/docs/learn-more.html)
* [Upgrading to Caffe2](http://caffe2.ai/docs/caffe-migration.html)
* [Datasets](http://caffe2.ai/docs/datasets.html)
* [Model Zoo](http://caffe2.ai/docs/zoo.html)
* [Tutorials](http://caffe2.ai/docs/tutorials.html)
* [Operators Catalogue](http://caffe2.ai/docs/operators-catalogue.html)
* [C++ API](http://caffe2.ai/doxygen-c/html/classes.html)
* [Python API](http://caffe2.ai/doxygen-python/html/namespaces.html)
================================================
FILE: VERSION_NUMBER
================================================
0.8.1
================================================
FILE: appveyor.yml
================================================
version: '{build}'
clone_folder: c:\projects\caffe2
environment:
matrix:
- USE_CUDA: OFF
CMAKE_BUILD_TYPE: Release
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
# Building CUDA with Visual Studio 2017 is yet to be supported by
# NVidia, so we canot enable it right now.
#- USE_CUDA: ON
# CMAKE_BUILD_TYPE: Release
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
# Building CUDA currently causes a timeout in appveyor. In the interest
# of properly monitoring the rest, we will disable cuda contbuild for now.
#- USE_CUDA: ON
# CMAKE_BUILD_TYPE: Release
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
- USE_CUDA: OFF
CMAKE_BUILD_TYPE: Release
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
# Debug build is not a top priority for us right now, so in the
# interest of contbuild time, we disable it.
#- USE_CUDA: OFF
# CMAKE_BUILD_TYPE: Debug
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
# Currently, CUDA + Debug does not work due to an error of using
# std::_Debug_lt in device code. Not sure where this comes from yet,
# but it is probably safe to assume that very few are going to build
# debug mode with CUDA and Windows.
#- USE_CUDA: ON
# CMAKE_BUILD_TYPE: Debug
install:
- cmd: c:\projects\caffe2\scripts\appveyor\install.bat
build_script:
- cmd: >-
cd c:\projects\caffe2
git submodule update --init
call scripts\build_windows.bat
================================================
FILE: binaries/CMakeLists.txt
================================================
caffe2_binary_target("convert_caffe_image_db.cc")
caffe2_binary_target("convert_db.cc")
caffe2_binary_target("make_cifar_db.cc")
caffe2_binary_target("make_mnist_db.cc")
caffe2_binary_target("predictor_verifier.cc")
caffe2_binary_target("print_registered_core_operators.cc")
caffe2_binary_target("run_plan.cc")
caffe2_binary_target("speed_benchmark.cc")
caffe2_binary_target("split_db.cc")
caffe2_binary_target("db_throughput.cc")
if (USE_CUDA)
caffe2_binary_target("inspect_gpus.cc")
target_link_libraries(inspect_gpus ${CUDA_LIBRARIES})
caffe2_binary_target("print_core_object_sizes.cc")
if (BUILD_TEST)
# Core overhead benchmark
caffe2_binary_target("core_overhead_benchmark.cc")
target_link_libraries(core_overhead_benchmark benchmark ${CUDA_curand_LIBRARY})
endif()
endif()
if (USE_ZMQ)
caffe2_binary_target("zmq_feeder.cc")
target_link_libraries(zmq_feeder ${ZMQ_LIBRARIES})
endif()
if(USE_MPI)
caffe2_binary_target("run_plan_mpi.cc")
target_link_libraries(run_plan_mpi ${MPI_CXX_LIBRARIES})
endif()
if (USE_OPENCV AND USE_LEVELDB)
caffe2_binary_target("convert_encoded_to_raw_leveldb.cc")
target_link_libraries(
convert_encoded_to_raw_leveldb
${OpenCV_LIBS} ${LevelDB_LIBRARIES} ${Snappy_LIBRARIES})
endif()
if (USE_OPENCV)
caffe2_binary_target("make_image_db.cc")
target_link_libraries(make_image_db ${OpenCV_LIBS})
endif()
if (USE_OBSERVERS)
caffe2_binary_target("caffe2_benchmark.cc")
endif()
# ---[ tutorials
caffe2_binary_target("tutorial_blob.cc")
================================================
FILE: binaries/caffe2_benchmark.cc
================================================
#include <fstream>
#include <iterator>
#include <string>
#include "caffe2/core/blob_serialization.h"
#include "caffe2/core/init.h"
#include "caffe2/core/logging.h"
#include "caffe2/core/operator.h"
#include "caffe2/proto/caffe2.pb.h"
#include "caffe2/utils/proto_utils.h"
#include "caffe2/utils/string_utils.h"
#include "observers/observer_config.h"
CAFFE2_DEFINE_string(
backend,
"builtin",
"The backend to use when running the model. The allowed "
"backend choices are: builtin, default, nnpack, eigen, mkl");
CAFFE2_DEFINE_string(
init_net,
"",
"The given net to initialize any parameters.");
CAFFE2_DEFINE_string(
input,
"",
"Input that is needed for running the network. If "
"multiple input needed, use comma separated string.");
CAFFE2_DEFINE_string(
input_dims,
"",
"Alternate to input_files, if all inputs are simple "
"float TensorCPUs, specify the dimension using comma "
"separated numbers. If multiple input needed, use "
"semicolon to separate the dimension of different "
"tensors.");
CAFFE2_DEFINE_string(
input_file,
"",
"Input file that contain the serialized protobuf for "
"the input blobs. If multiple input needed, use comma "
"separated string. Must have the same number of items "
"as input does.");
CAFFE2_DEFINE_string(
input_type,
"float",
"Input type when specifying the input dimension."
"The supported types are float, uint8_t.");
CAFFE2_DEFINE_int(iter, 10, "The number of iterations to run.");
CAFFE2_DEFINE_string(net, "", "The given net to benchmark.");
CAFFE2_DEFINE_string(
output,
"",
"Output that should be dumped after the execution "
"finishes. If multiple outputs are needed, use comma "
"separated string. If you want to dump everything, pass "
"'*' as the output value.");
CAFFE2_DEFINE_string(
output_folder,
"",
"The folder that the output should be written to. This "
"folder must already exist in the file system.");
CAFFE2_DEFINE_bool(
run_individual,
false,
"Whether to benchmark individual operators.");
CAFFE2_DEFINE_bool(
text_output,
false,
"Whether to write out output in text format for regression purpose.");
CAFFE2_DEFINE_int(warmup, 0, "The number of iterations to warm up.");
using std::string;
using std::unique_ptr;
using std::vector;
static void writeTextOutput(
caffe2::TensorCPU* tensor,
const string& output_prefix,
const string& name) {
string output_name = output_prefix + "/" + name + ".txt";
caffe2::TensorSerializer<caffe2::CPUContext> ser;
caffe2::BlobProto blob_proto;
ser.Serialize(
*tensor, output_name, blob_proto.mutable_tensor(), 0, tensor->size());
blob_proto.set_name(output_name);
blob_proto.set_type("Tensor");
CAFFE_ENFORCE(blob_proto.has_tensor());
caffe2::TensorProto tensor_proto = blob_proto.tensor();
vector<float> data;
switch (tensor_proto.data_type()) {
case caffe2::TensorProto::FLOAT: {
std::copy(
tensor_proto.float_data().begin(),
tensor_proto.float_data().end(),
std::back_inserter(data));
break;
}
case caffe2::TensorProto::INT32: {
std::copy(
tensor_proto.int32_data().begin(),
tensor_proto.int32_data().end(),
std::back_inserter(data));
break;
}
default:
CAFFE_THROW("Unimplemented Blob type.");
}
std::ofstream output_file(output_name);
std::ostream_iterator<float> output_iterator(output_file, "\n");
std::copy(data.begin(), data.end(), output_iterator);
}
int main(int argc, char** argv) {
caffe2::GlobalInit(&argc, &argv);
caffe2::ShowLogInfoToStderr();
unique_ptr<caffe2::Workspace> workspace(new caffe2::Workspace());
// Run initialization network.
caffe2::NetDef init_net_def;
CAFFE_ENFORCE(ReadProtoFromFile(caffe2::FLAGS_init_net, &init_net_def));
CAFFE_ENFORCE(workspace->RunNetOnce(init_net_def));
// Load input.
if (caffe2::FLAGS_input.size()) {
vector<string> input_names = caffe2::split(',', caffe2::FLAGS_input);
if (caffe2::FLAGS_input_file.size()) {
vector<string> input_files = caffe2::split(',', caffe2::FLAGS_input_file);
CAFFE_ENFORCE_EQ(
input_names.size(),
input_files.size(),
"Input name and file should have the same number.");
for (int i = 0; i < input_names.size(); ++i) {
caffe2::BlobProto blob_proto;
CAFFE_ENFORCE(caffe2::ReadProtoFromFile(input_files[i], &blob_proto));
workspace->CreateBlob(input_names[i])->Deserialize(blob_proto);
}
} else if (caffe2::FLAGS_input_dims.size()) {
vector<string> input_dims_list =
caffe2::split(';', caffe2::FLAGS_input_dims);
CAFFE_ENFORCE_EQ(
input_names.size(),
input_dims_list.size(),
"Input name and dims should have the same number of items.");
for (int i = 0; i < input_names.size(); ++i) {
vector<string> input_dims_str = caffe2::split(',', input_dims_list[i]);
vector<int> input_dims;
for (const string& s : input_dims_str) {
input_dims.push_back(caffe2::stoi(s));
}
if (!workspace->HasBlob(input_names[i])) {
workspace->CreateBlob(input_names[i]);
}
caffe2::TensorCPU* tensor =
workspace->GetBlob(input_names[i])->GetMutable<caffe2::TensorCPU>();
tensor->Resize(input_dims);
if (caffe2::FLAGS_input_type == "float") {
tensor->mutable_data<float>();
} else {
CAFFE_ENFORCE(
caffe2::FLAGS_input_type == "uint8_t",
"Only supported input types are: float, uint8_t");
tensor->mutable_data<uint8_t>();
}
}
} else {
CAFFE_THROW(
"You requested input tensors, but neither input_file nor "
"input_dims is set.");
}
}
// Run main network.
caffe2::NetDef net_def;
CAFFE_ENFORCE(ReadProtoFromFile(caffe2::FLAGS_net, &net_def));
if (caffe2::FLAGS_backend != "builtin") {
std::string engine = caffe2::FLAGS_backend == "nnpack" ? "NNPACK" :
caffe2::FLAGS_backend == "eigen" ? "EIGEN" :
caffe2::FLAGS_backend == "mkl" ? "MKLDNN" :
caffe2::FLAGS_backend == "default" ? "" : "NONE";
CAFFE_ENFORCE(engine != "NONE", "Backend is not supported");
for (int i = 0; i < net_def.op_size(); i++) {
caffe2::OperatorDef* op_def = net_def.mutable_op(i);
op_def->set_engine(engine);
}
}
caffe2::NetBase* net = workspace->CreateNet(net_def);
CHECK_NOTNULL(net);
LOG(INFO) << "Starting benchmark.";
caffe2::ObserverConfig::initSampleRate(
1, 1, 1, caffe2::FLAGS_run_individual, caffe2::FLAGS_warmup);
LOG(INFO) << "Running warmup runs.";
for (int i = 0; i < caffe2::FLAGS_warmup; ++i) {
CAFFE_ENFORCE(net->Run(), "Warmup run ", i, " has failed.");
}
LOG(INFO) << "Main runs.";
CAFFE_ENFORCE(
caffe2::FLAGS_iter >= 0,
"Number of main runs should be non negative, provided ",
caffe2::FLAGS_iter,
".");
for (int i = 0; i < caffe2::FLAGS_iter; ++i) {
caffe2::ObserverConfig::initSampleRate(1, 1, 1, 0, caffe2::FLAGS_warmup);
CAFFE_ENFORCE(net->Run(), "Main run ", i, " has failed.");
if (caffe2::FLAGS_run_individual) {
caffe2::ObserverConfig::initSampleRate(1, 1, 1, 1, caffe2::FLAGS_warmup);
CAFFE_ENFORCE(net->Run(), "Main run ", i, " with operator has failed.");
}
}
string output_prefix = caffe2::FLAGS_output_folder.size()
? caffe2::FLAGS_output_folder + "/"
: "";
if (caffe2::FLAGS_output.size()) {
vector<string> output_names = caffe2::split(',', caffe2::FLAGS_output);
if (caffe2::FLAGS_output == "*") {
output_names = workspace->Blobs();
}
for (const string& name : output_names) {
CAFFE_ENFORCE(
workspace->HasBlob(name),
"You requested a non-existing blob: ",
name);
if (caffe2::FLAGS_text_output) {
auto blob = workspace->GetBlob(name)->GetMutable<caffe2::TensorCPU>();
writeTextOutput(blob, output_prefix, name);
} else {
string serialized = workspace->GetBlob(name)->Serialize(name);
string output_filename = output_prefix + name;
caffe2::WriteStringToFile(serialized, output_filename.c_str());
}
}
}
return 0;
}
================================================
FILE: binaries/convert_caffe_image_db.cc
================================================
/**
* Copyright (c) 2016-present, Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "caffe2/core/db.h"
#include "caffe2/core/init.h"
#include "caffe2/proto/caffe2.pb.h"
#include "caffe/proto/caffe.pb.h"
#include "caffe2/core/logging.h"
CAFFE2_DEFINE_string(input_db, "", "The input db.");
CAFFE2_DEFINE_string(input_db_type, "", "The input db type.");
CAFFE2_DEFINE_string(output_db, "", "The output db.");
CAFFE2_DEFINE_string(output_db_type, "", "The output db type.");
CAFFE2_DEFINE_int(batch_size, 1000, "The write batch size.");
using caffe2::db::Cursor;
using caffe2::db::DB;
using caffe2::db::Transaction;
using caffe2::TensorProto;
using caffe2::TensorProtos;
int main(int argc, char** argv) {
caffe2::GlobalInit(&argc, &argv);
std::unique_ptr<DB> in_db(caffe2::db::CreateDB(
caffe2::FLAGS_input_db_type, caffe2::FLAGS_input_db, caffe2::db::READ));
std::unique_ptr<DB> out_db(caffe2::db::CreateDB(
caffe2::FLAGS_output_db_type, caffe2::FLAGS_output_db, caffe2::db::NEW));
std::unique_ptr<Cursor> cursor(in_db->NewCursor());
std::unique_ptr<Transaction> transaction(out_db->NewTransaction());
int count = 0;
for (; cursor->Valid(); cursor->Next()) {
caffe::Datum datum;
CAFFE_ENFORCE(datum.ParseFromString(cursor->value()));
TensorProtos protos;
TensorProto* data = protos.add_protos();
TensorProto* label = protos.add_protos();
label->set_data_type(TensorProto::INT32);
label->add_dims(1);
label->add_int32_data(datum.label());
if (datum.encoded()) {
// This is an encoded image. we will copy over the data directly.
data->set_data_type(TensorProto::STRING);
data->add_dims(1);
data->add_string_data(datum.data());
} else {
// float data not supported right now.
CAFFE_ENFORCE_EQ(datum.float_data_size(), 0);
std::vector<char> buffer_vec(datum.data().size());
char* buffer = buffer_vec.data();
// swap order from CHW to HWC
int channels = datum.channels();
int size = datum.height() * datum.width();
CAFFE_ENFORCE_EQ(datum.data().size(), channels * size);
for (int c = 0; c < channels; ++c) {
char* dst = buffer + c;
const char* src = datum.data().c_str() + c * size;
for (int n = 0; n < size; ++n) {
dst[n*channels] = src[n];
}
}
data->set_data_type(TensorProto::BYTE);
data->add_dims(datum.height());
data->add_dims(datum.width());
data->add_dims(datum.channels());
data->set_byte_data(buffer, datum.data().size());
}
transaction->Put(cursor->key(), protos.SerializeAsString());
if (++count % caffe2::FLAGS_batch_size == 0) {
transaction->Commit();
LOG(INFO) << "Converted " << count << " items so far.";
}
}
LOG(INFO) << "A total of " << count << " items processed.";
return 0;
}
================================================
FILE: binaries/convert_db.cc
================================================
/**
* Copyright (c) 2016-present, Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "caffe2/core/db.h"
#include "caffe2/core/init.h"
#include "caffe2/proto/caffe2.pb.h"
#include "caffe2/core/logging.h"
CAFFE2_DEFINE_string(input_db, "", "The input db.");
CAFFE2_DEFINE_string(input_db_type, "", "The input db type.");
CAFFE2_DEFINE_string(output_db, "", "The output db.");
CAFFE2_DEFINE_string(output_db_type, "", "The output db type.");
CAFFE2_DEFINE_int(batch_size, 1000, "The write batch size.");
using caffe2::db::Cursor;
using caffe2::db::DB;
using caffe2::db::Transaction;
int main(int argc, char** argv) {
caffe2::GlobalInit(&argc, &argv);
std::unique_ptr<DB> in_db(caffe2::db::CreateDB(
caffe2::FLAGS_input_db_type, caffe2::FLAGS_input_db, caffe2::db::READ));
std::unique_ptr<DB> out_db(caffe2::db::CreateDB(
caffe2::FLAGS_output_db_type, caffe2::FLAGS_output_db, caffe2::db::NEW));
std::unique_ptr<Cursor> cursor(in_db->NewCursor());
std::unique_ptr<Transaction> transaction(out_db->NewTransaction());
int count = 0;
for (; cursor->Valid(); cursor->Next()) {
transaction->Put(cursor->key(), cursor->value());
if (++count % caffe2::FLAGS_batch_size == 0) {
transaction->Commit();
LOG(INFO) << "Converted " << count << " items so far.";
}
}
LOG(INFO) << "A total of " << count << " items processed.";
return 0;
}
================================================
FILE: binaries/convert_encoded_to_raw_leveldb.cc
================================================
/**
* Copyright (c) 2016-present, Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// This script converts an image dataset to leveldb.
//
// caffe2::FLAGS_input_folder is the root folder that holds all the images, and
// caffe2::FLAGS_list_file should be a list of files as well as their labels, in the
// format as
// subfolder1/file1.JPEG 7
// ....
#include <opencv2/opencv.hpp>
#include <fstream> // NOLINT(readability/streams)
#include <memory>
#include <random>
#include <string>
#include "caffe2/core/init.h"
#include "caffe2/proto/caffe2.pb.h"
#include "caffe2/core/logging.h"
#include "leveldb/db.h"
#include "leveldb/write_batch.h"
CAFFE2_DEFINE_string(input_db_name, "", "The input image file name.");
CAFFE2_DEFINE_string(output_db_name, "", "The output training leveldb name.");
CAFFE2_DEFINE_bool(color, true, "If set, load images in color.");
CAFFE2_DEFINE_int(scale, 256,
"If caffe2::FLAGS_raw is set, scale all the images' shorter edge to the given "
"value.");
CAFFE2_DEFINE_bool(warp, false, "If warp is set, warp the images to square.");
namespace caffe2 {
using std::string;
using std::unique_ptr;
void ConvertToRawDataset(
const string& input_db_name, const string& output_db_name) {
// input leveldb
std::unique_ptr<leveldb::DB> input_db;
LOG(INFO) << "Opening input leveldb " << input_db_name;
{
leveldb::Options options;
options.create_if_missing = false;
leveldb::DB* db_temp;
leveldb::Status status = leveldb::DB::Open(
options, input_db_name, &db_temp);
CAFFE_ENFORCE(status.ok(), "Failed to open leveldb ", input_db_name, ".");
input_db.reset(db_temp);
}
// output leveldb
std::unique_ptr<leveldb::DB> output_db;
std::unique_ptr<leveldb::WriteBatch> batch;
LOG(INFO) << "Opening leveldb " << output_db_name;
{
leveldb::Options options;
options.error_if_exists = true;
options.create_if_missing = true;
options.write_buffer_size = 268435456;
leveldb::DB* db_temp;
leveldb::Status status = leveldb::DB::Open(
options, output_db_name, &db_temp);
CAFFE_ENFORCE(
status.ok(),
"Failed to open leveldb ",
output_db_name,
". Is it already existing?");
output_db.reset(db_temp);
}
batch.reset(new leveldb::WriteBatch());
TensorProtos input_protos;
TensorProtos output_protos;
TensorProto* data = output_protos.add_protos();
TensorProto* label = output_protos.add_protos();
data->set_data_type(TensorProto::BYTE);
data->add_dims(0);
data->add_dims(0);
if (caffe2::FLAGS_color) {
data->add_dims(3);
}
string value;
unique_ptr<leveldb::Iterator> iter;
iter.reset(input_db->NewIterator(leveldb::ReadOptions()));
iter->SeekToFirst();
int count = 0;
for (; iter->Valid(); iter->Next()) {
CAFFE_ENFORCE(input_protos.ParseFromString(iter->value().ToString()));
label->CopyFrom(input_protos.protos(1));
const string& encoded_image = input_protos.protos(0).string_data(0);
int encoded_size = encoded_image.size();
cv::Mat img = cv::imdecode(
cv::Mat(1, &encoded_size, CV_8UC1,
const_cast<char*>(encoded_image.data())),
caffe2::FLAGS_color ? CV_LOAD_IMAGE_COLOR : CV_LOAD_IMAGE_GRAYSCALE);
cv::Mat resized_img;
int scaled_width, scaled_height;
if (caffe2::FLAGS_warp) {
scaled_width = caffe2::FLAGS_scale;
scaled_height = caffe2::FLAGS_scale;
} else if (img.rows > img.cols) {
scaled_width = caffe2::FLAGS_scale;
scaled_height = static_cast<float>(img.rows) * caffe2::FLAGS_scale / img.cols;
} else {
scaled_height = caffe2::FLAGS_scale;
scaled_width = static_cast<float>(img.cols) * caffe2::FLAGS_scale / img.rows;
}
cv::resize(img, resized_img, cv::Size(scaled_width, scaled_height), 0, 0,
cv::INTER_LINEAR);
data->set_dims(0, scaled_height);
data->set_dims(1, scaled_width);
DCHECK(resized_img.isContinuous());
data->set_byte_data(resized_img.ptr(),
scaled_height * scaled_width * (caffe2::FLAGS_color ? 3 : 1));
output_protos.SerializeToString(&value);
// Put in db
batch->Put(iter->key(), value);
if (++count % 1000 == 0) {
output_db->Write(leveldb::WriteOptions(), batch.get());
batch.reset(new leveldb::WriteBatch());
LOG(INFO) << "Processed " << count << " files.";
}
}
// write the last batch
if (count % 1000 != 0) {
output_db->Write(leveldb::WriteOptions(), batch.get());
}
LOG(INFO) << "Processed a total of " << count << " files.";
}
} // namespace caffe2
int main(int argc, char** argv) {
caffe2::GlobalInit(&argc, &argv);
caffe2::ConvertToRawDataset(
caffe2::FLAGS_input_db_name, caffe2::FLAGS_output_db_name);
return 0;
}
================================================
FILE: binaries/core_overhead_benchmark.cc
================================================
/**
* Copyright (c) 2016-present, Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "benchmark/benchmark.h"
#include "caffe2/core/context.h"
#include "caffe2/core/context_gpu.h"
#include "caffe2/core/operator.h"
#define CAFFE2_SKIP_IF_NO_GPU \
if (!caffe2::NumCudaDevices()) { \
state.SkipWithError("No CUDA available, skipping benchmark."); \
return; \
}
using namespace caffe2;
static void BM_CUDAContextCreation(benchmark::State& state) {
CAFFE2_SKIP_IF_NO_GPU;
volatile CUDAContext context_so_we_do_initialization_work;
while (state.KeepRunning()) {
volatile CUDAContext context;
}
}
BENCHMARK(BM_CUDAContextCreation);
static void BM_CUDAContextStreamAccess(benchmark::State& state) {
CAFFE2_SKIP_IF_NO_GPU;
CUDAContext context;
while (state.KeepRunning()) {
volatile cudaStream_t stream = context.cuda_stream();
}
}
BENCHMARK(BM_CUDAContextStreamAccess);
static void BM_cudaGetDevice(benchmark::State& state) {
CAFFE2_SKIP_IF_NO_GPU;
int id;
while (state.KeepRunning()) {
CUDA_ENFORCE(cudaGetDevice(&id));
}
}
BENCHMARK(BM_cudaGetDevice);
static void BM_cudaSetDevice(benchmark::State& state) {
CAFFE2_SKIP_IF_NO_GPU;
int total = NumCudaDevices();
int i = 0;
while (state.KeepRunning()) {
CUDA_ENFORCE(cudaSetDevice((i++) % total));
}
}
BENCHMARK(BM_cudaSetDevice);
static void BM_cudaSetAndGetDevice(benchmark::State& state) {
CAFFE2_SKIP_IF_NO_GPU;
int total = NumCudaDevices();
int i = 0;
int id;
while (state.KeepRunning()) {
CUDA_ENFORCE(cudaSetDevice((i++) % total));
CUDA_ENFORCE(cudaGetDevice(&id));
}
}
BENCHMARK(BM_cudaSetAndGetDevice);
static void BM_cudaSetSameDevice(benchmark::State& state) {
CAFFE2_SKIP_IF_NO_GPU;
while (state.KeepRunning()) {
CUDA_ENFORCE(cudaSetDevice(0));
}
}
BENCHMARK(BM_cudaSetSameDevice);
static void BM_cudaStreamCreateSyncDelete(benchmark::State& state) {
CAFFE2_SKIP_IF_NO_GPU;
cudaStream_t stream;
while (state.KeepRunning()) {
CUDA_ENFORCE(cudaStreamCreate(&stream));
CUDA_ENFORCE(cudaStreamSynchronize(stream));
CUDA_ENFORCE(cudaStreamDestroy(stream));
}
}
BENCHMARK(BM_cudaStreamCreateSyncDelete);
static void BM_cudaStreamSynchronize(benchmark::State& state) {
CAFFE2_SKIP_IF_NO_GPU;
cudaStream_t stream;
CUDA_ENFORCE(cudaStreamCreate(&stream));
while (state.KeepRunning()) {
CUDA_ENFORCE(cudaStreamSynchronize(stream));
}
}
BENCHMARK(BM_cudaStreamSynchronize);
static void BM_cudaEventRecord(benchmark::State& state) {
CAFFE2_SKIP_IF_NO_GPU;
cudaStream_t stream;
cudaEvent_t event;
CUDA_ENFORCE(cudaStreamCreate(&stream));
CUDA_ENFORCE(cudaEventCreateWithFlags(
&event, cudaEventDefault | cudaEventDisableTiming));
while (state.KeepRunning()) {
CUDA_ENFORCE(cudaEventRecord(event, stream));
}
}
BENCHMARK(BM_cudaEventRecord);
static void BM_cudaStreamWaitEventThenStreamSynchronize(
benchmark::State& state) {
CAFFE2_SKIP_IF_NO_GPU;
cudaStream_t stream;
cudaEvent_t event;
CUDA_ENFORCE(cudaStreamCreate(&stream));
CUDA_ENFORCE(cudaEventCreateWithFlags(
&event, cudaEventDefault | cudaEventDisableTiming));
CUDA_ENFORCE(cudaEventRecord(event, stream));
CUDA_ENFORCE(cudaStreamWaitEvent(stream, event, 0));
CUDA_ENFORCE(cudaStreamSynchronize(stream));
while (state.KeepRunning()) {
CUDA_ENFORCE(cudaStreamWaitEvent(stream, event, 0));
CUDA_ENFORCE(cudaStreamSynchronize(stream));
}
}
BENCHMARK(BM_cudaStreamWaitEventThenStreamSynchronize);
static void BM_CudaPointerAffinity(benchmark::State& state) {
CAFFE2_SKIP_IF_NO_GPU;
TensorCUDA tensor(vector<TIndex>{1, 2, 3, 4});
float* ptr = tensor.mutable_data<float>();
while (state.KeepRunning()) {
volatile int id = GetGPUIDForPointer(ptr);
}
}
BENCHMARK(BM_CudaPointerAffinity);
namespace {
template <class Context>
class DummyEmptyOp : public Operator<Context> {
public:
DummyEmptyOp(const OperatorDef& def, Workspace* ws)
: Operator<Context>(def, ws) {}
bool RunOnDevice() final { return true; }
};
REGISTER_CPU_OPERATOR(DummyEmpty, DummyEmptyOp<CPUContext>);
REGISTER_CUDA_OPERATOR(DummyEmpty, DummyEmptyOp<CUDAContext>);
OPERATOR_SCHEMA(DummyEmpty);
} // namespace
static void BM_OperatorCreationCPU(benchmark::State& state) {
std::unique_ptr<OperatorBase> op;
OperatorDef def;
Workspace ws;
def.set_type("DummyEmpty");
def.mutable_device_option()->set_device_type(CPU);
while (state.KeepRunning()) {
op = CreateOperator(def, &ws);
}
}
BENCHMARK(BM_OperatorCreationCPU);
static void BM_OperatorCreationCUDA(benchmark::State& state) {
CAFFE2_SKIP_IF_NO_GPU;
std::unique_ptr<OperatorBase> op;
OperatorDef def;
Workspace ws;
def.set_type("DummyEmpty");
def.mutable_device_option()->set_device_type(CUDA);
while (state.KeepRunning()) {
op = CreateOperator(def, &ws);
}
}
BENCHMARK(BM_OperatorCreationCUDA);
static void BM_RawAllocDeallocCPU(benchmark::State& state) {
while (state.KeepRunning()) {
// Allocating only 1 byte in order to measure the overhead.
auto ptr_and_deleter = GetCPUAllocator()->New(1);
// Deallocate.
ptr_and_deleter.second(ptr_and_deleter.first);
}
}
BENCHMARK(BM_RawAllocDeallocCPU);
static void BM_TensorAllocDeallocCPU(benchmark::State& state) {
Tensor<CPUContext> tensor;
// small allocation
tensor.Resize(32, 32);
while (state.KeepRunning()) {
CHECK(tensor.mutable_data<float>());
tensor.FreeMemory();
}
}
BENCHMARK(BM_TensorAllocDeallocCPU);
static void BM_TensorAllocDeallocCUDA(benchmark::State& state) {
CAFFE2_SKIP_IF_NO_GPU;
Tensor<CUDAContext> tensor;
// small allocation
tensor.Resize(32, 32);
while (state.KeepRunning()) {
CHECK(tensor.mutable_data<float>());
tensor.FreeMemory();
}
}
BENCHMARK(BM_TensorAllocDeallocCUDA);
BENCHMARK_MAIN()
================================================
FILE: binaries/db_throughput.cc
================================================
/**
* Copyright (c) 2016-present, Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <cstdio>
#include <thread>
#include <vector>
#include "caffe2/core/db.h"
#include "caffe2/core/init.h"
#include "caffe2/core/timer.h"
#include "caffe2/core/logging.h"
CAFFE2_DEFINE_string(input_db, "", "The input db.");
CAFFE2_DEFINE_string(input_db_type, "", "The input db type.");
CAFFE2_DEFINE_int(report_interval, 1000, "The report interval.");
CAFFE2_DEFINE_int(repeat, 10, "The number to repeat the throughput test.");
CAFFE2_DEFINE_bool(use_reader, false, "If true, use the reader interface.");
CAFFE2_DEFINE_int(num_read_threads, 1,
"The number of concurrent reading threads.");
using caffe2::db::Cursor;
using caffe2::db::DB;
using caffe2::db::DBReader;
using caffe2::string;
void TestThroughputWithDB() {
std::unique_ptr<DB> in_db(caffe2::db::CreateDB(
caffe2::FLAGS_input_db_type, caffe2::FLAGS_input_db, caffe2::db::READ));
std::unique_ptr<Cursor> cursor(in_db->NewCursor());
for (int iter_id = 0; iter_id < caffe2::FLAGS_repeat; ++iter_id) {
caffe2::Timer timer;
for (int i = 0; i < caffe2::FLAGS_report_interval; ++i) {
string key = cursor->key();
string value = cursor->value();
//VLOG(1) << "Key " << key;
cursor->Next();
if (!cursor->Valid()) {
cursor->SeekToFirst();
}
}
double elapsed_seconds = timer.Seconds();
printf("Iteration %03d, took %4.5f seconds, throughput %f items/sec.\n",
iter_id, elapsed_seconds,
caffe2::FLAGS_report_interval / elapsed_seconds);
}
}
void TestThroughputWithReaderWorker(const DBReader* reader, int thread_id) {
string key, value;
for (int iter_id = 0; iter_id < caffe2::FLAGS_repeat; ++iter_id) {
caffe2::Timer timer;
for (int i = 0; i < caffe2::FLAGS_report_interval; ++i) {
reader->Read(&key, &value);
}
double elapsed_seconds = timer.Seconds();
printf("Thread %03d iteration %03d, took %4.5f seconds, "
"throughput %f items/sec.\n",
thread_id, iter_id, elapsed_seconds,
caffe2::FLAGS_report_interval / elapsed_seconds);
}
}
void TestThroughputWithReader() {
caffe2::db::DBReader reader(
caffe2::FLAGS_input_db_type, caffe2::FLAGS_input_db);
std::vector<std::unique_ptr<std::thread>> reading_threads(
caffe2::FLAGS_num_read_threads);
for (int i = 0; i < reading_threads.size(); ++i) {
reading_threads[i].reset(new std::thread(
TestThroughputWithReaderWorker, &reader, i));
}
for (int i = 0; i < reading_threads.size(); ++i) {
reading_threads[i]->join();
}
}
int main(int argc, char** argv) {
caffe2::GlobalInit(&argc, &argv);
if (caffe2::FLAGS_use_reader) {
TestThroughputWithReader();
} else {
TestThroughputWithDB();
}
return 0;
}
================================================
FILE: binaries/inspect_gpus.cc
================================================
/**
* Copyright (c) 2016-present, Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <cuda_runtime.h>
#include <sstream>
#include <vector>
#include "caffe2/core/common_gpu.h"
#include "caffe2/core/init.h"
#include "caffe2/core/logging.h"
using std::vector;
CAFFE2_DECLARE_int(caffe2_log_level);
int main(int argc, char** argv) {
caffe2::GlobalInit(&argc, &argv);
caffe2::SetUsageMessage(
"Inspects the GPUs on the current machine and prints out their details "
"provided by cuda.");
int gpu_count;
CUDA_ENFORCE(cudaGetDeviceCount(&gpu_count));
for (int i = 0; i < gpu_count; ++i) {
LOG(INFO) << "Querying device ID = " << i;
caffe2::DeviceQuery(i);
}
vector<vector<bool> > access_pattern;
CAFFE_ENFORCE(caffe2::GetCudaPeerAccessPattern(&access_pattern));
std::stringstream sstream;
// Find topology
for (int i = 0; i < gpu_count; ++i) {
for (int j = 0; j < gpu_count; ++j) {
sstream << (access_pattern[i][j] ? "+" : "-") << " ";
}
sstream << std::endl;
}
LOG(INFO) << "Access pattern: " << std::endl << sstream.str();
return 0;
}
================================================
FILE: binaries/make_cifar_db.cc
================================================
/**
* Copyright (c) 2016-present, Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
//
// This script converts the CIFAR dataset to the leveldb format used
// by caffe to perform classification.
// Usage:
// convert_cifar_data input_folder output_db_file
// The CIFAR dataset could be downloaded at
// http://www.cs.toronto.edu/~kriz/cifar.html
#include <array>
#include <fstream> // NOLINT(readability/streams)
#include <sstream>
#include <string>
#include "caffe2/core/common.h"
#include "caffe2/core/db.h"
#include "caffe2/core/init.h"
#include "caffe2/proto/caffe2.pb.h"
#include "caffe2/core/logging.h"
CAFFE2_DEFINE_string(input_folder, "", "The input folder name.");
CAFFE2_DEFINE_string(output_train_db_name,
"", "The output training db name.");
CAFFE2_DEFINE_string(output_test_db_name,
"", "The output testing db name.");
CAFFE2_DEFINE_string(db, "leveldb", "The db type.");
CAFFE2_DEFINE_bool(is_cifar100, false,
"If set, convert cifar100. Otherwise do cifar10.");
namespace caffe2 {
using std::stringstream;
const int kCIFARSize = 32;
const int kCIFARImageNBytes = kCIFARSize * kCIFARSize * 3;
const int kCIFAR10BatchSize = 10000;
const int kCIFAR10TestDataSize = 10000;
const int kCIFAR10TrainBatches = 5;
const int kCIFAR100TrainDataSize = 50000;
const int kCIFAR100TestDataSize = 10000;
void ReadImage(std::ifstream* file, int* label, char* buffer) {
char label_char;
if (caffe2::FLAGS_is_cifar100) {
// Skip the coarse label.
file->read(&label_char, 1);
}
file->read(&label_char, 1);
*label = label_char;
// Yes, there are better ways to do it, like in-place swap... but I am too
// lazy so let's just write it in a memory-wasteful way.
std::array<char, kCIFARImageNBytes> channel_first_storage;
file->read(channel_first_storage.data(), kCIFARImageNBytes);
for (int c = 0; c < 3; ++c) {
for (int i = 0; i < kCIFARSize * kCIFARSize; ++i) {
buffer[i * 3 + c] =
channel_first_storage[c * kCIFARSize * kCIFARSize + i];
}
}
return;
}
void WriteToDB(const string& filename, const int num_items,
const int& offset, db::DB* db) {
TensorProtos protos;
TensorProto* data = protos.add_protos();
TensorProto* label = protos.add_protos();
data->set_data_type(TensorProto::BYTE);
data->add_dims(kCIFARSize);
data->add_dims(kCIFARSize);
data->add_dims(3);
label->set_data_type(TensorProto::INT32);
label->add_dims(1);
label->add_int32_data(0);
LOG(INFO) << "Converting file " << filename;
std::ifstream data_file(filename.c_str(),
std::ios::in | std::ios::binary);
CAFFE_ENFORCE(data_file, "Unable to open file ", filename);
char str_buffer[kCIFARImageNBytes];
int label_value;
string serialized_protos;
std::unique_ptr<db::Transaction> transaction(db->NewTransaction());
for (int itemid = 0; itemid < num_items; ++itemid) {
ReadImage(&data_file, &label_value, str_buffer);
data->set_byte_data(str_buffer, kCIFARImageNBytes);
label->set_int32_data(0, label_value);
protos.SerializeToString(&serialized_protos);
snprintf(str_buffer, kCIFARImageNBytes, "%05d",
offset + itemid);
transaction->Put(string(str_buffer), serialized_protos);
}
}
void ConvertCIFAR() {
std::unique_ptr<db::DB> train_db(
db::CreateDB(caffe2::FLAGS_db, caffe2::FLAGS_output_train_db_name,
db::NEW));
std::unique_ptr<db::DB> test_db(
db::CreateDB(caffe2::FLAGS_db, caffe2::FLAGS_output_test_db_name,
db::NEW));
if (!caffe2::FLAGS_is_cifar100) {
// This is cifar 10.
for (int fileid = 0; fileid < kCIFAR10TrainBatches; ++fileid) {
stringstream train_file;
train_file << caffe2::FLAGS_input_folder << "/data_batch_" << fileid + 1
<< ".bin";
WriteToDB(train_file.str(), kCIFAR10BatchSize,
fileid * kCIFAR10BatchSize, train_db.get());
}
stringstream test_file;
test_file << caffe2::FLAGS_input_folder << "/test_batch.bin";
WriteToDB(test_file.str(), kCIFAR10TestDataSize, 0, test_db.get());
} else {
// This is cifar 100.
stringstream train_file;
train_file << caffe2::FLAGS_input_folder << "/train.bin";
WriteToDB(train_file.str(), kCIFAR100TrainDataSize, 0, train_db.get());
stringstream test_file;
test_file << caffe2::FLAGS_input_folder << "/test.bin";
WriteToDB(test_file.str(), kCIFAR100TestDataSize, 0, test_db.get());
}
}
} // namespace caffe2
int main(int argc, char** argv) {
caffe2::GlobalInit(&argc, &argv);
caffe2::ConvertCIFAR();
return 0;
}
================================================
FILE: binaries/make_image_db.cc
================================================
/**
* Copyright (c) 2016-present, Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// This script converts an image dataset to a database.
//
// caffe2::FLAGS_input_folder is the root folder that holds all the images
//
// caffe2::FLAGS_list_file is the path to a file containing a list of files
// and their labels, as follows:
//
// subfolder1/file1.JPEG 7
// subfolder1/file2.JPEG 7
// subfolder2/file1.JPEG 8
// ...
//
#include <opencv2/opencv.hpp>
#include <algorithm>
#include <fstream>
#include <queue>
#include <random>
#include <string>
#include <thread>
#include "caffe2/core/common.h"
#include "caffe2/core/db.h"
#include "caffe2/core/init.h"
#include "caffe2/proto/caffe2.pb.h"
#include "caffe2/core/logging.h"
CAFFE2_DEFINE_bool(shuffle, false,
"Randomly shuffle the order of images and their labels");
CAFFE2_DEFINE_string(input_folder, "", "The input image file name.");
CAFFE2_DEFINE_string(
list_file,
"",
"The text file containing the list of images.");
CAFFE2_DEFINE_string(output_db_name, "", "The output training leveldb name.");
CAFFE2_DEFINE_string(db, "leveldb", "The db type.");
CAFFE2_DEFINE_bool(raw, false,
"If set, we pre-read the images and store the raw buffer.");
CAFFE2_DEFINE_bool(color, true, "If set, load images in color.");
CAFFE2_DEFINE_int(
scale,
256,
"If caffe2::FLAGS_raw is set, scale the shorter edge to the given value.");
CAFFE2_DEFINE_bool(warp, false, "If warp is set, warp the images to square.");
CAFFE2_DEFINE_int(
num_threads,
-1,
"Number of image parsing and conversion threads.");
namespace caffe2 {
class Converter {
public:
explicit Converter() {
data_ = protos_.add_protos();
label_ = protos_.add_protos();
if (caffe2::FLAGS_raw) {
data_->set_data_type(TensorProto::BYTE);
data_->add_dims(0);
data_->add_dims(0);
if (caffe2::FLAGS_color) {
data_->add_dims(3);
}
} else {
data_->set_data_type(TensorProto::STRING);
data_->add_dims(1);
data_->add_string_data("");
}
label_->set_data_type(TensorProto::INT32);
label_->add_dims(1);
label_->add_int32_data(0);
}
~Converter() {
if (thread_.joinable()) {
thread_.join();
}
}
void queue(const std::pair<std::string, int>& pair) {
in_.push(pair);
}
void start() {
thread_ = std::thread(&Converter::run, this);
}
std::string get() {
std::unique_lock<std::mutex> lock(mutex_);
while (out_.empty()) {
cv_.wait(lock);
}
auto value = out_.front();
out_.pop();
cv_.notify_one();
return value;
}
void run() {
const auto& input_folder = caffe2::FLAGS_input_folder;
std::unique_lock<std::mutex> lock(mutex_);
std::string value;
while (!in_.empty()) {
auto pair = in_.front();
in_.pop();
lock.unlock();
label_->set_int32_data(0, pair.second);
// Add raw file contents to DB if !raw
if (!caffe2::FLAGS_raw) {
std::ifstream image_file_stream(input_folder + pair.first);
if (!image_file_stream) {
LOG(ERROR) << "Cannot open " << input_folder << pair.first
<< ". Skipping.";
} else {
data_->mutable_string_data(0)->assign(
std::istreambuf_iterator<char>(image_file_stream),
std::istreambuf_iterator<char>());
}
} else {
// Load image
cv::Mat img = cv::imread(
input_folder + pair.first,
caffe2::FLAGS_color ? CV_LOAD_IMAGE_COLOR
: CV_LOAD_IMAGE_GRAYSCALE);
// Resize image
cv::Mat resized_img;
int scaled_width, scaled_height;
if (caffe2::FLAGS_warp) {
scaled_width = caffe2::FLAGS_scale;
scaled_height = caffe2::FLAGS_scale;
} else if (img.rows > img.cols) {
scaled_width = caffe2::FLAGS_scale;
scaled_height =
static_cast<float>(img.rows) * caffe2::FLAGS_scale / img.cols;
} else {
scaled_height = caffe2::FLAGS_scale;
scaled_width =
static_cast<float>(img.cols) * caffe2::FLAGS_scale / img.rows;
}
cv::resize(
img,
resized_img,
cv::Size(scaled_width, scaled_height),
0,
0,
cv::INTER_LINEAR);
data_->set_dims(0, scaled_height);
data_->set_dims(1, scaled_width);
// Assert we don't have to deal with alignment
DCHECK(resized_img.isContinuous());
auto nbytes = resized_img.total() * resized_img.elemSize();
data_->set_byte_data(resized_img.ptr(), nbytes);
}
protos_.SerializeToString(&value);
// Add serialized proto to out queue or wait if it is not empty
lock.lock();
while (!out_.empty()) {
cv_.wait(lock);
}
out_.push(value);
cv_.notify_one();
}
}
protected:
TensorProtos protos_;
TensorProto* data_;
TensorProto* label_;
std::queue<std::pair<std::string, int>> in_;
std::queue<std::string> out_;
std::mutex mutex_;
std::condition_variable cv_;
std::thread thread_;
};
void ConvertImageDataset(
const string& input_folder,
const string& list_filename,
const string& output_db_name,
const bool /*shuffle*/) {
std::ifstream list_file(list_filename);
std::vector<std::pair<std::string, int> > lines;
std::string filename;
int file_label;
while (list_file >> filename >> file_label) {
lines.push_back(std::make_pair(filename, file_label));
}
if (caffe2::FLAGS_shuffle) {
LOG(INFO) << "Shuffling data";
std::shuffle(lines.begin(), lines.end(), std::default_random_engine(1701));
}
auto num_threads = caffe2::FLAGS_num_threads;
if (num_threads < 1) {
num_threads = std::thread::hardware_concurrency();
}
LOG(INFO) << "Processing " << lines.size() << " images...";
LOG(INFO) << "Opening DB " << output_db_name;
auto db = db::CreateDB(caffe2::FLAGS_db, output_db_name, db::NEW);
auto transaction = db->NewTransaction();
LOG(INFO) << "Using " << num_threads << " processing threads...";
std::vector<Converter> converters(num_threads);
// Queue entries across converters
for (auto i = 0; i < lines.size(); i++) {
converters[i % converters.size()].queue(lines[i]);
}
// Start all converters
for (auto& converter : converters) {
converter.start();
}
constexpr auto key_max_length = 256;
char key_cstr[key_max_length];
string value;
int count = 0;
for (auto i = 0; i < lines.size(); i++) {
// Get serialized proto for this entry
auto value = converters[i % converters.size()].get();
// Synthesize key for this entry
auto key_len = snprintf(
key_cstr, sizeof(key_cstr), "%08d_%s", i, lines[i].first.c_str());
DCHECK_LE(key_len, sizeof(key_cstr));
// Put in db
transaction->Put(string(key_cstr), value);
if (++count % 1000 == 0) {
// Commit the current writes.
transaction->Commit();
LOG(INFO) << "Processed " << count << " files.";
}
}
// Commit final transaction
transaction->Commit();
LOG(INFO) << "Processed " << count << " files.";
}
} // namespace caffe2
int main(int argc, char** argv) {
caffe2::GlobalInit(&argc, &argv);
caffe2::ConvertImageDataset(
caffe2::FLAGS_input_folder, caffe2::FLAGS_list_file,
caffe2::FLAGS_output_db_name, caffe2::FLAGS_shuffle);
return 0;
}
================================================
FILE: binaries/make_mnist_db.cc
================================================
/**
* Copyright (c) 2016-present, Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// This script converts the MNIST dataset to leveldb.
// The MNIST dataset could be downloaded at
// http://yann.lecun.com/exdb/mnist/
#include <fstream> // NOLINT(readability/streams)
#include <string>
#include "caffe2/core/common.h"
#include "caffe2/core/db.h"
#include "caffe2/core/init.h"
#include "caffe2/proto/caffe2.pb.h"
#include "caffe2/core/logging.h"
CAFFE2_DEFINE_string(image_file, "", "The input image file name.");
CAFFE2_DEFINE_string(label_file, "", "The label file name.");
CAFFE2_DEFINE_string(output_file, "", "The output db name.");
CAFFE2_DEFINE_string(db, "leveldb", "The db type.");
CAFFE2_DEFINE_int(data_limit, -1,
"If set, only output this number of data points.");
CAFFE2_DEFINE_bool(channel_first, false,
"If set, write the data as channel-first (CHW order) as the old "
"Caffe does.");
namespace caffe2 {
uint32_t swap_endian(uint32_t val) {
val = ((val << 8) & 0xFF00FF00) | ((val >> 8) & 0xFF00FF);
return (val << 16) | (val >> 16);
}
void convert_dataset(const char* image_filename, const char* label_filename,
const char* db_path, const int data_limit) {
// Open files
std::ifstream image_file(image_filename, std::ios::in | std::ios::binary);
std::ifstream label_file(label_filename, std::ios::in | std::ios::binary);
CAFFE_ENFORCE(image_file, "Unable to open file ", image_filename);
CAFFE_ENFORCE(label_file, "Unable to open file ", label_filename);
// Read the magic and the meta data
uint32_t magic;
uint32_t num_items;
uint32_t num_labels;
uint32_t rows;
uint32_t cols;
image_file.read(reinterpret_cast<char*>(&magic), 4);
magic = swap_endian(magic);
if (magic == 529205256) {
LOG(FATAL) <<
"It seems that you forgot to unzip the mnist dataset. You should "
"first unzip them using e.g. gunzip on Linux.";
}
CAFFE_ENFORCE_EQ(magic, 2051, "Incorrect image file magic.");
label_file.read(reinterpret_cast<char*>(&magic), 4);
magic = swap_endian(magic);
CAFFE_ENFORCE_EQ(magic, 2049, "Incorrect label file magic.");
image_file.read(reinterpret_cast<char*>(&num_items), 4);
num_items = swap_endian(num_items);
label_file.read(reinterpret_cast<char*>(&num_labels), 4);
num_labels = swap_endian(num_labels);
CAFFE_ENFORCE_EQ(num_items, num_labels);
image_file.read(reinterpret_cast<char*>(&rows), 4);
rows = swap_endian(rows);
image_file.read(reinterpret_cast<char*>(&cols), 4);
cols = swap_endian(cols);
// leveldb
std::unique_ptr<db::DB> mnist_db(db::CreateDB(caffe2::FLAGS_db, db_path, db::NEW));
std::unique_ptr<db::Transaction> transaction(mnist_db->NewTransaction());
// Storing to db
char label_value;
std::vector<char> pixels(rows * cols);
int count = 0;
const int kMaxKeyLength = 10;
char key_cstr[kMaxKeyLength];
string value;
TensorProtos protos;
TensorProto* data = protos.add_protos();
TensorProto* label = protos.add_protos();
data->set_data_type(TensorProto::BYTE);
if (caffe2::FLAGS_channel_first) {
data->add_dims(1);
data->add_dims(rows);
data->add_dims(cols);
} else {
data->add_dims(rows);
data->add_dims(cols);
data->add_dims(1);
}
label->set_data_type(TensorProto::INT32);
label->add_int32_data(0);
LOG(INFO) << "A total of " << num_items << " items.";
LOG(INFO) << "Rows: " << rows << " Cols: " << cols;
for (int item_id = 0; item_id < num_items; ++item_id) {
image_file.read(pixels.data(), rows * cols);
label_file.read(&label_value, 1);
for (int i = 0; i < rows * cols; ++i) {
data->set_byte_data(pixels.data(), rows * cols);
}
label->set_int32_data(0, static_cast<int>(label_value));
snprintf(key_cstr, kMaxKeyLength, "%08d", item_id);
protos.SerializeToString(&value);
string keystr(key_cstr);
// Put in db
transaction->Put(keystr, value);
if (++count % 1000 == 0) {
transaction->Commit();
}
if (data_limit > 0 && count == data_limit) {
LOG(INFO) << "Reached data limit of " << data_limit << ", stop.";
break;
}
}
}
} // namespace caffe2
int main(int argc, char** argv) {
caffe2::GlobalInit(&argc, &argv);
caffe2::convert_dataset(caffe2::FLAGS_image_file.c_str(), caffe2::FLAGS_label_file.c_str(),
caffe2::FLAGS_output_file.c_str(), caffe2::FLAGS_data_limit);
return 0;
}
================================================
FILE: binaries/predictor_verifier.cc
================================================
/**
* Copyright (c) 2016-present, Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "caffe2/core/flags.h"
#include "caffe2/core/init.h"
#include "caffe2/core/predictor.h"
#include "caffe2/utils/proto_utils.h"
CAFFE2_DEFINE_string(init_net, "", "The given path to the init protobuffer.");
CAFFE2_DEFINE_string(
predict_net,
"",
"The given path to the predict protobuffer.");
namespace caffe2 {
void run() {
if (FLAGS_init_net.empty()) {
LOG(FATAL) << "No init net specified. Use --init_net=/path/to/net.";
}
if (FLAGS_predict_net.empty()) {
LOG(FATAL) << "No predict net specified. Use --predict_net=/path/to/net.";
}
caffe2::NetDef init_net, predict_net;
CAFFE_ENFORCE(ReadProtoFromFile(FLAGS_init_net, &init_net));
CAFFE_ENFORCE(ReadProtoFromFile(FLAGS_predict_net, &predict_net));
// Can be large due to constant fills
VLOG(1) << "Init net: " << ProtoDebugString(init_net);
LOG(INFO) << "Predict net: " << ProtoDebugString(predict_net);
auto predictor = caffe2::make_unique<Predictor>(init_net, predict_net);
LOG(INFO) << "Checking that a null forward-pass works";
Predictor::TensorVector inputVec, outputVec;
predictor->run(inputVec, &outputVec);
CAFFE_ENFORCE_GT(outputVec.size(), 0);
}
}
int main(int argc, char** argv) {
caffe2::GlobalInit(&argc, &argv);
caffe2::run();
// This is to allow us to use memory leak checks.
google::protobuf::ShutdownProtobufLibrary();
return 0;
}
================================================
FILE: binaries/print_core_object_sizes.cc
================================================
/**
* Copyright (c) 2016-present, Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <iostream>
#include "caffe2/core/init.h"
#include "caffe2/core/operator.h"
#include "caffe2/core/context.h"
#include "caffe2/core/context_gpu.h"
#include "caffe2/proto/caffe2.pb.h"
#define PRINT_SIZE(cls) \
std::cout << "Size of " #cls ": " << sizeof(cls) << " bytes." \
<< std::endl;
int main(int /* unused */, char** /* unused */) {
PRINT_SIZE(caffe2::Blob);
PRINT_SIZE(caffe2::Tensor<caffe2::CPUContext>);
PRINT_SIZE(caffe2::Tensor<caffe2::CUDAContext>);
PRINT_SIZE(caffe2::CPUContext);
PRINT_SIZE(caffe2::CUDAContext);
PRINT_SIZE(caffe2::OperatorBase);
PRINT_SIZE(caffe2::OperatorDef);
PRINT_SIZE(caffe2::Operator<caffe2::CPUContext>);
PRINT_SIZE(caffe2::Operator<caffe2::CUDAContext>);
PRINT_SIZE(caffe2::TypeMeta);
PRINT_SIZE(caffe2::Workspace);
return 0;
}
================================================
FILE: binaries/print_registered_core_operators.cc
================================================
/**
* Copyright (c) 2016-present, Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <iostream>
#include <string>
#include "caffe2/core/init.h"
#include "caffe2/core/operator.h"
#include "caffe2/core/operator_schema.h"
CAFFE2_DEFINE_string(schema, "",
"Print doc and schema of a particular operator");
static bool HasSchema(const std::string& str) {
return caffe2::OpSchemaRegistry::Schema(str);
}
static bool HasDoc(const std::string& str) {
const auto* schema = caffe2::OpSchemaRegistry::Schema(str);
return (schema != nullptr) && (schema->doc() != nullptr);
}
int main(int argc, char** argv) {
caffe2::GlobalInit(&argc, &argv);
if (!caffe2::FLAGS_schema.empty()) {
const auto* schema = caffe2::OpSchemaRegistry::Schema(
caffe2::FLAGS_schema);
if (!schema) {
std::cerr << "Operator " << caffe2::FLAGS_schema
<< " doesn't have a schema" << std::endl;
return 1;
}
std::cout << "Operator " << caffe2::FLAGS_schema << ": " << std::endl
<< *schema;
return 0;
}
for (const auto& pair : *caffe2::gDeviceTypeRegistry()) {
std::cout << "Device type " << pair.first
#ifndef CAFFE2_USE_LITE_PROTO
<< " (" << caffe2::DeviceType_Name(
static_cast<caffe2::DeviceType>(pair.first))
<< ")"
#endif
<< std::endl;
for (const auto& key : pair.second->Keys()) {
std::cout << "\t(schema: " << HasSchema(key) << ", doc: " << HasDoc(key)
<< ")\t" << key << std::endl;
}
}
std::cout << "Operators that have gradients registered:" << std::endl;
for (const auto& key : caffe2::GradientRegistry()->Keys()) {
std::cout << "\t(schema: " << HasSchema(key) << ", doc: "
<< HasDoc(key) << ")\t"
<< key << std::endl;
}
return 0;
}
================================================
FILE: binaries/run_plan.cc
================================================
/**
* Copyright (c) 2016-present, Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "caffe2/core/init.h"
#include "caffe2/core/operator.h"
#include "caffe2/proto/caffe2.pb.h"
#include "caffe2/utils/proto_utils.h"
#include "caffe2/core/logging.h"
CAFFE2_DEFINE_string(plan, "", "The given path to the plan protobuffer.");
int main(int argc, char** argv) {
caffe2::GlobalInit(&argc, &argv);
if (caffe2::FLAGS_plan.size() == 0) {
LOG(ERROR) << "No plan specified. Use --plan=/path/to/plan.";
return 0;
}
LOG(INFO) << "Loading plan: " << caffe2::FLAGS_plan;
caffe2::PlanDef plan_def;
CAFFE_ENFORCE(ReadProtoFromFile(caffe2::FLAGS_plan, &plan_def));
std::unique_ptr<caffe2::Workspace> workspace(new caffe2::Workspace());
workspace->RunPlan(plan_def);
// This is to allow us to use memory leak checks.
google::protobuf::ShutdownProtobufLibrary();
return 0;
}
================================================
FILE: binaries/run_plan_mpi.cc
================================================
/**
* Copyright (c) 2016-present, Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <mpi.h>
#include "caffe2/core/init.h"
#include "caffe2/core/operator.h"
#include "caffe2/proto/caffe2.pb.h"
#include "caffe2/utils/proto_utils.h"
#include "caffe2/core/logging.h"
CAFFE2_DEFINE_string(plan, "", "The given path to the plan protobuffer.");
int main(int argc, char** argv) {
caffe2::SetUsageMessage("Runs a caffe2 plan that has MPI operators in it.");
int mpi_ret;
MPI_Init_thread(&argc, &argv, MPI_THREAD_MULTIPLE, &mpi_ret);
if (mpi_ret != MPI_THREAD_MULTIPLE &&
mpi_ret != MPI_THREAD_SERIALIZED) {
std::cerr << "Caffe2 MPI requires the underlying MPI to support the "
"MPI_THREAD_SERIALIZED or MPI_THREAD_MULTIPLE mode.\n";
return 1;
}
caffe2::GlobalInit(&argc, &argv);
LOG(INFO) << "Loading plan: " << caffe2::FLAGS_plan;
caffe2::PlanDef plan_def;
CAFFE_ENFORCE(ReadProtoFromFile(caffe2::FLAGS_plan, &plan_def));
std::unique_ptr<caffe2::Workspace> workspace(new caffe2::Workspace());
workspace->RunPlan(plan_def);
// This is to allow us to use memory leak checks.
google::protobuf::ShutdownProtobufLibrary();
MPI_Finalize();
return 0;
}
================================================
FILE: binaries/speed_benchmark.cc
================================================
/**
* Copyright (c) 2016-present, Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <string>
#include "caffe2/core/init.h"
#include "caffe2/core/logging.h"
#include "caffe2/core/operator.h"
#include "caffe2/proto/caffe2.pb.h"
#include "caffe2/utils/proto_utils.h"
#include "caffe2/utils/string_utils.h"
CAFFE2_DEFINE_string(net, "", "The given net to benchmark.");
CAFFE2_DEFINE_string(
init_net,
"",
"The given net to initialize any parameters.");
CAFFE2_DEFINE_string(
input,
"",
"Input that is needed for running the network. If "
"multiple input needed, use comma separated string.");
CAFFE2_DEFINE_string(
input_file,
"",
"Input file that contain the serialized protobuf for "
"the input blobs. If multiple input needed, use comma "
"separated string. Must have the same number of items "
"as input does.");
CAFFE2_DEFINE_string(
input_dims,
"",
"Alternate to input_files, if all inputs are simple "
"float TensorCPUs, specify the dimension using comma "
"separated numbers. If multiple input needed, use "
"semicolon to separate the dimension of different "
"tensors.");
CAFFE2_DEFINE_string(
output,
"",
"Output that should be dumped after the execution "
"finishes. If multiple outputs are needed, use comma "
"separated string. If you want to dump everything, pass "
"'*' as the output value.");
CAFFE2_DEFINE_string(
output_folder,
"",
"The folder that the output should be written to. This "
"folder must already exist in the file system.");
CAFFE2_DEFINE_int(warmup, 0, "The number of iterations to warm up.");
CAFFE2_DEFINE_int(iter, 10, "The number of iterations to run.");
CAFFE2_DEFINE_bool(
run_individual,
false,
"Whether to benchmark individual operators.");
CAFFE2_DEFINE_bool(force_engine, false, "Force engine field for all operators");
CAFFE2_DEFINE_string(engine, "", "Forced engine field value");
CAFFE2_DEFINE_bool(force_algo, false, "Force algo arg for all operators");
CAFFE2_DEFINE_string(algo, "", "Forced algo arg value");
using std::string;
using std::unique_ptr;
using std::vector;
int main(int argc, char** argv) {
caffe2::GlobalInit(&argc, &argv);
unique_ptr<caffe2::Workspace> workspace(new caffe2::Workspace());
// Run initialization network.
caffe2::NetDef net_def;
CAFFE_ENFORCE(ReadProtoFromFile(caffe2::FLAGS_init_net, &net_def));
CAFFE_ENFORCE(workspace->RunNetOnce(net_def));
// Load input.
if (caffe2::FLAGS_input.size()) {
vector<string> input_names = caffe2::split(',', caffe2::FLAGS_input);
if (caffe2::FLAGS_input_file.size()) {
vector<string> input_files = caffe2::split(',', caffe2::FLAGS_input_file);
CAFFE_ENFORCE_EQ(
input_names.size(),
input_files.size(),
"Input name and file should have the same number.");
for (int i = 0; i < input_names.size(); ++i) {
caffe2::BlobProto blob_proto;
CAFFE_ENFORCE(caffe2::ReadProtoFromFile(input_files[i], &blob_proto));
workspace->CreateBlob(input_names[i])->Deserialize(blob_proto);
}
} else if (caffe2::FLAGS_input_dims.size()) {
vector<string> input_dims_list =
caffe2::split(';', caffe2::FLAGS_input_dims);
CAFFE_ENFORCE_EQ(
input_names.size(),
input_dims_list.size(),
"Input name and dims should have the same number of items.");
for (int i = 0; i < input_names.size(); ++i) {
vector<string> input_dims_str = caffe2::split(',', input_dims_list[i]);
vector<int> input_dims;
for (const string& s : input_dims_str) {
input_dims.push_back(caffe2::stoi(s));
}
caffe2::TensorCPU* tensor =
workspace->GetBlob(input_names[i])->GetMutable<caffe2::TensorCPU>();
tensor->Resize(input_dims);
tensor->mutable_data<float>();
}
} else {
CAFFE_THROW(
"You requested input tensors, but neither input_file nor "
"input_dims is set.");
}
}
// Run main network.
CAFFE_ENFORCE(ReadProtoFromFile(caffe2::FLAGS_net, &net_def));
// force changing engine and algo
if (caffe2::FLAGS_force_engine) {
LOG(INFO) << "force engine be: " << caffe2::FLAGS_engine;
for (const auto& op : net_def.op()) {
const_cast<caffe2::OperatorDef*>(&op)->set_engine(caffe2::FLAGS_engine);
}
}
if (caffe2::FLAGS_force_algo) {
LOG(INFO) << "force algo be: " << caffe2::FLAGS_algo;
for (const auto& op : net_def.op()) {
caffe2::GetMutableArgument(
"algo", true, const_cast<caffe2::OperatorDef*>(&op))
->set_s(caffe2::FLAGS_algo);
}
}
caffe2::NetBase* net = workspace->CreateNet(net_def);
CHECK_NOTNULL(net);
net->TEST_Benchmark(
caffe2::FLAGS_warmup, caffe2::FLAGS_iter, caffe2::FLAGS_run_individual);
string output_prefix = caffe2::FLAGS_output_folder.size()
? caffe2::FLAGS_output_folder + "/"
: "";
if (caffe2::FLAGS_output.size()) {
vector<string> output_names = caffe2::split(',', caffe2::FLAGS_output);
if (caffe2::FLAGS_output == "*") {
output_names = workspace->Blobs();
}
for (const string& name : output_names) {
CAFFE_ENFORCE(
workspace->HasBlob(name),
"You requested a non-existing blob: ",
name);
string serialized = workspace->GetBlob(name)->Serialize(name);
string output_filename = output_prefix + name;
caffe2::WriteStringToFile(serialized, output_filename.c_str());
}
}
return 0;
}
================================================
FILE: binaries/split_db.cc
================================================
/**
* Copyright (c) 2016-present, Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <string>
#include <sstream>
#include "caffe2/core/db.h"
#include "caffe2/core/init.h"
#include "caffe2/proto/caffe2.pb.h"
#include "caffe2/core/logging.h"
CAFFE2_DEFINE_string(input_db, "", "The input db.");
CAFFE2_DEFINE_int(splits, 0, "The number of splits.");
CAFFE2_DEFINE_string(db_type, "", "The db type.");
CAFFE2_DEFINE_int(batch_size, 1000, "The write batch size.");
namespace caffe2 {
static int Split(int argc, char** argv) {
GlobalInit(&argc, &argv);
CAFFE_ENFORCE(FLAGS_input_db.size(), "Must specify --input_db=/path/to/db.");
CAFFE_ENFORCE(FLAGS_splits > 0, "Must specify a nonnegative split number.");
CAFFE_ENFORCE(FLAGS_db_type.size(), "Must specify --db_type=[a db type].");
unique_ptr<db::DB> in_db(
db::CreateDB(FLAGS_db_type, FLAGS_input_db, db::READ));
CAFFE_ENFORCE(in_db != nullptr, "Cannot open input db: ", FLAGS_input_db);
unique_ptr<db::Cursor> cursor(in_db->NewCursor());
// This usually won't happen, but FWIW.
CAFFE_ENFORCE(
cursor != nullptr, "Cannot obtain cursor for input db: ", FLAGS_input_db);
vector<unique_ptr<db::DB>> out_dbs;
vector<unique_ptr<db::Transaction>> transactions;
for (int i = 0; i < FLAGS_splits; ++i) {
out_dbs.push_back(unique_ptr<db::DB>(db::CreateDB(
FLAGS_db_type, FLAGS_input_db + "_split_" + to_string(i), db::NEW)));
CAFFE_ENFORCE(out_dbs.back().get(), "Cannot create output db #", i);
transactions.push_back(
unique_ptr<db::Transaction>(out_dbs[i]->NewTransaction()));
CAFFE_ENFORCE(
transactions.back().get(), "Cannot get transaction for output db #", i);
}
int count = 0;
for (; cursor->Valid(); cursor->Next()) {
transactions[count % FLAGS_splits]->Put(cursor->key(), cursor->value());
if (++count % FLAGS_batch_size == 0) {
for (int i = 0; i < FLAGS_splits; ++i) {
transactions[i]->Commit();
}
LOG(INFO) << "Split " << count << " items so far.";
}
}
LOG(INFO) << "A total of " << count << " items processed.";
return 0;
}
} // namespace caffe2
int main(int argc, char** argv) {
return caffe2::Split(argc, argv);
}
================================================
FILE: binaries/tutorial_blob.cc
================================================
/**
* Copyright (c) 2016-present, Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "caffe2/core/blob.h"
#include "caffe2/core/init.h"
#include "caffe2/core/tensor.h"
#include "caffe2/core/logging.h"
// We will be lazy and just use the whole namespace.
using namespace caffe2;
int main(int argc, char** argv) {
caffe2::GlobalInit(&argc, &argv);
caffe2::ShowLogInfoToStderr();
LOG(INFO) <<
"This script corresponds to the Blob part of the Caffe2 C++ "
"tutorial.";
LOG(INFO) << "Let's create a blob myblob.";
Blob myblob;
LOG(INFO) << "Let's set it to int and set the value to 10.";
int* myint = myblob.GetMutable<int>();
*myint = 10;
LOG(INFO)
<< "Is the blob type int? "
<< myblob.IsType<int>();
LOG(INFO)
<< "Is the blob type float? "
<< myblob.IsType<float>();
const int& myint_const = myblob.Get<int>();
LOG(INFO)
<< "The value of the int number stored in the blob is: "
<< myint_const;
LOG(INFO)
<< "Let's try to get a float pointer. This will trigger an exception.";
try {
const float& myfloat = myblob.Get<float>();
LOG(FATAL) << "This line should never happen.";
} catch (std::exception& e) {
LOG(INFO)
<< "As expected, we got an exception. Its content says: "
<< e.what();
}
LOG(INFO) <<
"However, we can change the content type (and destroy the old "
"content) by calling GetMutable. Let's change it to double.";
double* mydouble = myblob.GetMutable<double>();
*mydouble = 3.14;
LOG(INFO) << "The new content is: " << myblob.Get<double>();
LOG(INFO) <<
"If we have a pre-created object, we can use Reset() to transfer the "
"object to a blob.";
std::string* pvec = new std::string();
myblob.Reset(pvec); // no need to release pvec, myblob takes ownership.
LOG(INFO) << "Is the blob now of type string? "
<< myblob.IsType<std::string>();
LOG(INFO) << "This concludes the blob tutorial.";
return 0;
}
================================================
FILE: binaries/zmq_feeder.cc
================================================
/**
* Copyright (c) 2016-present, Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// This binary provides an easy way to open a zeromq server and feeds data to
// clients connect to it. It uses the Caffe2 db as the backend, thus allowing
// one to convert any db-compliant storage to a zeromq service.
#include "caffe2/core/db.h"
#include "caffe2/core/init.h"
#include "caffe2/core/logging.h"
#include "caffe2/utils/zmq_helper.h"
CAFFE2_DEFINE_string(server, "tcp://*:5555", "The server address.");
CAFFE2_DEFINE_string(input_db, "", "The input db.");
CAFFE2_DEFINE_string(input_db_type, "", "The input db type.");
using caffe2::db::DB;
using caffe2::db::Cursor;
using caffe2::string;
int main(int argc, char** argv) {
caffe2::GlobalInit(&argc, &argv);
LOG(INFO) << "Opening DB...";
auto in_db = caffe2::db::CreateDB(
caffe2::FLAGS_input_db_type, caffe2::FLAGS_input_db, caffe2::db::READ);
CAFFE_ENFORCE(
in_db,
"Cannot load input db " + caffe2::FLAGS_input_db + " of expected type " +
caffe2::FLAGS_input_db_type);
auto cursor = in_db->NewCursor();
LOG(INFO) << "DB opened.";
LOG(INFO) << "Starting ZeroMQ server...";
// Socket to talk to clients
caffe2::ZmqSocket sender(ZMQ_PUSH);
sender.Bind(caffe2::FLAGS_server);
LOG(INFO) << "Server created at " << caffe2::FLAGS_server;
while (1) {
VLOG(1) << "Sending " << cursor->key();
sender.SendTillSuccess(cursor->key(), ZMQ_SNDMORE);
sender.SendTillSuccess(cursor->value(), 0);
cursor->Next();
if (!cursor->Valid()) {
cursor->SeekToFirst();
}
}
// We do not do an elegant quit since this binary is going to be terminated by
// control+C.
return 0;
}
================================================
FILE: caffe/__init__.py
================================================
================================================
FILE: caffe/proto/CMakeLists.txt
================================================
file(GLOB Caffe_PROTOBUF_FILES "${CMAKE_CURRENT_SOURCE_DIR}/*.proto")
caffe2_protobuf_generate_cpp_py(Caffe_PROTO_SRCS Caffe_PROTO_HEADERS Caffe_PROTO_PY ${Caffe_PROTOBUF_FILES})
add_library(Caffe_PROTO OBJECT ${Caffe_PROTO_HEADERS} ${Caffe_PROTO_SRCS})
if (MSVC)
if(BUILD_SHARED_LIBS)
set(Caffe2_API_DEFINE "-DCAFFE2_API=__declspec(dllexport)")
else()
set(Caffe2_API_DEFINE "-DCAFFE2_API=")
endif()
target_compile_definitions(
Caffe_PROTO PRIVATE ${Caffe2_API_DEFINE})
endif()
install(FILES ${Caffe_PROTO_HEADERS} DESTINATION include/caffe/proto)
================================================
FILE: caffe/proto/__init__.py
================================================
================================================
FILE: caffe/proto/caffe.proto
================================================
syntax = "proto2";
package caffe;
// Specifies the shape (dimensions) of a Blob.
message BlobShape {
repeated int64 dim = 1 [packed = true];
}
message BlobProto {
optional BlobShape shape = 7;
repeated float data = 5 [packed = true];
repeated float diff = 6 [packed = true];
repeated double double_data = 8 [packed = true];
repeated double double_diff = 9 [packed = true];
// 4D dimensions -- deprecated. Use "shape" instead.
optional int32 num = 1 [default = 0];
optional int32 channels = 2 [default = 0];
optional int32 height = 3 [default = 0];
optional int32 width = 4 [default = 0];
}
// The BlobProtoVector is simply a way to pass multiple blobproto instances
// around.
message BlobProtoVector {
repeated BlobProto blobs = 1;
}
message Datum {
optional int32 channels = 1;
optional int32 height = 2;
optional int32 width = 3;
// the actual image data, in bytes
optional bytes data = 4;
optional int32 label = 5;
// Optionally, the datum could also hold float data.
repeated float float_data = 6;
// If true data contains an encoded image that need to be decoded
optional bool encoded = 7 [default = false];
}
message FillerParameter {
// The filler type.
optional string type = 1 [default = 'constant'];
optional float value = 2 [default = 0]; // the value in constant filler
optional float min = 3 [default = 0]; // the min value in uniform filler
optional float max = 4 [default = 1]; // the max value in uniform filler
optional float mean = 5 [default = 0]; // the mean value in Gaussian filler
optional float std = 6 [default = 1]; // the std value in Gaussian filler
// The expected number of non-zero output weights for a given input in
// Gaussian filler -- the default -1 means don't perform sparsification.
optional int32 sparse = 7 [default = -1];
// Normalize the filler variance by fan_in, fan_out, or their average.
// Applies to 'xavier' and 'msra' fillers.
enum VarianceNorm {
FAN_IN = 0;
FAN_OUT = 1;
AVERAGE = 2;
}
optional VarianceNorm variance_norm = 8 [default = FAN_IN];
}
message NetParameter {
optional string name = 1; // consider giving the network a name
// DEPRECATED. See InputParameter. The input blobs to the network.
repeated string input = 3;
// DEPRECATED. See InputParameter. The shape of the input blobs.
repeated BlobShape input_shape = 8;
// 4D input dimensions -- deprecated. Use "input_shape" instead.
// If specified, for each input blob there should be four
// values specifying the num, channels, height and width of the input blob.
// Thus, there should be a total of (4 * #input) numbers.
repeated int32 input_dim = 4;
// Whether the network will force every layer to carry out backward operation.
// If set False, then whether to carry out backward is determined
// automatically according to the net structure and learning rates.
optional bool force_backward = 5 [default = false];
// The current "state" of the network, including the phase, level, and stage.
// Some layers may be included/excluded depending on this state and the states
// specified in the layers' include and exclude fields.
optional NetState state = 6;
// Print debugging information about results while running Net::Forward,
// Net::Backward, and Net::Update.
optional bool debug_info = 7 [default = false];
// The layers that make up the net. Each of their configurations, including
// connectivity and behavior, is specified as a LayerParameter.
repeated LayerParameter layer = 100; // ID 100 so layers are printed last.
// DEPRECATED: use 'layer' instead.
repeated V1LayerParameter layers = 2;
}
// NOTE
// Update the next available ID when you add a new SolverParameter field.
//
// SolverParameter next available ID: 41 (last added: type)
message SolverParameter {
//////////////////////////////////////////////////////////////////////////////
// Specifying the train and test networks
//
// Exactly one train net must be specified using one of the following fields:
// train_net_param, train_net, net_param, net
// One or more test nets may be specified using any of the following fields:
// test_net_param, test_net, net_param, net
// If more than one test net field is specified (e.g., both net and
// test_net are specified), they will be evaluated in the field order given
// above: (1) test_net_param, (2) test_net, (3) net_param/net.
// A test_iter must be specified for each test_net.
// A test_level and/or a test_stage may also be specified for each test_net.
//////////////////////////////////////////////////////////////////////////////
// Proto filename for the train net, possibly combined with one or more
// test nets.
optional string net = 24;
// Inline train net param, possibly combined with one or more test nets.
optional NetParameter net_param = 25;
optional string train_net = 1; // Proto filename for the train net.
repeated string test_net = 2; // Proto filenames for the test nets.
optional NetParameter train_net_param = 21; // Inline train net params.
repeated NetParameter test_net_param = 22; // Inline test net params.
// The states for the train/test nets. Must be unspecified or
// specified once per net.
//
// By default, all states will have solver = true;
// train_state will have phase = TRAIN,
// and all test_state's will have phase = TEST.
// Other defaults are set according to the NetState defaults.
optional NetState train_state = 26;
repeated NetState test_state = 27;
// The number of iterations for each test net.
repeated int32 test_iter = 3;
// The number of iterations between two testing phases.
optional int32 test_interval = 4 [default = 0];
optional bool test_compute_loss = 19 [default = false];
// If true, run an initial test pass before the first iteration,
// ensuring memory availability and printing the starting value of the loss.
optional bool test_initialization = 32 [default = true];
optional float base_lr = 5; // The base learning rate
// the number of iterations between displaying info. If display = 0, no info
// will be displayed.
optional int32 display = 6;
// Display the loss averaged over the last average_loss iterations
optional int32 average_loss = 33 [default = 1];
optional int32 max_iter = 7; // the maximum number of iterations
// accumulate gradients over `iter_size` x `batch_size` instances
optional int32 iter_size = 36 [default = 1];
// The learning rate decay policy. The currently implemented learning rate
// policies are as follows:
// - fixed: always return base_lr.
// - step: return base_lr * gamma ^ (floor(iter / step))
// - exp: return base_lr * gamma ^ iter
// - inv: return base_lr * (1 + gamma * iter) ^ (- power)
// - multistep: similar to step but it allows non uniform steps defined by
// stepvalue
// - poly: the effective learning rate follows a polynomial decay, to be
// zero by the max_iter. return base_lr (1 - iter/max_iter) ^ (power)
// - sigmoid: the effective learning rate follows a sigmod decay
// return base_lr ( 1/(1 + exp(-gamma * (iter - stepsize))))
//
// where base_lr, max_iter, gamma, step, stepvalue and power are defined
// in the solver parameter protocol buffer, and iter is the current iteration.
optional string lr_policy = 8;
optional float gamma = 9; // The parameter to compute the learning rate.
optional float power = 10; // The parameter to compute the learning rate.
optional float momentum = 11; // The momentum value.
optional float weight_decay = 12; // The weight decay.
// regularization types supported: L1 and L2
// controlled by weight_decay
optional string regularization_type = 29 [default = "L2"];
// the stepsize for learning rate policy "step"
optional int32 stepsize = 13;
// the stepsize for learning rate policy "multistep"
repeated int32 stepvalue = 34;
// Set clip_gradients to >= 0 to clip parameter gradients to that L2 norm,
// whenever their actual L2 norm is larger.
optional float clip_gradients = 35 [default = -1];
optional int32 snapshot = 14 [default = 0]; // The snapshot interval
optional string snapshot_prefix = 15; // The prefix for the snapshot.
// whether to snapshot diff in the results or not. Snapshotting diff will help
// debugging but the final protocol buffer size will be much larger.
optional bool snapshot_diff = 16 [default = false];
enum SnapshotFormat {
HDF5 = 0;
BINARYPROTO = 1;
}
optional SnapshotFormat snapshot_format = 37 [default = BINARYPROTO];
// the mode solver will use: 0 for CPU and 1 for GPU. Use GPU in default.
enum SolverMode {
CPU = 0;
GPU = 1;
}
optional SolverMode solver_mode = 17 [default = GPU];
// the device_id will that be used in GPU mode. Use device_id = 0 in default.
optional int32 device_id = 18 [default = 0];
// If non-negative, the seed with which the Solver will initialize the Caffe
// random number generator -- useful for reproducible results. Otherwise,
// (and by default) initialize using a seed derived from the system clock.
optional int64 random_seed = 20 [default = -1];
// type of the solver
optional string type = 40 [default = "SGD"];
// numerical stability for RMSProp, AdaGrad and AdaDelta and Adam
optional float delta = 31 [default = 1e-8];
// parameters for the Adam solver
optional float momentum2 = 39 [default = 0.999];
// RMSProp decay value
// MeanSquare(t) = rms_decay*MeanSquare(t-1) + (1-rms_decay)*SquareGradient(t)
optional float rms_decay = 38;
// If true, print information about the state of the net that may help with
// debugging learning problems.
optional bool debug_info = 23 [default = false];
// If false, don't save a snapshot after training finishes.
optional bool snapshot_after_train = 28 [default = true];
// DEPRECATED: old solver enum types, use string instead
enum SolverType {
SGD = 0;
NESTEROV = 1;
ADAGRAD = 2;
RMSPROP = 3;
ADADELTA = 4;
ADAM = 5;
}
// DEPRECATED: use type instead of solver_type
optional SolverType solver_type = 30 [default = SGD];
}
// A message that stores the solver snapshots
message SolverState {
optional int32 iter = 1; // The current iteration
optional string learned_net = 2; // The file that stores the learned net.
repeated BlobProto history = 3; // The history for sgd solvers
optional int32 current_step = 4 [default = 0]; // The current step for learning rate
}
enum Phase {
TRAIN = 0;
TEST = 1;
}
message NetState {
optional Phase phase = 1 [default = TEST];
optional int32 level = 2 [default = 0];
repeated string stage = 3;
}
message NetStateRule {
// Set phase to require the NetState have a particular phase (TRAIN or TEST)
// to meet this rule.
optional Phase phase = 1;
// Set the minimum and/or maximum levels in which the layer should be used.
// Leave undefined to meet the rule regardless of level.
optional int32 min_level = 2;
optional int32 max_level = 3;
// Customizable sets of stages to include or exclude.
// The net must have ALL of the specified stages and NONE of the specified
// "not_stage"s to meet the rule.
// (Use multiple NetStateRules to specify conjunctions of stages.)
repeated string stage = 4;
repeated string not_stage = 5;
}
// Specifies training parameters (multipliers on global learning constants,
// and the name and other settings used for weight sharing).
message ParamSpec {
// The names of the parameter blobs -- useful for sharing parameters among
// layers, but never required otherwise. To share a parameter between two
// layers, give it a (non-empty) name.
optional string name = 1;
// Whether to require shared weights to have the same shape, or just the same
// count -- defaults to STRICT if unspecified.
optional DimCheckMode share_mode = 2;
enum DimCheckMode {
// STRICT (default) requires that num, channels, height, width each match.
STRICT = 0;
// PERMISSIVE requires only the count (num*channels*height*width) to match.
PERMISSIVE = 1;
}
// The multiplier on the global learning rate for this parameter.
optional float lr_mult = 3 [default = 1.0];
// The multiplier on the global weight decay for this parameter.
optional float decay_mult = 4 [default = 1.0];
}
// NOTE
// Update the next available ID when you add a new LayerParameter field.
//
// LayerParameter next available layer-specific ID: 147 (last added: recurrent_param)
message LayerParameter {
optional string name = 1; // the layer name
optional string type = 2; // the layer type
repeated string bottom = 3; // the name of each bottom blob
repeated string top = 4; // the name of each top blob
// The train / test phase for computation.
optional Phase phase = 10;
// The amount of weight to assign each top blob in the objective.
// Each layer assigns a default value, usually of either 0 or 1,
// to each top blob.
repeated float loss_weight = 5;
// Specifies training parameters (multipliers on global learning constants,
// and the name and other settings used for weight sharing).
repeated ParamSpec param = 6;
// The blobs containing the numeric parameters of the layer.
repeated BlobProto blobs = 7;
// Specifies whether to backpropagate to each bottom. If unspecified,
// Caffe will automatically infer whether each input needs backpropagation
// to compute parameter gradients. If set to true for some inputs,
// backpropagation to those inputs is forced; if set false for some inputs,
// backpropagation to those inputs is skipped.
//
// The size must be either 0 or equal to the number of bottoms.
repeated bool propagate_down = 11;
// Rules controlling whether and when a layer is included in the network,
// based on the current NetState. You may specify a non-zero number of rules
// to include OR exclude, but not both. If no include or exclude rules are
// specified, the layer is always included. If the current NetState meets
// ANY (i.e., one or more) of the specified rules, the layer is
// included/excluded.
repeated NetStateRule include = 8;
repeated NetStateRule exclude = 9;
// Parameters for data pre-processing.
optional TransformationParameter transform_param = 100;
// Parameters shared by loss layers.
optional LossParameter loss_param = 101;
// Layer type-specific parameters.
//
// Note: certain layers may have more than one computational engine
// for their implementation. These layers include an Engine type and
// engine parameter for selecting the implementation.
// The default for the engine is set by the ENGINE switch at compile-time.
optional AccuracyParameter accuracy_param = 102;
optional ArgMaxParameter argmax_param = 103;
optional BatchNormParameter batch_norm_param = 139;
optional BiasParameter bias_param = 141;
optional ConcatParameter concat_param = 104;
optional ContrastiveLossParameter contrastive_loss_param = 105;
optional ConvolutionParameter convolution_param = 106;
optional CropParameter crop_param = 144;
optional DataParameter data_param = 107;
optional DropoutParameter dropout_param = 108;
optional DummyDataParameter dummy_data_param = 109;
optional EltwiseParameter eltwise_param = 110;
optional ELUParameter elu_param = 140;
optional EmbedParameter embed_param = 137;
optional ExpParameter exp_param = 111;
optional FlattenParameter flatten_param = 135;
optional HDF5DataParameter hdf5_data_param = 112;
optional HDF5OutputParameter hdf5_output_param = 113;
optional HingeLossParameter hinge_loss_param = 114;
optional ImageDataParameter image_data_param = 115;
optional InfogainLossParameter infogain_loss_param = 116;
optional InnerProductParameter inner_product_param = 117;
optional InputParameter input_param = 143;
optional LogParameter log_param = 134;
optional LRNParameter lrn_param = 118;
optional MemoryDataParameter memory_data_param = 119;
optional MVNParameter mvn_param = 120;
optional ParameterParameter parameter_param = 145;
optional PoolingParameter pooling_param = 121;
optional PowerParameter power_param = 122;
optional PReLUParameter prelu_param = 131;
optional PythonParameter python_param = 130;
optional RecurrentParameter recurrent_param = 146;
optional ReductionParameter reduction_param = 136;
optional ReLUParameter relu_param = 123;
optional ReshapeParameter reshape_param = 133;
optional ScaleParameter scale_param = 142;
optional SigmoidParameter sigmoid_param = 124;
optional SoftmaxParameter softmax_param = 125;
optional SPPParameter spp_param = 132;
optional SliceParameter slice_param = 126;
optional TanHParameter tanh_param = 127;
optional ThresholdParameter threshold_param = 128;
optional TileParameter tile_param = 138;
optional WindowDataParameter window_data_param = 129;
}
// Message that stores parameters used to apply transformation
// to the data layer's data
message TransformationParameter {
// For data pre-processing, we can do simple scaling and subtracting the
// data mean, if provided. Note that the mean subtraction is always carried
// out before scaling.
optional float scale = 1 [default = 1];
// Specify if we want to randomly mirror data.
optional bool mirror = 2 [default = false];
// Specify if we would like to randomly crop an image.
optional uint32 crop_size = 3 [default = 0];
// mean_file and mean_value cannot be specified at the same time
optional string mean_file = 4;
// if specified can be repeated once (would substract it from all the channels)
// or can be repeated the same number of times as channels
// (would subtract them from the corresponding channel)
repeated float mean_value = 5;
// Force the decoded image to have 3 color channels.
optional bool force_color = 6 [default = false];
// Force the decoded image to have 1 color channels.
optional bool force_gray = 7 [default = false];
}
// Message that stores parameters shared by loss layers
message LossParameter {
// If specified, ignore instances with the given label.
optional int32 ignore_label = 1;
// How to normalize the loss for loss layers that aggregate across batches,
// spatial dimensions, or other dimensions. Currently only implemented in
// SoftmaxWithLoss layer.
enum NormalizationMode {
// Divide by the number of examples in the batch times spatial dimensions.
// Outputs that receive the ignore label will NOT be ignored in computing
// the normalization factor.
FULL = 0;
// Divide by the total number of output locations that do not take the
// ignore_label. If ignore_label is not set, this behaves like FULL.
VALID = 1;
// Divide by the batch size.
BATCH_SIZE = 2;
// Do not normalize the loss.
NONE = 3;
}
optional NormalizationMode normalization = 3 [default = VALID];
// Deprecated. Ignored if normalization is specified. If normalization
// is not specified, then setting this to false will be equivalent to
// normalization = BATCH_SIZE to be consistent with previous behavior.
optional bool normalize = 2;
}
// Messages that store parameters used by individual layer types follow, in
// alphabetical order.
message AccuracyParameter {
// When computing accuracy, count as correct by comparing the true label to
// the top k scoring classes. By default, only compare to the top scoring
// class (i.e. argmax).
optional uint32 top_k = 1 [default = 1];
// The "label" axis of the prediction blob, whose argmax corresponds to the
// predicted label -- may be negative to index from the end (e.g., -1 for the
// last axis). For example, if axis == 1 and the predictions are
// (N x C x H x W), the label blob is expected to contain N*H*W ground truth
// labels with integer values in {0, 1, ..., C-1}.
optional int32 axis = 2 [default = 1];
// If specified, ignore instances with the given label.
optional int32 ignore_label = 3;
}
message ArgMaxParameter {
// If true produce pairs (argmax, maxval)
optional bool out_max_val = 1 [default = false];
optional uint32 top_k = 2 [default = 1];
// The axis along which to maximise -- may be negative to index from the
// end (e.g., -1 for the last axis).
// By default ArgMaxLayer maximizes over the flattened trailing dimensions
// for each index of the first / num dimension.
optional int32 axis = 3;
}
message ConcatParameter {
// The axis along which to concatenate -- may be negative to index from the
// end (e.g., -1 for the last axis). Other axes must have the
// same dimension for all the bottom blobs.
// By default, ConcatLayer concatenates blobs along the "channels" axis (1).
optional int32 axis = 2 [default = 1];
// DEPRECATED: alias for "axis" -- does not support negative indexing.
optional uint32 concat_dim = 1 [default = 1];
}
message BatchNormParameter {
// If false, accumulate global mean/variance values via a moving average. If
// true, use those accumulated values instead of computing mean/variance
// across the batch.
optional bool use_global_stats = 1;
// How much does the moving average decay each iteration?
optional float moving_average_fraction = 2 [default = .999];
// Small value to add to the variance estimate so that we don't divide by
// zero.
optional float eps = 3 [default = 1e-5];
}
message BiasParameter {
// The first axis of bottom[0] (the first input Blob) along which to apply
// bottom[1] (the second input Blob). May be negative to index from the end
// (e.g., -1 for the last axis).
//
// For example, if bottom[0] is 4D with shape 100x3x40x60, the output
// top[0] will have the same shape, and bottom[1] may have any of the
// following shapes (for the given value of axis):
// (axis == 0 == -4) 100; 100x3; 100x3x40; 100x3x40x60
// (axis == 1 == -3) 3; 3x40; 3x40x60
// (axis == 2 == -2) 40; 40x60
// (axis == 3 == -1) 60
// Furthermore, bottom[1] may have the empty shape (regardless of the value of
// "axis") -- a scalar bias.
optional int32 axis = 1 [default = 1];
// (num_axes is ignored unless just one bottom is given and the bias is
// a learned parameter of the layer. Otherwise, num_axes is determined by the
// number of axes by the second bottom.)
// The number of axes of the input (bottom[0]) covered by the bias
// parameter, or -1 to cover all axes of bottom[0] starting from `axis`.
// Set num_axes := 0, to add a zero-axis Blob: a scalar.
optional int32 num_axes = 2 [default = 1];
// (filler is ignored unless just one bottom is given and the bias is
// a learned parameter of the layer.)
// The initialization for the learned bias parameter.
// Default is the zero (0) initialization, resulting in the BiasLayer
// initially performing the identity operation.
optional FillerParameter filler = 3;
}
message ContrastiveLossParameter {
// margin for dissimilar pair
optional float margin = 1 [default = 1.0];
// The first implementation of this cost did not exactly match the cost of
// Hadsell et al 2006 -- using (margin - d^2) instead of (margin - d)^2.
// legacy_version = false (the default) uses (margin - d)^2 as proposed in the
// Hadsell paper. New models should probably use this version.
// legacy_version = true uses (margin - d^2). This is kept to support /
// reproduce existing models and results
optional bool legacy_version = 2 [default = false];
}
message ConvolutionParameter {
optional uint32 num_output = 1; // The number of outputs for the layer
optional bool bias_term = 2 [default = true]; // whether to have bias terms
// Pad, kernel size, and stride are all given as a single value for equal
// dimensions in all spatial dimensions, or once per spatial dimension.
repeated uint32 pad = 3; // The padding size; defaults to 0
repeated uint32 kernel_size = 4; // The kernel size
repeated uint32 stride = 6; // The stride; defaults to 1
// Factor used to dilate the kernel, (implicitly) zero-filling the resulting
// holes. (Kernel dilation is sometimes referred to by its use in the
// algorithme à trous from Holschneider et al. 1987.)
repeated uint32 dilation = 18; // The dilation; defaults to 1
// For 2D convolution only, the *_h and *_w versions may also be used to
// specify both spatial dimensions.
optional uint32 pad_h = 9 [default = 0]; // The padding height (2D only)
optional uint32 pad_w = 10 [default = 0]; // The padding width (2D only)
optional uint32 kernel_h = 11; // The kernel height (2D only)
optional uint32 kernel_w = 12; // The kernel width (2D only)
optional uint32 stride_h = 13; // The stride height (2D only)
optional uint32 stride_w = 14; // The stride width (2D only)
optional uint32 group = 5 [default = 1]; // The group size for group conv
optional FillerParameter weight_filler = 7; // The filler for the weight
optional FillerParameter bias_filler = 8; // The filler for the bias
enum Engine {
DEFAULT = 0;
CAFFE = 1;
CUDNN = 2;
}
optional Engine engine = 15 [default = DEFAULT];
// The axis to interpret as "channels" when performing convolution.
// Preceding dimensions are treated as independent inputs;
// succeeding dimensions are treated as "spatial".
// With (N, C, H, W) inputs, and axis == 1 (the default), we perform
// N independent 2D convolutions, sliding C-channel (or (C/g)-channels, for
// groups g>1) filters across the spatial axes (H, W) of the input.
// With (N, C, D, H, W) inputs, and axis == 1, we perform
// N independent 3D convolutions, sliding (C/g)-channels
// filters across the spatial axes (D, H, W) of the input.
optional int32 axis = 16 [default = 1];
// Whether to force use of the general ND convolution, even if a specific
// implementation for blobs of the appropriate number of spatial dimensions
// is available. (Currently, there is only a 2D-specific convolution
// implementation; for input blobs with num_axes != 2, this option is
// ignored and the ND implementation will be used.)
optional bool force_nd_im2col = 17 [default = false];
}
message CropParameter {
// To crop, elements of the first bottom are selected to fit the dimensions
// of the second, reference bottom. The crop is configured by
// - the crop `axis` to pick the dimensions for cropping
// - the crop `offset` to set the shift for all/each dimension
// to align the cropped bottom with the reference bottom.
// All dimensions up to but excluding `axis` are preserved, while
// the dimensions including and trailing `axis` are cropped.
// If only one `offset` is set, then all dimensions are offset by this amount.
// Otherwise, the number of offsets must equal the number of cropped axes to
// shift the crop in each dimension accordingly.
// Note: standard dimensions are N,C,H,W so the default is a spatial crop,
// and `axis` may be negative to index from the end (e.g., -1 for the last
// axis).
optional int32 axis = 1 [default = 2];
repeated uint32 offset = 2;
}
message DataParameter {
enum DB {
LEVELDB = 0;
LMDB = 1;
}
// Specify the data source.
optional string source = 1;
// Specify the batch size.
optional uint32 batch_size = 4;
// The rand_skip variable is for the data layer to skip a few data points
// to avoid all asynchronous sgd clients to start at the same point. The skip
// point would be set as rand_skip * rand(0,1). Note that rand_skip should not
// be larger than the number of keys in the database.
// DEPRECATED. Each solver accesses a different subset of the database.
optional uint32 rand_skip = 7 [default = 0];
optional DB backend = 8 [default = LEVELDB];
// DEPRECATED. See TransformationParameter. For data pre-processing, we can do
// simple scaling and subtracting the data mean, if provided. Note that the
// mean subtraction is always carried out before scaling.
optional float scale = 2 [default = 1];
optional string mean_file = 3;
// DEPRECATED. See TransformationParameter. Specify if we would like to randomly
// crop an image.
optional uint32 crop_size = 5 [default = 0];
// DEPRECATED. See TransformationParameter. Specify if we want to randomly mirror
// data.
optional bool mirror = 6 [default = false];
// Force the encoded image to have 3 color channels
optional bool force_encoded_color = 9 [default = false];
// Prefetch queue (Number of batches to prefetch to host memory, increase if
// data access bandwidth varies).
optional uint32 prefetch = 10 [default = 4];
}
message DropoutParameter {
optional float dropout_ratio = 1 [default = 0.5]; // dropout ratio
}
// DummyDataLayer fills any number of arbitrarily shaped blobs with random
// (or constant) data generated by "Fillers" (see "message FillerParameter").
message DummyDataParameter {
// This layer produces N >= 1 top blobs. DummyDataParameter must specify 1 or N
// shape fields, and 0, 1 or N data_fillers.
//
// If 0 data_fillers are specified, ConstantFiller with a value of 0 is used.
// If 1 data_filler is specified, it is applied to all top blobs. If N are
// specified, the ith is applied to the ith top blob.
repeated FillerParameter data_filler = 1;
repeated BlobShape shape = 6;
// 4D dimensions -- deprecated. Use "shape" instead.
repeated uint32 num = 2;
repeated uint32 channels = 3;
repeated uint32 height = 4;
repeated uint32 width = 5;
}
message EltwiseParameter {
enum EltwiseOp {
PROD = 0;
SUM = 1;
MAX = 2;
}
optional EltwiseOp operation = 1 [default = SUM]; // element-wise operation
repeated float coeff = 2; // blob-wise coefficient for SUM operation
// Whether to use an asymptotically slower (for >2 inputs) but stabler method
// of computing the gradient for the PROD operation. (No effect for SUM op.)
optional bool stable_prod_grad = 3 [default = true];
}
// Message that stores parameters used by ELULayer
message ELUParameter {
// Described in:
// Clevert, D.-A., Unterthiner, T., & Hochreiter, S. (2015). Fast and Accurate
// Deep Network Learning by Exponential Linear Units (ELUs). arXiv
optional float alpha = 1 [default = 1];
}
// Message that stores parameters used by EmbedLayer
message EmbedParameter {
optional uint32 num_output = 1; // The number of outputs for the layer
// The input is given as integers to be interpreted as one-hot
// vector indices with dimension num_input. Hence num_input should be
// 1 greater than the maximum possible input value.
optional uint32 input_dim = 2;
optional bool bias_term = 3 [default = true]; // Whether to use a bias term
optional FillerParameter weight_filler = 4; // The filler for the weight
optional FillerParameter bias_filler = 5; // The filler for the bias
}
// Message that stores parameters used by ExpLayer
message ExpParameter {
// ExpLayer computes outputs y = base ^ (shift + scale * x), for base > 0.
// Or if base is set to the default (-1), base is set to e,
// so y = exp(shift + scale * x).
optional float base = 1 [default = -1.0];
optional float scale = 2 [default = 1.0];
optional float shift = 3 [default = 0.0];
}
/// Message that stores parameters used by FlattenLayer
message FlattenParameter {
// The first axis to flatten: all preceding axes are retained in the output.
// May be negative to index from the end (e.g., -1 for the last axis).
optional int32 axis = 1 [default = 1];
// The last axis to flatten: all following axes are retained in the output.
// May be negative to index from the end (e.g., the default -1 for the last
// axis).
optional int32 end_axis = 2 [default = -1];
}
// Message that stores parameters used by HDF5DataLayer
message HDF5DataParameter {
// Specify the data source.
optional string source = 1;
// Specify the batch size.
optional uint32 batch_size = 2;
// Specify whether to shuffle the data.
// If shuffle == true, the ordering of the HDF5 files is shuffled,
// and the ordering of data within any given HDF5 file is shuffled,
// but data between different files are not interleaved; all of a file's
// data are output (in a random order) before moving onto another file.
optional bool shuffle = 3 [default = false];
}
message HDF5OutputParameter {
optional string file_name = 1;
}
message HingeLossParameter {
enum Norm {
L1 = 1;
L2 = 2;
}
// Specify the Norm to use L1 or L2
optional Norm norm = 1 [default = L1];
}
message ImageDataParameter {
// Specify the data source.
optional string source = 1;
// Specify the batch size.
optional uint32 batch_size = 4 [default = 1];
// The rand_skip variable is for the data layer to skip a few data points
// to avoid all asynchronous sgd clients to start at the same point. The skip
// point would be set as rand_skip * rand(0,1). Note that rand_skip should not
// be larger than the number of keys in the database.
optional uint32 rand_skip = 7 [default = 0];
// Whether or not ImageLayer should shuffle the list of files at every epoch.
optional bool shuffle = 8 [default = false];
// It will also resize images if new_height or new_width are not zero.
optional uint32 new_height = 9 [default = 0];
optional uint32 new_width = 10 [default = 0];
// Specify if the images are color or gray
optional bool is_color = 11 [default = true];
// DEPRECATED. See TransformationParameter. For data pre-processing, we can do
// simple scaling and subtracting the data mean, if provided. Note that the
// mean subtraction is always carried out before scaling.
optional float scale = 2 [default = 1];
optional string mean_file = 3;
// DEPRECATED. See TransformationParameter. Specify if we would like to randomly
// crop an image.
optional uint32 crop_size = 5 [default = 0];
// DEPRECATED. See TransformationParameter. Specify if we want to randomly mirror
// data.
optional bool mirror = 6 [default = false];
optional string root_folder = 12 [default = ""];
}
message InfogainLossParameter {
// Specify the infogain matrix source.
optional string source = 1;
}
message InnerProductParameter {
optional uint32 num_output = 1; // The number of outputs for the layer
optional bool bias_term = 2 [default = true]; // whether to have bias terms
optional FillerParameter weight_filler = 3; // The filler for the weight
optional FillerParameter bias_filler = 4; // The filler for the bias
// The first axis to be lumped into a single inner product computation;
// all preceding axes are retained in the output.
// May be negative to index from the end (e.g., -1 for the last axis).
optional int32 axis = 5 [default = 1];
// Specify whether to transpose the weight matrix or not.
// If transpose == true, any operations will be performed on the transpose
// of the weight matrix. The weight matrix itself is not going to be transposed
// but rather the transfer flag of operations will be toggled accordingly.
optional bool transpose = 6 [default = false];
}
message InputParameter {
// This layer produces N >= 1 top blob(s) to be assigned manually.
// Define N shapes to set a shape for each top.
// Define 1 shape to set the same shape for every top.
// Define no shape to defer to reshaping manually.
repeated BlobShape shape = 1;
}
// Message that stores parameters used by LogLayer
message LogParameter {
// LogLayer computes outputs y = log_base(shift + scale * x), for base > 0.
// Or if base is set to the default (-1), base is set to e,
// so y = ln(shift + scale * x) = log_e(shift + scale * x)
optional float base = 1 [default = -1.0];
optional float scale = 2 [default = 1.0];
optional float shift = 3 [default = 0.0];
}
// Message that stores parameters used by LRNLayer
message LRNParameter {
optional uint32 local_size = 1 [default = 5];
optional float alpha = 2 [default = 1.];
optional float beta = 3 [default = 0.75];
enum NormRegion {
ACROSS_CHANNELS = 0;
WITHIN_CHANNEL = 1;
}
optional NormRegion norm_region = 4 [default = ACROSS_CHANNELS];
optional float k = 5 [default = 1.];
enum Engine {
DEFAULT = 0;
CAFFE = 1;
CUDNN = 2;
}
optional Engine engine = 6 [default = DEFAULT];
}
message MemoryDataParameter {
optional uint32 batch_size = 1;
optional uint32 channels = 2;
optional uint32 height = 3;
optional uint32 width = 4;
}
message MVNParameter {
// This parameter can be set to false to normalize mean only
optional bool normalize_variance = 1 [default = true];
// This parameter can be set to true to perform DNN-like MVN
optional bool across_channels = 2 [default = false];
// Epsilon for not dividing by zero while normalizing variance
optional float eps = 3 [default = 1e-9];
}
message ParameterParameter {
optional BlobShape shape = 1;
}
message PoolingParameter {
enum PoolMethod {
MAX = 0;
AVE = 1;
STOCHASTIC = 2;
}
optional PoolMethod pool = 1 [default = MAX]; // The pooling method
// Pad, kernel size, and stride are all given as a single value for equal
// dimensions in height and width or as Y, X pairs.
optional uint32 pad = 4 [default = 0]; // The padding size (equal in Y, X)
optional uint32 pad_h = 9 [default = 0]; // The padding height
optional uint32 pad_w = 10 [default = 0]; // The padding width
optional uint32 kernel_size = 2; // The kernel size (square)
optional uint32 kernel_h = 5; // The kernel height
optional uint32 kernel_w = 6; // The kernel width
optional uint32 stride = 3 [default = 1]; // The stride (equal in Y, X)
optional uint32 stride_h = 7; // The stride height
optional uint32 stride_w = 8; // The stride width
enum Engine {
DEFAULT = 0;
CAFFE = 1;
CUDNN = 2;
}
optional Engine engine = 11 [default = DEFAULT];
// If global_pooling then it will pool over the size of the bottom by doing
// kernel_h = bottom->height and kernel_w = bottom->width
optional bool global_pooling = 12 [default = false];
}
message PowerParameter {
// PowerLayer computes outputs y = (shift + scale * x) ^ power.
optional float power = 1 [default = 1.0];
optional float scale = 2 [default = 1.0];
optional float shift = 3 [default = 0.0];
}
message PythonParameter {
optional string module = 1;
optional string layer = 2;
// This value is set to the attribute `param_str` of the `PythonLayer` object
// in Python before calling the `setup()` method. This could be a number,
// string, dictionary in Python dict format, JSON, etc. You may parse this
// string in `setup` method and use it in `forward` and `backward`.
optional string param_str = 3 [default = ''];
// Whether this PythonLayer is shared among worker solvers during data parallelism.
// If true, each worker solver sequentially run forward from this layer.
// This value should be set true if you are using it as a data layer.
optional bool share_in_parallel = 4 [default = false];
}
// Message that stores parameters used by RecurrentLayer
message RecurrentParameter {
// The dimension of the output (and usually hidden state) representation --
// must be explicitly set to non-zero.
optional uint32 num_output = 1 [default = 0];
optional FillerParameter weight_filler = 2; // The filler for the weight
optional FillerParameter bias_filler = 3; // The filler for the bias
// Whether to enable displaying debug_info in the unrolled recurrent net.
optional bool debug_info = 4 [default = false];
// Whether to add as additional inputs (bottoms) the initial hidden state
// blobs, and add as additional outputs (tops) the final timestep hidden state
// blobs. The number of additional bottom/top blobs required depends on the
// recurrent architecture -- e.g., 1 for RNNs, 2 for LSTMs.
optional bool expose_hidden = 5 [default = false];
}
// Message that stores parameters used by ReductionLayer
message ReductionParameter {
enum ReductionOp {
SUM = 1;
ASUM = 2;
SUMSQ = 3;
MEAN = 4;
}
optional ReductionOp operation = 1 [default = SUM]; // reduction operation
// The first axis to reduce to a scalar -- may be negative to index from the
// end (e.g., -1 for the last axis).
// (Currently, only reduction along ALL "tail" axes is supported; reduction
// of axis M through N, where N < num_axes - 1, is unsupported.)
// Suppose we have an n-axis bottom Blob with shape:
// (d0, d1, d2, ..., d(m-1), dm, d(m+1), ..., d(n-1)).
// If axis == m, the output Blob will have shape
// (d0, d1, d2, ..., d(m-1)),
// and the ReductionOp operation is performed (d0 * d1 * d2 * ... * d(m-1))
// times, each including (dm * d(m+1) * ... * d(n-1)) individual data.
// If axis == 0 (the default), the output Blob always has the empty shape
// (count 1), performing reduction across the entire input --
// often useful for creating new loss functions.
optional int32 axis = 2 [default = 0];
optional float coeff = 3 [default = 1.0]; // coefficient for output
}
// Message that stores parameters used by ReLULayer
message ReLUParameter {
// Allow non-zero slope for negative inputs to speed up optimization
// Described in:
// Maas, A. L., Hannun, A. Y., & Ng, A. Y. (2013). Rectifier nonlinearities
// improve neural network acoustic models. In ICML Workshop on Deep Learning
// for Audio, Speech, and Language Processing.
optional float negative_slope = 1 [default = 0];
enum Engine {
DEFAULT = 0;
CAFFE = 1;
CUDNN = 2;
}
optional Engine engine = 2 [default = DEFAULT];
}
message ReshapeParameter {
// Specify the output dimensions. If some of the dimensions are set to 0,
// the corresponding dimension from the bottom layer is used (unchanged).
// Exactly one dimension may be set to -1, in which case its value is
// inferred from the count of the bottom blob and the remaining dimensions.
// For example, suppose we want to reshape a 2D blob "input" with shape 2 x 8:
//
// layer {
// type: "Reshape" bottom: "input" top: "output"
// reshape_param { ... }
// }
//
// If "input" is 2D with shape 2 x 8, then the following reshape_param
// specifications are all equivalent, producing a 3D blob "output" with shape
// 2 x 2 x 4:
//
// reshape_param { shape { dim: 2 dim: 2 dim: 4 } }
// reshape_param { shape { dim: 0 dim: 2 dim: 4 } }
// reshape_param { shape { dim: 0 dim: 2 dim: -1 } }
// reshape_param { shape { dim: 0 dim:-1 dim: 4 } }
//
optional BlobShape shape = 1;
// axis and num_axes control the portion of the bottom blob's shape that are
// replaced by (included in) the reshape. By default (axis == 0 and
// num_axes == -1), the entire bottom blob shape is included in the reshape,
// and hence the shape field must specify the entire output shape.
//
// axis may be non-zero to retain some portion of the beginning of the input
// shape (and may be negative to index from the end; e.g., -1 to begin the
// reshape after the last axis, including nothing in the reshape,
// -2 to include only the last axis, etc.).
//
// For example, suppose "input" is a 2D blob with shape 2 x 8.
// Then the following ReshapeLayer specifications are all equivalent,
// producing a blob "output" with shape 2 x 2 x 4:
//
// reshape_param { shape { dim: 2 dim: 2 dim: 4 } }
// reshape_param { shape { dim: 2 dim: 4 } axis: 1 }
// reshape_param { shape { dim: 2 dim: 4 } axis: -3 }
//
// num_axes specifies the extent of the reshape.
// If num_axes >= 0 (and axis >= 0), the reshape will be performed only on
// input axes in the range [axis, axis+num_axes].
// num_axes may also be -1, the default, to include all remaining axes
// (starting from axis).
//
// For example, suppose "input" is a 2D blob with shape 2 x 8.
// Then the following ReshapeLayer specifications are equivalent,
// producing a blob "output" with shape 1 x 2 x 8.
//
// reshape_param { shape { dim: 1 dim: 2 dim: 8 } }
// reshape_param { shape { dim: 1 dim: 2 } num_axes: 1 }
// reshape_param { shape { dim: 1 } num_axes: 0 }
//
// On the other hand, these would produce output blob shape 2 x 1 x 8:
//
// reshape_param { shape { dim: 2 dim: 1 dim: 8 } }
// reshape_param { shape { dim: 1 } axis: 1 num_axes: 0 }
//
optional int32 axis = 2 [default = 0];
optional int32 num_axes = 3 [default = -1];
}
message ScaleParameter {
// The first axis of bottom[0] (the first input Blob) along which to apply
// bottom[1] (the second input Blob). May be negative to index from the end
// (e.g., -1 for the last axis).
//
// For example, if bottom[0] is 4D with shape 100x3x40x60, the output
// top[0] will have the same shape, and bottom[1] may have any of the
// following shapes (for the given value of axis):
// (axis == 0 == -4) 100; 100x3; 100x3x40; 100x3x40x60
// (axis == 1 == -3) 3; 3x40; 3x40x60
// (axis == 2 == -2) 40; 40x60
// (axis == 3 == -1) 60
// Furthermore, bottom[1] may have the empty shape (regardless of the value of
// "axis") -- a scalar multiplier.
optional int32 axis = 1 [default = 1];
// (num_axes is ignored unless just one bottom is given and the scale is
// a learned parameter of the layer. Otherwise, num_axes is determined by the
// number of axes by the second bottom.)
// The number of axes of the input (bottom[0]) covered by the scale
// parameter, or -1 to cover all axes of bottom[0] starting from `axis`.
// Set num_axes := 0, to multiply with a zero-axis Blob: a scalar.
optional int32 num_axes = 2 [default = 1];
// (filler is ignored unless just one bottom is given and the scale is
// a learned parameter of the layer.)
// The initialization for the learned scale parameter.
// Default is the unit (1) initialization, resulting in the ScaleLayer
// initially performing the identity operation.
optional FillerParameter filler = 3;
// Whether to also learn a bias (equivalent to a ScaleLayer+BiasLayer, but
// may be more efficient). Initialized with bias_filler (defaults to 0).
optional bool bias_term = 4 [default = false];
optional FillerParameter bias_filler = 5;
}
message SigmoidParameter {
enum Engine {
DEFAULT = 0;
CAFFE = 1;
CUDNN = 2;
}
optional Engine engine = 1 [default = DEFAULT];
}
message SliceParameter {
// The axis along which to slice -- may be negative to index from the end
// (e.g., -1 for the last axis).
// By default, SliceLayer concatenates blobs along the "channels" axis (1).
optional int32 axis = 3 [default = 1];
repeated uint32 slice_point = 2;
// DEPRECATED: alias for "axis" -- does not support negative indexing.
optional uint32 slice_dim = 1 [default = 1];
}
// Message that stores parameters used by SoftmaxLayer, SoftmaxWithLossLayer
message SoftmaxParameter {
enum Engine {
DEFAULT = 0;
CAFFE = 1;
CUDNN = 2;
}
optional Engine engine = 1 [default = DEFAULT];
// The axis along which to perform the softmax -- may be negative to index
// from the end (e.g., -1 for the last axis).
// Any other axes will be evaluated as independent softmaxes.
optional int32 axis = 2 [default = 1];
}
message TanHParameter {
enum Engine {
DEFAULT = 0;
CAFFE = 1;
CUDNN = 2;
}
optional Engine engine = 1 [default = DEFAULT];
}
// Message that stores parameters used by TileLayer
message TileParameter {
// The index of the axis to tile.
optional int32 axis = 1 [default = 1];
// The number of copies (tiles) of the blob to output.
optional int32 tiles = 2;
}
// Message that stores parameters used by ThresholdLayer
message ThresholdParameter {
optional float threshold = 1 [default = 0]; // Strictly positive values
}
message WindowDataParameter {
// Specify the data source.
optional string source = 1;
// For data pre-processing, we can do simple scaling and subtracting the
// data mean, if provided. Note that the mean subtraction is always carried
// out before scaling.
optional float scale = 2 [default = 1];
optional string mean_file = 3;
// Specify the batch size.
optional uint32 batch_size = 4;
// Specify if we would like to randomly crop an image.
optional uint32 crop_size = 5 [default = 0];
// Specify if we want to randomly mirror data.
optional bool mirror = 6 [default = false];
// Foreground (object) overlap threshold
optional float fg_threshold = 7 [default = 0.5];
// Background (non-object) overlap threshold
optional float bg_threshold = 8 [default = 0.5];
// Fraction of batch that should be foreground objects
optional float fg_fraction = 9 [default = 0.25];
// Amount of contextual padding to add around a window
// (used only by the window_data_layer)
optional uint32 context_pad = 10 [default = 0];
// Mode for cropping out a detection window
// warp: cropped window is warped to a fixed size and aspect ratio
// square: the tightest square around the window is cropped
optional string crop_mode = 11 [default = "warp"];
// cache_images: will load all images in memory for faster access
optional bool cache_images = 12 [default = false];
// append root_folder to locate images
optional string root_folder = 13 [default = ""];
}
message SPPParameter {
enum PoolMethod {
MAX = 0;
AVE = 1;
STOCHASTIC = 2;
}
optional uint32 pyramid_height = 1;
optional PoolMethod pool = 2 [default = MAX]; // The pooling method
enum Engine {
DEFAULT = 0;
CAFFE = 1;
CUDNN = 2;
}
optional Engine engine = 6 [default = DEFAULT];
}
// DEPRECATED: use LayerParameter.
message V1LayerParameter {
repeated string bottom = 2;
repeated string top = 3;
optional string name = 4;
repeated NetStateRule include = 32;
repeated NetStateRule exclude = 33;
enum LayerType {
NONE = 0;
ABSVAL = 35;
ACCURACY = 1;
ARGMAX = 30;
BNLL = 2;
CONCAT = 3;
CONTRASTIVE_LOSS = 37;
CONVOLUTION = 4;
DATA = 5;
DECONVOLUTION = 39;
DROPOUT = 6;
DUMMY_DATA = 32;
EUCLIDEAN_LOSS = 7;
ELTWISE = 25;
EXP = 38;
FLATTEN = 8;
HDF5_DATA = 9;
HDF5_OUTPUT = 10;
HINGE_LOSS = 28;
IM2COL = 11;
IMAGE_DATA = 12;
INFOGAIN_LOSS = 13;
INNER_PRODUCT = 14;
LRN = 15;
MEMORY_DATA = 29;
MULTINOMIAL_LOGISTIC_LOSS = 16;
MVN = 34;
POOLING = 17;
POWER = 26;
RELU = 18;
SIGMOID = 19;
SIGMOID_CROSS_ENTROPY_LOSS = 27;
SILENCE = 36;
SOFTMAX = 20;
SOFTMAX_LOSS = 21;
SPLIT = 22;
SLICE = 33;
TANH = 23;
WINDOW_DATA = 24;
THRESHOLD = 31;
}
optional LayerType type = 5;
repeated BlobProto blobs = 6;
repeated string param = 1001;
repeated DimCheckMode blob_share_mode = 1002;
enum DimCheckMode {
STRICT = 0;
PERMISSIVE = 1;
}
repeated float blobs_lr = 7;
repeated float weight_decay = 8;
repeated float loss_weight = 35;
optional AccuracyParameter accuracy_param = 27;
optional ArgMaxParameter argmax_param = 23;
optional ConcatParameter concat_param = 9;
optional ContrastiveLossParameter contrastive_loss_param = 40;
optional ConvolutionParameter convolution_param = 10;
optional DataParameter data_param = 11;
optional DropoutParameter dropout_param = 12;
optional DummyDataParameter dummy_data_param = 26;
optional EltwiseParameter eltwise_param = 24;
optional ExpParameter exp_param = 41;
optional HDF5DataParameter hdf5_data_param = 13;
optional HDF5OutputParameter hdf5_output_param = 14;
optional HingeLossParameter hinge_loss_param = 29;
optional ImageDataParameter image_data_param = 15;
optional InfogainLossParameter infogain_loss_param = 16;
optional InnerProductParameter inner_product_param = 17;
optional LRNParameter lrn_param = 18;
optional MemoryDataParameter memory_data_param = 22;
optional MVNParameter mvn_param = 34;
optional PoolingParameter pooling_param = 19;
optional PowerParameter power_param = 21;
optional ReLUParameter relu_param = 30;
optional SigmoidParameter sigmoid_param = 38;
optional SoftmaxParameter softmax_param = 39;
optional SliceParameter slice_param = 31;
optional TanHParameter tanh_param = 37;
optional ThresholdParameter threshold_param = 25;
optional WindowDataParameter window_data_param = 20;
optional TransformationParameter transform_param = 36;
optional LossParameter loss_param = 42;
optional V0LayerParameter layer = 1;
}
// DEPRECATED: V0LayerParameter is the old way of specifying layer parameters
// in Caffe. We keep this message type around for legacy support.
message V0LayerParameter {
optional string name = 1; // the layer name
optional string type = 2; // the string to specify the layer type
// Parameters to specify layers with inner products.
optional uint32 num_output = 3; // The number of outputs for the layer
optional bool biasterm = 4 [default = true]; // whether to have bias terms
optional FillerParameter weight_filler = 5; // The filler for the weight
optional FillerParameter bias_filler = 6; // The filler for the bias
optional uint32 pad = 7 [default = 0]; // The padding size
optional uint32 kernelsize = 8; // The kernel size
optional uint32 group = 9 [default = 1]; // The group size for group conv
optional uint32 stride = 10 [default = 1]; // The stride
enum PoolMethod {
MAX = 0;
AVE = 1;
STOCHASTIC = 2;
}
optional PoolMethod pool = 11 [default = MAX]; // The pooling method
optional float dropout_ratio = 12 [default = 0.5]; // dropout ratio
optional uint32 local_size = 13 [default = 5]; // for local response norm
optional float alpha = 14 [default = 1.]; // for local response norm
optional float beta = 15 [default = 0.75]; // for local response norm
optional float k = 22 [default = 1.];
// For data layers, specify the data source
optional string source = 16;
// For data pre-processing, we can do simple scaling and subtracting the
// data mean, if provided. Note that the mean subtraction is always carried
// out before scaling.
optional float scale = 17 [default = 1];
optional string meanfile = 18;
// For data layers, specify the batch size.
optional uint32 batchsize = 19;
// For data layers, specify if we would like to randomly crop an image.
optional uint32 cropsize = 20 [default = 0];
// For data layers, specify if we want to randomly mirror data.
optional bool mirror = 21 [default = false];
// The blobs containing the numeric parameters of the layer
repeated BlobProto blobs = 50;
// The ratio that is multiplied on the global learning rate. If you want to
// set the learning ratio for one blob, you need to set it for all blobs.
repeated float blobs_lr = 51;
// The weight decay that is multiplied on the global weight decay.
repeated float weight_decay = 52;
// The rand_skip variable is for the data layer to skip a few data points
// to avoid all asynchronous sgd clients to start at the same point. The skip
// point would be set as rand_skip * rand(0,1). Note that rand_skip should not
// be larger than the number of keys in the database.
optional uint32 rand_skip = 53 [default = 0];
// Fields related to detection (det_*)
// foreground (object) overlap threshold
optional float det_fg_threshold = 54 [default = 0.5];
// background (non-object) overlap threshold
optional float det_bg_threshold = 55 [default = 0.5];
// Fraction of batch that should be foreground objects
optional float det_fg_fraction = 56 [default = 0.25];
// optional bool OBSOLETE_can_clobber = 57 [default = true];
// Amount of contextual padding to add around a window
// (used only by the window_data_layer)
optional uint32 det_context_pad = 58 [default = 0];
// Mode for cropping out a detection window
// warp: cropped window is warped to a fixed size and aspect ratio
// square: the tightest square around the window is cropped
optional string det_crop_mode = 59 [default = "warp"];
// For ReshapeLayer, one needs to specify the new dimensions.
optional int32 new_num = 60 [default = 0];
optional int32 new_channels = 61 [default = 0];
optional int32 new_height = 62 [default = 0];
optional int32 new_width = 63 [default = 0];
// Whether or not ImageLayer should shuffle the list of files at every epoch.
// It will also resize images if new_height or new_width are not zero.
optional bool shuffle_images = 64 [default = false];
// For ConcatLayer, one needs to specify the dimension for concatenation, and
// the other dimensions must be the same for all the bottom blobs.
// By default it will concatenate blobs along the channels dimension.
optional uint32 concat_dim = 65 [default = 1];
optional HDF5OutputParameter hdf5_output_param = 1001;
}
message PReLUParameter {
// Parametric ReLU described in K. He et al, Delving Deep into Rectifiers:
// Surpassing Human-Level Performance on ImageNet Classification, 2015.
// Initial value of a_i. Default is a_i=0.25 for all i.
optional FillerParameter filler = 1;
// Whether or not slope paramters are shared across channels.
optional bool channel_shared = 2 [default = false];
}
================================================
FILE: caffe2/.clang-format
================================================
---
AccessModifierOffset: -1
AlignAfterOpenBracket: AlwaysBreak
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: true
AlignOperands: false
AlignTrailingComments: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: true
BinPackArguments: false
BinPackParameters: false
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Attach
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: false
ColumnLimit: 80
CommentPragmas: '^ IWYU pragma:'
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
ForEachMacros: [ FOR_EACH_RANGE, FOR_EACH, ]
IncludeCategories:
- Regex: '^<.*\.h(pp)?>'
Priority: 1
- Regex: '^<.*'
Priority: 2
- Regex: '.*'
Priority: 3
IndentCaseLabels: true
IndentWidth: 2
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: false
PenaltyBreakBeforeFirstCallParameter: 1
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200
PointerAlignment: Left
ReflowComments: true
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
TabWidth: 8
UseTab: Never
...
================================================
FILE: caffe2/CMakeLists.txt
================================================
# ---[ Declare source file lists
# ---[ Add respective subdirectories
# Note: the folders that are being commented out have not been properly
# addressed yet.
add_subdirectory(proto)
add_subdirectory(contrib)
add_subdirectory(core)
add_subdirectory(cuda_rtc)
add_subdirectory(db)
add_subdirectory(distributed)
# add_subdirectory(experiments) # note, we may remove this folder at some point
add_subdirectory(image)
add_subdirectory(video)
add_subdirectory(mkl)
add_subdirectory(mobile)
add_subdirectory(mpi)
add_subdirectory(observers)
add_subdirectory(onnx)
add_subdirectory(operators)
add_subdirectory(perfkernels)
add_subdirectory(python)
add_subdirectory(queue)
add_subdirectory(sgd)
add_subdirectory(share)
# add_subdirectory(test) # todo: use caffe2_gtest_main instead of gtest_main because we will need to call GlobalInit
add_subdirectory(transforms)
add_subdirectory(utils)
# Advanced: if we have white list specified, we will do intersections for all
# main lib srcs.
if (CAFFE2_WHITELISTED_FILES)
caffe2_do_whitelist(Caffe2_CPU_SRCS CAFFE2_WHITELISTED_FILES)
caffe2_do_whitelist(Caffe2_GPU_SRCS CAFFE2_WHITELISTED_FILES)
endif()
# Debug messages - if you want to get a list of source files, enable the
# following.
if (FALSE)
message(STATUS "CPU sources: ")
foreach(tmp ${Caffe2_CPU_SRCS})
message(STATUS " " ${tmp})
endforeach()
message(STATUS "GPU sources: ")
foreach(tmp ${Caffe2_GPU_SRCS})
message(STATUS " " ${tmp})
endforeach()
message(STATUS "CPU test sources: ")
foreach(tmp ${Caffe2_CPU_TEST_SRCS})
message(STATUS " " ${tmp})
endforeach()
message(STATUS "GPU test sources: ")
foreach(tmp ${Caffe2_GPU_TEST_SRCS})
message(STATUS " " ${tmp})
endforeach()
endif()
# ---[ Generate and install header files.
# Write the macros file.
configure_file(
${PROJECT_SOURCE_DIR}/caffe2/core/macros.h.in
${PROJECT_BINARY_DIR}/caffe2/core/macros.h)
# Installing the header files
install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
DESTINATION include
FILES_MATCHING PATTERN "*.h")
install(FILES ${PROJECT_BINARY_DIR}/caffe2/core/macros.h
DESTINATION include/caffe2/core)
# ---[ List of libraries to link with
# Compile exposed libraries.
add_library(caffe2 ${Caffe2_CPU_SRCS} $<TARGET_OBJECTS:Caffe_PROTO> $<TARGET_OBJECTS:Caffe2_PROTO>)
add_dependencies(caffe2 Caffe_PROTO Caffe2_PROTO)
target_link_libraries(caffe2 PUBLIC ${Caffe2_PUBLIC_DEPENDENCY_LIBS})
target_link_libraries(caffe2 PRIVATE ${Caffe2_DEPENDENCY_LIBS})
target_link_libraries(caffe2 PRIVATE ${Caffe2_DEPENDENCY_WHOLE_LINK_LIBS})
target_include_directories(caffe2 INTERFACE $<INSTALL_INTERFACE:include>)
target_compile_options(caffe2 INTERFACE "-std=c++11")
target_compile_options(caffe2 PRIVATE "-DCAFFE2_BUILD_MAIN_LIB")
install(TARGETS caffe2 EXPORT Caffe2Targets DESTINATION lib)
caffe2_interface_library(caffe2 caffe2_library)
list(APPEND Caffe2_MAIN_LIBS caffe2_library)
# ---[ CUDA library.
if(USE_CUDA)
# A hack to deal with cuda library dependencies and modern CMake: the
# CUDA_ADD_LIBRARY includes a target_link_libraries, and as a result,
# one cannot use PUBLIC/PRIVATE/INTERFACE for the target anymore. This
# hack adds the PRIVATE keywords to CUDA_LIBRARIES so we can deal with
# it. We will then manually add the cudart library as interface libs.
set(__tmp ${CUDA_LIBRARIES})
set(CUDA_LIBRARIES PRIVATE ${CUDA_LIBRARIES})
CUDA_ADD_LIBRARY(caffe2_gpu ${Caffe2_GPU_SRCS})
set(CUDA_LIBRARIES ${__tmp})
target_link_libraries(caffe2_gpu INTERFACE caffe2::cudart)
target_include_directories(
caffe2_gpu INTERFACE $<INSTALL_INTERFACE:include>)
target_link_libraries(
caffe2_gpu PUBLIC caffe2 ${Caffe2_PUBLIC_CUDA_DEPENDENCY_LIBS})
target_link_libraries(
caffe2_gpu PRIVATE ${Caffe2_CUDA_DEPENDENCY_LIBS})
caffe2_interface_library(caffe2_gpu caffe2_gpu_library)
list(APPEND Caffe2_MAIN_LIBS caffe2_gpu_library)
install(TARGETS caffe2_gpu EXPORT Caffe2Targets DESTINATION lib)
endif()
# ---[ Test binaries.
if (BUILD_TEST)
set(Caffe2_ALL_TEST_SRCS ${Caffe2_CPU_TEST_SRCS})
if (USE_CUDA)
list(APPEND Caffe2_ALL_TEST_SRCS ${Caffe2_GPU_TEST_SRCS})
endif()
foreach(test_src ${Caffe2_ALL_TEST_SRCS})
get_filename_component(test_name ${test_src} NAME_WE)
add_executable(${test_name} "${test_src}")
# For tests, some of the test code actually directly call the dependent
# libraries even if they are not part of the public dependency libs. As a
# result, we will explicitly
gitextract_2u1ieaci/ ├── .gitattributes ├── .github/ │ ├── CONTRIBUTING.md │ ├── ISSUE_TEMPLATE.md │ └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── .gitmodules ├── .jenkins/ │ ├── README.md │ ├── build.sh │ └── test.sh ├── .travis/ │ ├── build.sh │ ├── install.sh │ ├── setup.sh │ └── test.sh ├── .travis.yml ├── CMakeLists.txt ├── LICENSE ├── Makefile ├── NOTICE ├── README.md ├── VERSION_NUMBER ├── appveyor.yml ├── binaries/ │ ├── CMakeLists.txt │ ├── caffe2_benchmark.cc │ ├── convert_caffe_image_db.cc │ ├── convert_db.cc │ ├── convert_encoded_to_raw_leveldb.cc │ ├── core_overhead_benchmark.cc │ ├── db_throughput.cc │ ├── inspect_gpus.cc │ ├── make_cifar_db.cc │ ├── make_image_db.cc │ ├── make_mnist_db.cc │ ├── predictor_verifier.cc │ ├── print_core_object_sizes.cc │ ├── print_registered_core_operators.cc │ ├── run_plan.cc │ ├── run_plan_mpi.cc │ ├── speed_benchmark.cc │ ├── split_db.cc │ ├── tutorial_blob.cc │ └── zmq_feeder.cc ├── caffe/ │ ├── __init__.py │ └── proto/ │ ├── CMakeLists.txt │ ├── __init__.py │ └── caffe.proto ├── caffe2/ │ ├── .clang-format │ ├── CMakeLists.txt │ ├── __init__.py │ ├── contrib/ │ │ ├── CMakeLists.txt │ │ ├── __init__.py │ │ ├── aten/ │ │ │ ├── CMakeLists.txt │ │ │ ├── README.md │ │ │ ├── aten_op.cc │ │ │ ├── aten_op.h │ │ │ ├── aten_op_cuda.cc │ │ │ ├── aten_op_template.h │ │ │ ├── aten_test.py │ │ │ ├── docs/ │ │ │ │ ├── pytorch_to_caffe2.md │ │ │ │ └── sample.py │ │ │ └── gen_op.py │ │ ├── cuda-convnet2/ │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── build.sh │ │ │ ├── convdata.py │ │ │ ├── convnet.py │ │ │ ├── cudaconv3/ │ │ │ │ ├── Makefile │ │ │ │ ├── include/ │ │ │ │ │ ├── conv_util.cuh │ │ │ │ │ └── cudaconv2.cuh │ │ │ │ └── src/ │ │ │ │ ├── conv_util.cu │ │ │ │ ├── filter_acts.cu │ │ │ │ ├── img_acts.cu │ │ │ │ └── weight_acts.cu │ │ │ ├── cudaconvnet/ │ │ │ │ ├── Makefile │ │ │ │ ├── __init__.py │ │ │ │ ├── include/ │ │ │ │ │ ├── actbroadcaster.cuh │ │ │ │ │ ├── convnet.cuh │ │ │ │ │ ├── copypipeline.cuh │ │ │ │ │ ├── cost.cuh │ │ │ │ │ ├── data.cuh │ │ │ │ │ ├── gradreducer.cuh │ │ │ │ │ ├── jpeg.h │ │ │ │ │ ├── layer.cuh │ │ │ │ │ ├── layer_kernels.cuh │ │ │ │ │ ├── lr.cuh │ │ │ │ │ ├── memorysource.cuh │ │ │ │ │ ├── messages.cuh │ │ │ │ │ ├── neuron.cuh │ │ │ │ │ ├── pipedispenser.cuh │ │ │ │ │ ├── pyconvnet.cuh │ │ │ │ │ ├── reducepipeline.cuh │ │ │ │ │ ├── streambroadcast.cuh │ │ │ │ │ ├── timer.cuh │ │ │ │ │ ├── util.cuh │ │ │ │ │ ├── weights.cuh │ │ │ │ │ └── worker.cuh │ │ │ │ └── src/ │ │ │ │ ├── actbroadcaster.cu │ │ │ │ ├── convnet.cu │ │ │ │ ├── copypipeline.cu │ │ │ │ ├── cost.cu │ │ │ │ ├── data.cu │ │ │ │ ├── gradreducer.cu │ │ │ │ ├── jpeg.cpp │ │ │ │ ├── layer.cu │ │ │ │ ├── layer_kernels.cu │ │ │ │ ├── lr.cu │ │ │ │ ├── memorysource.cu │ │ │ │ ├── neuron.cu │ │ │ │ ├── pyconvnet.cu │ │ │ │ ├── reducepipeline.cu │ │ │ │ ├── streambroadcast.cu │ │ │ │ ├── util.cu │ │ │ │ ├── weights.cu │ │ │ │ └── worker.cu │ │ │ ├── initw.py │ │ │ ├── layer.py │ │ │ ├── layers/ │ │ │ │ ├── layer-params-cifar10-11pct.cfg │ │ │ │ ├── layer-params-imagenet-1gpu.cfg │ │ │ │ ├── layer-params-imagenet-2gpu-data.cfg │ │ │ │ ├── layer-params-imagenet-2gpu-model.cfg │ │ │ │ ├── layer-params-imagenet-4gpu-data-model.cfg │ │ │ │ ├── layer-params-imagenet-4gpu-data.cfg │ │ │ │ ├── layers-cifar10-11pct.cfg │ │ │ │ ├── layers-imagenet-1gpu.cfg │ │ │ │ ├── layers-imagenet-2gpu-data.cfg │ │ │ │ ├── layers-imagenet-2gpu-model.cfg │ │ │ │ ├── layers-imagenet-4gpu-data-model.cfg │ │ │ │ └── layers-imagenet-4gpu-data.cfg │ │ │ ├── make-data/ │ │ │ │ ├── input_meta │ │ │ │ ├── make-data.py │ │ │ │ └── pyext/ │ │ │ │ ├── Makefile │ │ │ │ ├── __init__.py │ │ │ │ ├── include/ │ │ │ │ │ └── pyext.h │ │ │ │ └── src/ │ │ │ │ └── pyext.cpp │ │ │ ├── nvmatrix/ │ │ │ │ ├── Makefile │ │ │ │ ├── include/ │ │ │ │ │ ├── memory.cuh │ │ │ │ │ ├── nvmatrix.cuh │ │ │ │ │ ├── nvmatrix_kernels.cuh │ │ │ │ │ └── nvmatrix_operators.cuh │ │ │ │ └── src/ │ │ │ │ ├── memory.cu │ │ │ │ ├── nvmatrix.cu │ │ │ │ └── nvmatrix_kernels.cu │ │ │ ├── python_util/ │ │ │ │ ├── __init__.py │ │ │ │ ├── data.py │ │ │ │ ├── gpumodel.py │ │ │ │ ├── options.py │ │ │ │ └── util.py │ │ │ ├── shownet.py │ │ │ └── util/ │ │ │ ├── Makefile │ │ │ ├── include/ │ │ │ │ ├── matrix.h │ │ │ │ ├── matrix_funcs.h │ │ │ │ ├── queue.h │ │ │ │ ├── sync.h │ │ │ │ └── thread.h │ │ │ └── src/ │ │ │ └── matrix.cpp │ │ ├── docker-ubuntu-14.04/ │ │ │ └── Dockerfile │ │ ├── gloo/ │ │ │ ├── CMakeLists.txt │ │ │ ├── allgather_ops.cc │ │ │ ├── allgather_ops.h │ │ │ ├── allreduce_ops.cc │ │ │ ├── allreduce_ops.h │ │ │ ├── allreduce_ops_gpu.cc │ │ │ ├── barrier_ops.cc │ │ │ ├── barrier_ops.h │ │ │ ├── broadcast_ops.cc │ │ │ ├── broadcast_ops.h │ │ │ ├── broadcast_ops_gpu.cc │ │ │ ├── common.cc │ │ │ ├── common.h │ │ │ ├── common_world_ops.cc │ │ │ ├── common_world_ops.h │ │ │ ├── common_world_ops_gpu.cc │ │ │ ├── context.cc │ │ │ ├── context.h │ │ │ ├── gloo_test.py │ │ │ ├── py_export.cc │ │ │ ├── reduce_scatter_ops.cc │ │ │ ├── reduce_scatter_ops.h │ │ │ ├── store_handler.cc │ │ │ └── store_handler.h │ │ ├── nccl/ │ │ │ ├── CMakeLists.txt │ │ │ ├── cuda_nccl_gpu.cc │ │ │ ├── cuda_nccl_gpu.h │ │ │ ├── cuda_nccl_op_gpu.cc │ │ │ └── nccl_ops_test.py │ │ ├── nervana/ │ │ │ ├── CMakeLists.txt │ │ │ ├── nervana.h │ │ │ ├── nervana_c_api.cu │ │ │ ├── nervana_c_api.h │ │ │ ├── nervana_fc_op_gpu.cc │ │ │ ├── nervana_fc_op_gpu_test.cc │ │ │ ├── nervana_init_gpu.cc │ │ │ └── nervana_math_gpu.cc │ │ ├── nnpack/ │ │ │ ├── nnpack_ops.cc │ │ │ └── nnpack_ops_test.py │ │ ├── playground/ │ │ │ ├── AnyExp.py │ │ │ ├── AnyExpOnTerm.py │ │ │ ├── ModuleRegister.py │ │ │ ├── README.md │ │ │ ├── __init__.py │ │ │ ├── checkpoint.py │ │ │ ├── compute_loss.py │ │ │ ├── compute_topk_accuracy.py │ │ │ ├── meter.py │ │ │ ├── module_map.py │ │ │ ├── output_generator.py │ │ │ └── resnet50demo/ │ │ │ ├── IN1k_resnet50.py │ │ │ ├── __init__.py │ │ │ ├── caffe2_resnet50_default_forward.py │ │ │ ├── caffe2_resnet50_default_param_update.py │ │ │ ├── explicit_resnet_forward.py │ │ │ ├── explicit_resnet_param_update.py │ │ │ ├── gfs_IN1k.py │ │ │ └── rendezvous_filestore.py │ │ ├── prof/ │ │ │ ├── CMakeLists.txt │ │ │ ├── cuda_profile_ops.cc │ │ │ ├── cuda_profile_ops_test.py │ │ │ ├── htrace_async_dag_net_gpu.cc │ │ │ ├── htrace_conf.cc │ │ │ ├── htrace_conf.h │ │ │ ├── htrace_dag_net.cc │ │ │ ├── htrace_to_chrome.py │ │ │ ├── prof_dag_net.cc │ │ │ ├── prof_dag_net.h │ │ │ ├── prof_dag_stats_op.cc │ │ │ └── prof_dag_stats_op.h │ │ ├── script/ │ │ │ ├── CMakeLists.txt │ │ │ ├── caffe2_script_test.py │ │ │ ├── compiler.cc │ │ │ ├── compiler.h │ │ │ ├── error_report.h │ │ │ ├── examples/ │ │ │ │ ├── example_beam_search.c2s │ │ │ │ ├── example_post_eos_penalty.c2s │ │ │ │ └── run_examples.py │ │ │ ├── lexer.cc │ │ │ ├── lexer.h │ │ │ ├── parser.h │ │ │ ├── tree.h │ │ │ └── tree_views.h │ │ ├── shm_mutex/ │ │ │ ├── CMakeLists.txt │ │ │ ├── shm_mutex.cc │ │ │ └── shm_mutex.h │ │ ├── tensorboard/ │ │ │ ├── __init__.py │ │ │ ├── tensorboard.md │ │ │ ├── tensorboard.py │ │ │ ├── tensorboard_exporter.py │ │ │ ├── tensorboard_exporter_test.py │ │ │ └── tensorboard_test.py │ │ ├── torch/ │ │ │ ├── th_ops.cc │ │ │ ├── th_ops_gpu.cu │ │ │ ├── th_ops_test.py │ │ │ ├── torch_op.cpp │ │ │ ├── torch_op.h │ │ │ ├── torch_op_gpu.cpp │ │ │ └── torch_ops_test.py │ │ └── warpctc/ │ │ ├── ctc_op.cpp │ │ ├── ctc_op.h │ │ ├── ctc_op_gpu.cpp │ │ └── ctc_ops_test.py │ ├── core/ │ │ ├── CMakeLists.txt │ │ ├── allocator.cc │ │ ├── allocator.h │ │ ├── asan.h │ │ ├── blob.h │ │ ├── blob_gpu_test.cc │ │ ├── blob_serialization.cc │ │ ├── blob_serialization.h │ │ ├── blob_serialization_gpu.cc │ │ ├── blob_serializer_base.h │ │ ├── blob_stats.cc │ │ ├── blob_stats.h │ │ ├── blob_test.cc │ │ ├── common.cc │ │ ├── common.h │ │ ├── common_cudnn.cc │ │ ├── common_cudnn.h │ │ ├── common_gpu.cc │ │ ├── common_gpu.h │ │ ├── common_omp.h │ │ ├── common_test.cc │ │ ├── context.cc │ │ ├── context.h │ │ ├── context_gpu.cu │ │ ├── context_gpu.h │ │ ├── context_gpu_test.cc │ │ ├── context_test.cc │ │ ├── cudnn_wrappers.h │ │ ├── db.cc │ │ ├── db.h │ │ ├── event.cc │ │ ├── event.h │ │ ├── event_cpu.h │ │ ├── event_gpu.cc │ │ ├── event_gpu_test.cc │ │ ├── event_test.cc │ │ ├── flags.cc │ │ ├── flags.h │ │ ├── graph.cc │ │ ├── graph.h │ │ ├── graph_test.cc │ │ ├── init.cc │ │ ├── init.h │ │ ├── init_intrinsics_check.cc │ │ ├── init_omp.cc │ │ ├── init_test.cc │ │ ├── logging.cc │ │ ├── logging.h │ │ ├── logging_is_google_glog.h │ │ ├── logging_is_not_google_glog.h │ │ ├── logging_test.cc │ │ ├── macros.h │ │ ├── macros.h.in │ │ ├── memonger.cc │ │ ├── memonger.h │ │ ├── module.cc │ │ ├── module.h │ │ ├── module_test.cc │ │ ├── net.cc │ │ ├── net.h │ │ ├── net_async_base.cc │ │ ├── net_async_base.h │ │ ├── net_async_dag_gpu.cc │ │ ├── net_async_dag_gpu.h │ │ ├── net_async_gpu_thread_pool.h │ │ ├── net_async_gpu_thread_pool_gpu.cc │ │ ├── net_async_polling.cc │ │ ├── net_async_polling.h │ │ ├── net_async_scheduling.cc │ │ ├── net_async_scheduling.h │ │ ├── net_dag.cc │ │ ├── net_dag.h │ │ ├── net_dag_utils.cc │ │ ├── net_dag_utils.h │ │ ├── net_gpu_test.cc │ │ ├── net_simple.cc │ │ ├── net_simple.h │ │ ├── net_simple_async.cc │ │ ├── net_simple_async.h │ │ ├── net_singlethread_async_gpu.cc │ │ ├── net_test.cc │ │ ├── numa.cc │ │ ├── numa.h │ │ ├── observer.h │ │ ├── observer_test.cc │ │ ├── operator.cc │ │ ├── operator.h │ │ ├── operator_gpu_test.cc │ │ ├── operator_gradient.h │ │ ├── operator_schema.cc │ │ ├── operator_schema.h │ │ ├── operator_schema_test.cc │ │ ├── operator_test.cc │ │ ├── parallel_net_test.cc │ │ ├── plan_executor.cc │ │ ├── plan_executor.h │ │ ├── predictor.cc │ │ ├── predictor.h │ │ ├── predictor_test.cc │ │ ├── qtensor.cc │ │ ├── qtensor.h │ │ ├── qtensor_serialization.cc │ │ ├── qtensor_serialization.h │ │ ├── registry.h │ │ ├── registry_test.cc │ │ ├── scope_guard.h │ │ ├── static_tracepoint.h │ │ ├── static_tracepoint_elfx86.h │ │ ├── stats.cc │ │ ├── stats.h │ │ ├── stats_test.cc │ │ ├── tensor.cc │ │ ├── tensor.h │ │ ├── timer.h │ │ ├── timer_test.cc │ │ ├── transform.cc │ │ ├── transform.h │ │ ├── transform_test.cc │ │ ├── typeid.cc │ │ ├── typeid.h │ │ ├── typeid_test.cc │ │ ├── types.cc │ │ ├── types.h │ │ ├── workspace.cc │ │ ├── workspace.h │ │ └── workspace_test.cc │ ├── cuda_rtc/ │ │ ├── CMakeLists.txt │ │ ├── common_rtc.h │ │ ├── elemenntwise_rtc_gpu.cc │ │ └── pool_op_rtc_gpu.cc │ ├── db/ │ │ ├── CMakeLists.txt │ │ ├── create_db_op.cc │ │ ├── create_db_op.h │ │ ├── create_db_op_gpu.cc │ │ ├── db_test.cc │ │ ├── leveldb.cc │ │ ├── lmdb.cc │ │ ├── protodb.cc │ │ └── zmqdb.cc │ ├── distributed/ │ │ ├── CMakeLists.txt │ │ ├── file_store_handler.cc │ │ ├── file_store_handler.h │ │ ├── file_store_handler_op.cc │ │ ├── file_store_handler_op.h │ │ ├── file_store_handler_op_gpu.cc │ │ ├── file_store_handler_op_test.py │ │ ├── py_export.cc │ │ ├── redis_store_handler.cc │ │ ├── redis_store_handler.h │ │ ├── redis_store_handler_op.cc │ │ ├── redis_store_handler_op.h │ │ ├── redis_store_handler_op_gpu.cc │ │ ├── redis_store_handler_op_test.py │ │ ├── store_handler.cc │ │ ├── store_handler.h │ │ ├── store_ops.cc │ │ ├── store_ops.h │ │ └── store_ops_test_util.py │ ├── experiments/ │ │ ├── operators/ │ │ │ ├── fully_connected_op_decomposition.cc │ │ │ ├── fully_connected_op_decomposition.h │ │ │ ├── fully_connected_op_decomposition_gpu.cc │ │ │ ├── fully_connected_op_prune.cc │ │ │ ├── fully_connected_op_prune.h │ │ │ ├── fully_connected_op_sparse.cc │ │ │ ├── fully_connected_op_sparse.h │ │ │ ├── funhash_op.cc │ │ │ ├── funhash_op.h │ │ │ ├── sparse_funhash_op.cc │ │ │ ├── sparse_funhash_op.h │ │ │ ├── sparse_matrix_reshape_op.cc │ │ │ ├── sparse_matrix_reshape_op.h │ │ │ ├── tt_contraction_op.cc │ │ │ ├── tt_contraction_op.h │ │ │ ├── tt_contraction_op_gpu.cc │ │ │ ├── tt_pad_op.cc │ │ │ └── tt_pad_op.h │ │ └── python/ │ │ ├── SparseTransformer.py │ │ ├── convnet_benchmarks.py │ │ ├── device_reduce_sum_bench.py │ │ ├── funhash_op_test.py │ │ ├── net_construct_bench.py │ │ ├── sparse_funhash_op_test.py │ │ ├── sparse_reshape_op_test.py │ │ ├── tt_contraction_op_test.py │ │ └── tt_pad_op_test.py │ ├── image/ │ │ ├── CMakeLists.txt │ │ ├── image_input_op.cc │ │ ├── image_input_op.h │ │ ├── image_input_op_gpu.cc │ │ ├── transform_gpu.cu │ │ └── transform_gpu.h │ ├── mkl/ │ │ ├── CMakeLists.txt │ │ ├── mkl_operator.cc │ │ ├── mkl_utils.h │ │ ├── mkl_utils_test.cc │ │ ├── mklmemory_serialization.cc │ │ ├── mklmemory_serialization_test.cc │ │ ├── operators/ │ │ │ ├── concat_op.cc │ │ │ ├── conv_op.cc │ │ │ ├── conv_op_mkldnn.cc │ │ │ ├── elementwise_sum_op.cc │ │ │ ├── fully_connected_op.cc │ │ │ ├── local_response_normalization_op.cc │ │ │ ├── operator_fallback_mkl.cc │ │ │ ├── operator_fallback_mkl.h │ │ │ ├── packed_fc_op.cc │ │ │ ├── pool_op.cc │ │ │ ├── relu_op.cc │ │ │ ├── spatial_batch_norm_op.cc │ │ │ ├── squeeze_op.cc │ │ │ └── utility_ops.cc │ │ └── utils/ │ │ ├── mkl_context.cc │ │ ├── mkl_context.h │ │ ├── mkl_dnn_cppwrapper.h │ │ ├── mkl_memory.cc │ │ ├── mkl_memory.h │ │ ├── mkl_operator.h │ │ ├── mkl_version_check.h │ │ └── sgemm_pack.h │ ├── mobile/ │ │ ├── CMakeLists.txt │ │ └── contrib/ │ │ ├── CMakeLists.txt │ │ ├── arm-compute/ │ │ │ ├── CMakeLists.txt │ │ │ ├── README.md │ │ │ ├── core/ │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── context.cc │ │ │ │ ├── context.h │ │ │ │ ├── net_gl.cc │ │ │ │ ├── net_gl.h │ │ │ │ ├── operator.cc │ │ │ │ ├── operator.h │ │ │ │ ├── rewrite_net.cc │ │ │ │ └── rewrite_net.h │ │ │ ├── models/ │ │ │ │ ├── squeezenet_init.pb │ │ │ │ └── squeezenet_predict.pb │ │ │ ├── operators/ │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── activation_ops.cc │ │ │ │ ├── activation_ops.h │ │ │ │ ├── concat_op.cc │ │ │ │ ├── conv_op.cc │ │ │ │ ├── copy_op.cc │ │ │ │ ├── elementwise_sum_op.cc │ │ │ │ ├── fully_connected_op.cc │ │ │ │ ├── norm_planar_yuv_op.cc │ │ │ │ ├── pool_op.cc │ │ │ │ ├── reshape_op.cc │ │ │ │ ├── resize_op.cc │ │ │ │ ├── softmax_op.cc │ │ │ │ └── spatial_batch_norm_op.cc │ │ │ ├── run_tests.sh │ │ │ └── test/ │ │ │ ├── CMakeLists.txt │ │ │ ├── gl_activation_ops_test.cc │ │ │ ├── gl_alignment_test.cc │ │ │ ├── gl_concat_op_test.cc │ │ │ ├── gl_context_test.cc │ │ │ ├── gl_conv_op_test.cc │ │ │ ├── gl_copy_op_test.cc │ │ │ ├── gl_elementwise_sum_op_test.cc │ │ │ ├── gl_fully_connected_op_test.cc │ │ │ ├── gl_model_test.cc │ │ │ ├── gl_model_test.h │ │ │ ├── gl_norm_planar_yuv_op_test.cc │ │ │ ├── gl_operator_test.h │ │ │ ├── gl_pool_op_test.cc │ │ │ ├── gl_resize_op_test.cc │ │ │ ├── gl_softmax_op_test.cc │ │ │ └── gl_spatial_batch_norm_op_test.cc │ │ ├── ios/ │ │ │ ├── CMakeLists.txt │ │ │ ├── ios_caffe.cc │ │ │ ├── ios_caffe.h │ │ │ ├── ios_caffe_defines.h │ │ │ ├── ios_caffe_predictor.cc │ │ │ ├── ios_caffe_predictor.h │ │ │ ├── mpscnn/ │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── MPSCNN.metal │ │ │ │ ├── mpscnn.h │ │ │ │ ├── mpscnn.mm │ │ │ │ ├── mpscnn_context.h │ │ │ │ ├── mpscnn_context.mm │ │ │ │ ├── mpscnn_graph.mm │ │ │ │ ├── mpscnn_graph_mask.h │ │ │ │ ├── mpscnn_graph_mask.mm │ │ │ │ ├── mpscnn_kernels.h │ │ │ │ ├── mpscnn_test.h │ │ │ │ └── mpscnn_test.mm │ │ │ ├── pool_test.cc │ │ │ └── resize_test.cc │ │ ├── libopencl-stub/ │ │ │ ├── Android.mk │ │ │ ├── LICENSE │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ ├── include/ │ │ │ │ ├── CL/ │ │ │ │ │ ├── cl.h │ │ │ │ │ ├── cl.hpp │ │ │ │ │ ├── cl_ext.h │ │ │ │ │ ├── cl_gl.h │ │ │ │ │ ├── cl_gl_ext.h │ │ │ │ │ ├── cl_platform.h │ │ │ │ │ └── opencl.h │ │ │ │ └── libopencl.h │ │ │ └── src/ │ │ │ └── libopencl.c │ │ ├── libvulkan-stub/ │ │ │ ├── include/ │ │ │ │ ├── libvulkan-stub.h │ │ │ │ └── vulkan/ │ │ │ │ ├── vk_platform.h │ │ │ │ └── vulkan.h │ │ │ └── src/ │ │ │ └── libvulkan-stub.c │ │ ├── nnapi/ │ │ │ ├── CMakeLists.txt │ │ │ ├── NeuralNetworks.h │ │ │ ├── dlnnapi.c │ │ │ ├── dlnnapi.h │ │ │ ├── nnapi.cc │ │ │ ├── nnapi.h │ │ │ ├── nnapi_benchmark.cc │ │ │ └── nnapi_test.cc │ │ ├── opengl/ │ │ │ ├── CMakeLists.txt │ │ │ ├── android/ │ │ │ │ ├── AndroidGLContext.cc │ │ │ │ ├── AndroidGLContext.h │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── GLContext.cc │ │ │ │ ├── GLImageAllocator.cc │ │ │ │ ├── arm_neon_support.h │ │ │ │ ├── gl3stub.c │ │ │ │ └── gl3stub.h │ │ │ ├── core/ │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── DataTransfer.cc │ │ │ │ ├── DataTransfer.h │ │ │ │ ├── GL.h │ │ │ │ ├── GLContext.cc │ │ │ │ ├── GLContext.h │ │ │ │ ├── GLFilter.cc │ │ │ │ ├── GLFilter.h │ │ │ │ ├── GLImage.cc │ │ │ │ ├── GLImage.h │ │ │ │ ├── GLImageAllocator.cc │ │ │ │ ├── GLImageAllocator.h │ │ │ │ ├── GLLogging.h │ │ │ │ ├── GLPBO.cc │ │ │ │ ├── GLPBO.h │ │ │ │ ├── GLPlainTexture.cc │ │ │ │ ├── GLPlainTexture.h │ │ │ │ ├── GLPredictor.cc │ │ │ │ ├── GLPredictor.h │ │ │ │ ├── GLTexture.cc │ │ │ │ ├── GLTexture.h │ │ │ │ ├── ImageAllocator.h │ │ │ │ ├── arm_neon_support.h │ │ │ │ ├── rewrite_net.cc │ │ │ │ └── rewrite_net.h │ │ │ ├── ios/ │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── GLContext.cc │ │ │ │ ├── GLImageAllocator.cc │ │ │ │ ├── IOSGLContext.h │ │ │ │ ├── IOSGLContext.mm │ │ │ │ ├── IOSGLImageAllocator.cc │ │ │ │ ├── IOSGLImageAllocator.h │ │ │ │ ├── IOSGLTexture.h │ │ │ │ └── IOSGLTexture.mm │ │ │ ├── operators/ │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── GLAdd.cc │ │ │ │ ├── GLConcat.cc │ │ │ │ ├── GLConvolution.cc │ │ │ │ ├── GLConvolution.h │ │ │ │ ├── GLCopyOps.cc │ │ │ │ ├── GLInstanceNorm.cc │ │ │ │ ├── GLMul.cc │ │ │ │ ├── GLNormPlanarYUV.cc │ │ │ │ ├── GLPRelu.cc │ │ │ │ ├── GLPadImage.cc │ │ │ │ ├── GLPool.cc │ │ │ │ ├── GLResize.cc │ │ │ │ ├── GLSigmoid.cc │ │ │ │ ├── GLSoftmax.cc │ │ │ │ ├── GLStylizer.cc │ │ │ │ ├── GLSub.cc │ │ │ │ └── gl_tiling_utils.h │ │ │ └── test/ │ │ │ ├── TestGLConvolution.cc │ │ │ ├── TestGLConvolution.h │ │ │ ├── opengl_test.cc │ │ │ └── opengl_test.h │ │ ├── snpe/ │ │ │ ├── CMakeLists.txt │ │ │ ├── README.md │ │ │ ├── snpe_ffi.cc │ │ │ ├── snpe_ffi.h │ │ │ ├── snpe_globals.cc │ │ │ ├── snpe_op.cc │ │ │ └── snpe_op_benchmark.cc │ │ └── ulp2/ │ │ ├── ulp.cc │ │ ├── ulp.h │ │ ├── ulp_neon.cc │ │ ├── ulp_neon.h │ │ └── ulp_test.cc │ ├── mpi/ │ │ ├── CMakeLists.txt │ │ ├── mpi_common.cc │ │ ├── mpi_common.h │ │ ├── mpi_gpu_test.cc │ │ ├── mpi_ops.cc │ │ ├── mpi_ops.h │ │ ├── mpi_ops_gpu.cc │ │ └── mpi_test.cc │ ├── observers/ │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── operator_attaching_net_observer.h │ │ ├── runcnt_observer.cc │ │ ├── runcnt_observer.h │ │ ├── time_observer.cc │ │ ├── time_observer.h │ │ └── time_observer_test.cc │ ├── onnx/ │ │ ├── CMakeLists.txt │ │ ├── backend.cc │ │ ├── backend.h │ │ ├── backend_rep.cc │ │ ├── backend_rep.h │ │ ├── device.cc │ │ ├── device.h │ │ ├── helper.cc │ │ └── helper.h │ ├── operators/ │ │ ├── CMakeLists.txt │ │ ├── abs_op.cc │ │ ├── abs_op.cu │ │ ├── accumulate_op.cc │ │ ├── accumulate_op.cu │ │ ├── accumulate_op.h │ │ ├── accuracy_op.cc │ │ ├── accuracy_op.cu │ │ ├── accuracy_op.h │ │ ├── apmeter_op.cc │ │ ├── apmeter_op.h │ │ ├── assert_op.cc │ │ ├── assert_op.cu │ │ ├── assert_op.h │ │ ├── atomic_ops.cc │ │ ├── batch_box_cox_op.cc │ │ ├── batch_box_cox_op.h │ │ ├── batch_gather_ops.cc │ │ ├── batch_gather_ops.cu │ │ ├── batch_gather_ops.h │ │ ├── batch_matmul_op.cc │ │ ├── batch_matmul_op.cu │ │ ├── batch_matmul_op.h │ │ ├── batch_matmul_op_gpu_test.cc │ │ ├── batch_matmul_op_test.cc │ │ ├── batch_sparse_to_dense_op.cc │ │ ├── batch_sparse_to_dense_op.h │ │ ├── bbox_transform_op.cc │ │ ├── bbox_transform_op.h │ │ ├── boolean_mask_ops.cc │ │ ├── boolean_mask_ops.cu │ │ ├── boolean_mask_ops.h │ │ ├── boolean_unmask_ops.cc │ │ ├── boolean_unmask_ops.cu │ │ ├── boolean_unmask_ops.h │ │ ├── boolean_unmask_ops_test.cc │ │ ├── box_with_nms_limit_op.cc │ │ ├── box_with_nms_limit_op.h │ │ ├── cast_op.cc │ │ ├── cast_op.cu │ │ ├── cast_op.h │ │ ├── ceil_op.cc │ │ ├── ceil_op.cu │ │ ├── ceil_op.h │ │ ├── channel_backprop_stats_op.cc │ │ ├── channel_backprop_stats_op.h │ │ ├── channel_shuffle_op.cc │ │ ├── channel_shuffle_op.h │ │ ├── channel_shuffle_op_gpu.cu │ │ ├── channel_stats_op.cc │ │ ├── channel_stats_op.cu │ │ ├── channel_stats_op.h │ │ ├── clip_op.cc │ │ ├── clip_op.cu │ │ ├── clip_op.h │ │ ├── communicator_op.cc │ │ ├── communicator_op_gpu.cc │ │ ├── concat_split_op.cc │ │ ├── concat_split_op.h │ │ ├── concat_split_op_gpu.cc │ │ ├── conditional_op.cc │ │ ├── conditional_op.h │ │ ├── conv_gradient_op.cc │ │ ├── conv_op.cc │ │ ├── conv_op.h │ │ ├── conv_op_cache_cudnn.cc │ │ ├── conv_op_cache_cudnn.h │ │ ├── conv_op_cache_cudnn_test.cc │ │ ├── conv_op_cudnn.cc │ │ ├── conv_op_eigen.cc │ │ ├── conv_op_gpu.cc │ │ ├── conv_op_impl.h │ │ ├── conv_op_shared.cc │ │ ├── conv_op_shared.h │ │ ├── conv_op_shared_gpu.cc │ │ ├── conv_pool_op_base.h │ │ ├── conv_transpose_gradient_op.cc │ │ ├── conv_transpose_op.cc │ │ ├── conv_transpose_op.h │ │ ├── conv_transpose_op_cudnn.cc │ │ ├── conv_transpose_op_gpu.cc │ │ ├── conv_transpose_op_impl.h │ │ ├── conv_transpose_op_mobile.cc │ │ ├── conv_transpose_op_mobile.h │ │ ├── conv_transpose_op_mobile_impl.h │ │ ├── conv_transpose_op_mobile_test.cc │ │ ├── conv_transpose_unpool_op_base.h │ │ ├── cos_op.cc │ │ ├── cos_op.cu │ │ ├── cosine_embedding_criterion_op.cc │ │ ├── cosine_embedding_criterion_op.cu │ │ ├── cosine_embedding_criterion_op.h │ │ ├── counter_ops.cc │ │ ├── counter_ops.h │ │ ├── counter_ops_gpu.cc │ │ ├── create_scope_op.cc │ │ ├── create_scope_op.h │ │ ├── cross_entropy_op.cc │ │ ├── cross_entropy_op.cu │ │ ├── cross_entropy_op.h │ │ ├── dataset_ops.cc │ │ ├── dataset_ops.h │ │ ├── deform_conv_gradient_op.cc │ │ ├── deform_conv_op.cc │ │ ├── deform_conv_op.cu │ │ ├── deform_conv_op.h │ │ ├── deform_conv_op_impl.h │ │ ├── distance_op.cc │ │ ├── distance_op.cu │ │ ├── distance_op.h │ │ ├── do_op.cc │ │ ├── do_op.h │ │ ├── do_op_gpu.cc │ │ ├── dropout_op.cc │ │ ├── dropout_op.cu │ │ ├── dropout_op.h │ │ ├── dropout_op_cudnn.cc │ │ ├── elementwise_add_op.cc │ │ ├── elementwise_div_op.cc │ │ ├── elementwise_linear_op.cc │ │ ├── elementwise_linear_op.cu │ │ ├── elementwise_linear_op.h │ │ ├── elementwise_logical_ops.cc │ │ ├── elementwise_logical_ops.h │ │ ├── elementwise_mul_op.cc │ │ ├── elementwise_op.cc │ │ ├── elementwise_op.cu │ │ ├── elementwise_op.h │ │ ├── elementwise_op_gpu_test.cc │ │ ├── elementwise_op_schema.cc │ │ ├── elementwise_op_test.cc │ │ ├── elementwise_op_test.h │ │ ├── elementwise_sub_op.cc │ │ ├── elementwise_sum_op.cc │ │ ├── elu_op.cc │ │ ├── elu_op.cu │ │ ├── elu_op.h │ │ ├── exp_op.cc │ │ ├── exp_op.cu │ │ ├── expand_squeeze_dims_op.cc │ │ ├── expand_squeeze_dims_op.h │ │ ├── expand_squeeze_dims_op_gpu.cc │ │ ├── extend_tensor_op.cc │ │ ├── feed_blob_op.cc │ │ ├── feed_blob_op.h │ │ ├── filler_op.cc │ │ ├── filler_op.cu │ │ ├── filler_op.h │ │ ├── filler_op_gpu.cc │ │ ├── find_duplicate_elements_op.cc │ │ ├── find_duplicate_elements_op.h │ │ ├── find_op.cc │ │ ├── find_op.cu │ │ ├── find_op.h │ │ ├── flatten_op.cc │ │ ├── flatten_op.h │ │ ├── flexible_top_k.cc │ │ ├── flexible_top_k.h │ │ ├── floor_op.cc │ │ ├── floor_op.cu │ │ ├── floor_op.h │ │ ├── free_op.cc │ │ ├── free_op.h │ │ ├── free_op_gpu.cc │ │ ├── fully_connected_op.cc │ │ ├── fully_connected_op.h │ │ ├── fully_connected_op_gpu.cc │ │ ├── fused_rowwise_8bit_conversion_ops.cc │ │ ├── fused_rowwise_8bit_conversion_ops.h │ │ ├── gather_fused_8bit_rowwise_op.cc │ │ ├── gather_fused_8bit_rowwise_op.h │ │ ├── gather_ranges_to_dense_op.cc │ │ ├── gather_ranges_to_dense_op.h │ │ ├── generate_proposals_op.cc │ │ ├── generate_proposals_op.h │ │ ├── generate_proposals_op_test.cc │ │ ├── generate_proposals_op_util_boxes.h │ │ ├── generate_proposals_op_util_boxes_test.cc │ │ ├── generate_proposals_op_util_nms.h │ │ ├── generate_proposals_op_util_nms_test.cc │ │ ├── given_tensor_fill_op.cc │ │ ├── given_tensor_fill_op.cu │ │ ├── given_tensor_fill_op.h │ │ ├── glu_op.cc │ │ ├── glu_op.cu │ │ ├── glu_op.h │ │ ├── gru_unit_op.cc │ │ ├── gru_unit_op.h │ │ ├── gru_unit_op_gpu.cu │ │ ├── h_softmax_op.cc │ │ ├── h_softmax_op.h │ │ ├── half_float_ops.cc │ │ ├── half_float_ops.cu │ │ ├── half_float_ops.h │ │ ├── if_op.cc │ │ ├── if_op.h │ │ ├── if_op_gpu.cc │ │ ├── im2col_op.cc │ │ ├── im2col_op.h │ │ ├── im2col_op_gpu.cc │ │ ├── index_hash_ops.cc │ │ ├── index_hash_ops.h │ │ ├── index_ops.cc │ │ ├── instance_norm_gradient_op.cc │ │ ├── instance_norm_op.cc │ │ ├── instance_norm_op.cu │ │ ├── instance_norm_op.h │ │ ├── jsd_op.cc │ │ ├── jsd_op.h │ │ ├── key_split_ops.cc │ │ ├── key_split_ops.h │ │ ├── last_n_window_collector.cc │ │ ├── layer_norm_op.cc │ │ ├── layer_norm_op.cu │ │ ├── layer_norm_op.h │ │ ├── leaky_relu_op.cc │ │ ├── leaky_relu_op.cu │ │ ├── leaky_relu_op.h │ │ ├── lengths_reducer_fused_8bit_rowwise_ops.cc │ │ ├── lengths_reducer_fused_8bit_rowwise_ops.h │ │ ├── lengths_reducer_ops.cc │ │ ├── lengths_reducer_ops.h │ │ ├── lengths_reducer_rowwise_8bit_ops.cc │ │ ├── lengths_reducer_rowwise_8bit_ops.h │ │ ├── lengths_tile_op.cc │ │ ├── lengths_tile_op.h │ │ ├── lengths_tile_op_gpu.cc │ │ ├── lengths_top_k_op.cc │ │ ├── lengths_top_k_op.h │ │ ├── listwise_l2r_op.cc │ │ ├── listwise_l2r_op.h │ │ ├── load_save_op.cc │ │ ├── load_save_op.h │ │ ├── load_save_op_gpu.cc │ │ ├── local_response_normalization_op.cc │ │ ├── local_response_normalization_op.cu │ │ ├── local_response_normalization_op.h │ │ ├── local_response_normalization_op_cudnn.cc │ │ ├── locally_connected_op.cc │ │ ├── locally_connected_op.h │ │ ├── locally_connected_op_gpu.cc │ │ ├── locally_connected_op_impl.h │ │ ├── locally_connected_op_util.cc │ │ ├── locally_connected_op_util.h │ │ ├── log_op.cc │ │ ├── log_op.cu │ │ ├── logit_op.cc │ │ ├── logit_op.cu │ │ ├── logit_op.h │ │ ├── loss_op.cc │ │ ├── loss_op.cu │ │ ├── loss_op.h │ │ ├── lp_pool_op.cc │ │ ├── lp_pool_op.cu │ │ ├── lpnorm_op.cc │ │ ├── lpnorm_op.h │ │ ├── lstm_unit_op.cc │ │ ├── lstm_unit_op.h │ │ ├── lstm_unit_op_gpu.cu │ │ ├── map_ops.cc │ │ ├── map_ops.h │ │ ├── margin_ranking_criterion_op.cc │ │ ├── margin_ranking_criterion_op.cu │ │ ├── margin_ranking_criterion_op.h │ │ ├── math_ops.cc │ │ ├── math_ops.cu │ │ ├── math_ops.h │ │ ├── matmul_op.cc │ │ ├── matmul_op.h │ │ ├── matmul_op_gpu.cc │ │ ├── max_pool_with_index.cu │ │ ├── max_pool_with_index.h │ │ ├── mean_op.cc │ │ ├── mean_op.cu │ │ ├── mean_op.h │ │ ├── mem_query_op.cu │ │ ├── merge_id_lists_op.cc │ │ ├── merge_id_lists_op.h │ │ ├── minmax_gradient_ops.cc │ │ ├── minmax_ops.cc │ │ ├── minmax_ops.h │ │ ├── mod_op.cc │ │ ├── mod_op.h │ │ ├── multi_class_accuracy_op.cc │ │ ├── multi_class_accuracy_op.cu │ │ ├── multi_class_accuracy_op.h │ │ ├── negate_gradient_op.cc │ │ ├── negate_gradient_op.h │ │ ├── negate_gradient_op_gpu.cc │ │ ├── negative_op.cc │ │ ├── negative_op.cu │ │ ├── ngram_ops.cc │ │ ├── ngram_ops.h │ │ ├── no_default_engine_op.h │ │ ├── norm_planar_yuv_op.cc │ │ ├── normalize_l1_op.cc │ │ ├── normalize_l1_op.h │ │ ├── normalize_op.cc │ │ ├── normalize_op.h │ │ ├── normalize_ops.cu │ │ ├── one_hot_ops.cc │ │ ├── one_hot_ops.cu │ │ ├── one_hot_ops.h │ │ ├── onnx_while_op.cc │ │ ├── onnx_while_op.h │ │ ├── op_utils_cudnn.h │ │ ├── operator_fallback_gpu.h │ │ ├── operator_fallback_gpu_test.cc │ │ ├── order_switch_ops.cc │ │ ├── order_switch_ops.cu │ │ ├── order_switch_ops.h │ │ ├── pack_rnn_sequence_op.cc │ │ ├── pack_rnn_sequence_op.h │ │ ├── pack_segments.cc │ │ ├── pack_segments.cu │ │ ├── pack_segments.h │ │ ├── pad_op.cc │ │ ├── pad_op.h │ │ ├── pad_op_gpu.cu │ │ ├── partition_ops.cc │ │ ├── partition_ops.h │ │ ├── percentile_op.cc │ │ ├── percentile_op.h │ │ ├── perplexity_op.cc │ │ ├── perplexity_op.cu │ │ ├── perplexity_op.h │ │ ├── piecewise_linear_transform_op.cc │ │ ├── piecewise_linear_transform_op.cu │ │ ├── piecewise_linear_transform_op.h │ │ ├── pool_gradient_op.cc │ │ ├── pool_op.cc │ │ ├── pool_op.cu │ │ ├── pool_op.h │ │ ├── pool_op_cudnn.cu │ │ ├── pow_op.cc │ │ ├── pow_op.cu │ │ ├── pow_op.h │ │ ├── prefetch_op.h │ │ ├── prelu_op.cc │ │ ├── prelu_op.cu │ │ ├── prelu_op.h │ │ ├── prepend_dim_op.cc │ │ ├── prepend_dim_op.h │ │ ├── prepend_dim_op_gpu.cc │ │ ├── quant_decode_op.cc │ │ ├── quant_decode_op.h │ │ ├── rank_loss_op.cc │ │ ├── rank_loss_op.h │ │ ├── recurrent_network_blob_fetcher_op.cc │ │ ├── recurrent_network_blob_fetcher_op.h │ │ ├── recurrent_network_blob_fetcher_op_gpu.cc │ │ ├── recurrent_network_executor.cc │ │ ├── recurrent_network_executor.h │ │ ├── recurrent_network_executor_gpu.cc │ │ ├── recurrent_network_executor_gpu.h │ │ ├── recurrent_network_executor_incl.h │ │ ├── recurrent_network_op.cc │ │ ├── recurrent_network_op.h │ │ ├── recurrent_network_op_gpu.cu │ │ ├── recurrent_op_cudnn.cc │ │ ├── recurrent_op_cudnn.h │ │ ├── reduce_ops.cc │ │ ├── reduce_ops.h │ │ ├── reducer_functors.h │ │ ├── reduction_front_back_ops.cc │ │ ├── reduction_front_back_ops.cu │ │ ├── reduction_front_back_ops.h │ │ ├── reduction_ops.cc │ │ ├── reduction_ops.cu │ │ ├── reduction_ops.h │ │ ├── relu_op.cc │ │ ├── relu_op.cu │ │ ├── relu_op.h │ │ ├── relu_op_cudnn.cc │ │ ├── relu_op_fp16.cu │ │ ├── remove_data_blocks_op.cc │ │ ├── remove_data_blocks_op.h │ │ ├── replace_nan_op.cc │ │ ├── replace_nan_op.cu │ │ ├── replace_nan_op.h │ │ ├── reservoir_sampling.cc │ │ ├── reshape_op.cc │ │ ├── reshape_op.h │ │ ├── reshape_op_gpu.cc │ │ ├── reshape_op_gpu_test.cc │ │ ├── resize_op.cc │ │ ├── resize_op.cu │ │ ├── resize_op.h │ │ ├── reverse_packed_segs_op.cc │ │ ├── reverse_packed_segs_op.cu │ │ ├── reverse_packed_segs_op.h │ │ ├── rmac_regions_op.cc │ │ ├── rmac_regions_op.cu │ │ ├── rmac_regions_op.h │ │ ├── roi_align_gradient_op.cc │ │ ├── roi_align_gradient_op.cu │ │ ├── roi_align_gradient_op.h │ │ ├── roi_align_op.cc │ │ ├── roi_align_op.cu │ │ ├── roi_align_op.h │ │ ├── roi_align_op_gpu_test.cc │ │ ├── roi_pool_op.cc │ │ ├── roi_pool_op.cu │ │ ├── roi_pool_op.h │ │ ├── rowmul_op.cc │ │ ├── rowmul_op.h │ │ ├── scale_op.cc │ │ ├── scale_op.h │ │ ├── scale_op_gpu.cc │ │ ├── segment_reduction_op.cc │ │ ├── segment_reduction_op.h │ │ ├── segment_reduction_op_gpu.cu │ │ ├── selu_op.cc │ │ ├── selu_op.cu │ │ ├── selu_op.h │ │ ├── sequence_ops.cc │ │ ├── sequence_ops.cu │ │ ├── sequence_ops.h │ │ ├── shape_op.cc │ │ ├── shape_op.h │ │ ├── shape_op_gpu.cc │ │ ├── sigmoid_op.cc │ │ ├── sigmoid_op.cu │ │ ├── sin_op.cc │ │ ├── sin_op.cu │ │ ├── sinusoid_position_encoding_op.cc │ │ ├── sinusoid_position_encoding_op.h │ │ ├── slice_op.cc │ │ ├── slice_op.cu │ │ ├── slice_op.h │ │ ├── softmax_op.cc │ │ ├── softmax_op.h │ │ ├── softmax_op_cudnn.cc │ │ ├── softmax_ops.cu │ │ ├── softmax_shared.cc │ │ ├── softmax_shared.h │ │ ├── softmax_with_loss_op.cc │ │ ├── softmax_with_loss_op.h │ │ ├── softplus_op.cc │ │ ├── softplus_op.cu │ │ ├── softplus_op.h │ │ ├── softsign_op.cc │ │ ├── softsign_op.cu │ │ ├── space_batch_op.cc │ │ ├── space_batch_op.h │ │ ├── space_batch_op_gpu.cu │ │ ├── sparse_normalize_op.cc │ │ ├── sparse_normalize_op.h │ │ ├── sparse_to_dense_mask_op.cc │ │ ├── sparse_to_dense_mask_op.h │ │ ├── sparse_to_dense_op.cc │ │ ├── sparse_to_dense_op.cu │ │ ├── sparse_to_dense_op.h │ │ ├── spatial_batch_norm_gradient_op.cc │ │ ├── spatial_batch_norm_op.cc │ │ ├── spatial_batch_norm_op.h │ │ ├── spatial_batch_norm_op_cudnn.cc │ │ ├── spatial_softmax_with_loss_op.cc │ │ ├── spatial_softmax_with_loss_op.h │ │ ├── sqrt_op.cc │ │ ├── sqrt_op.cu │ │ ├── square_root_divide_op.cc │ │ ├── square_root_divide_op.h │ │ ├── stats_ops.cc │ │ ├── stop_gradient.cc │ │ ├── stop_gradient.h │ │ ├── stop_gradient_gpu.cc │ │ ├── string_ops.cc │ │ ├── string_ops.h │ │ ├── string_ops_test.cc │ │ ├── stylizer_ops.cc │ │ ├── summarize_op.cc │ │ ├── summarize_op.cu │ │ ├── summarize_op.h │ │ ├── swish_op.cc │ │ ├── swish_op.cu │ │ ├── swish_op.h │ │ ├── tanh_op.cc │ │ ├── tanh_op.cu │ │ ├── tensor_protos_db_input.cc │ │ ├── tensor_protos_db_input.h │ │ ├── tensor_protos_db_input_gpu.cc │ │ ├── text_file_reader.cc │ │ ├── text_file_reader_utils.cc │ │ ├── text_file_reader_utils.h │ │ ├── text_file_reader_utils_test.cc │ │ ├── thresholded_relu_op.cc │ │ ├── thresholded_relu_op.cu │ │ ├── thresholded_relu_op.h │ │ ├── tile_op.cc │ │ ├── tile_op.cu │ │ ├── tile_op.h │ │ ├── top_k.cc │ │ ├── top_k.cu │ │ ├── top_k.h │ │ ├── top_k_heap_selection.cuh │ │ ├── top_k_radix_selection.cuh │ │ ├── transpose_op.cc │ │ ├── transpose_op.cu │ │ ├── transpose_op.h │ │ ├── transpose_op_cudnn.cc │ │ ├── tt_linear_op.cc │ │ ├── tt_linear_op.h │ │ ├── utility_ops.cc │ │ ├── utility_ops.cu │ │ ├── utility_ops.h │ │ ├── utility_ops_gpu.cc │ │ ├── utility_ops_gpu_test.cc │ │ ├── utility_ops_test.cc │ │ ├── variable_length_sequence_padding.cc │ │ ├── variable_length_sequence_padding.h │ │ ├── weighted_sample_op.cc │ │ ├── weighted_sample_op.cu │ │ ├── weighted_sample_op.h │ │ ├── while_op.cc │ │ ├── while_op.h │ │ ├── while_op_gpu.cc │ │ ├── workspace_ops.cc │ │ ├── zero_gradient_op.cc │ │ ├── zero_gradient_op.h │ │ └── zero_gradient_op_gpu.cc │ ├── perfkernels/ │ │ ├── CMakeLists.txt │ │ ├── common.h │ │ ├── common_avx.cc │ │ ├── common_avx2.cc │ │ ├── cvtsh_ss_bugfix.h │ │ ├── embedding_lookup.cc │ │ ├── embedding_lookup.h │ │ ├── embedding_lookup_avx2.cc │ │ ├── embedding_lookup_fused_8bit_rowwise_avx2.cc │ │ ├── fused_8bit_rowwise_embedding_lookup.cc │ │ ├── fused_8bit_rowwise_embedding_lookup.h │ │ ├── hp_emblookup_codegen.py │ │ ├── typed_axpy.cc │ │ ├── typed_axpy.h │ │ ├── typed_axpy_avx.cc │ │ └── typed_axpy_avx2.cc │ ├── proto/ │ │ ├── CMakeLists.txt │ │ ├── __init__.py │ │ ├── caffe2.proto │ │ ├── caffe2_legacy.proto │ │ ├── hsm.proto │ │ ├── metanet.proto │ │ ├── predictor_consts.proto │ │ └── prof_dag.proto │ ├── python/ │ │ ├── CMakeLists.txt │ │ ├── __init__.py │ │ ├── _import_c_extension.py │ │ ├── allcompare_test.py │ │ ├── attention.py │ │ ├── benchmark_generator.py │ │ ├── binarysize.py │ │ ├── brew.py │ │ ├── brew_test.py │ │ ├── build.py │ │ ├── cached_reader.py │ │ ├── caffe_translator.py │ │ ├── caffe_translator_test.py │ │ ├── checkpoint.py │ │ ├── checkpoint_test.py │ │ ├── cnn.py │ │ ├── context.py │ │ ├── context_test.py │ │ ├── control.py │ │ ├── control_ops_grad.py │ │ ├── control_ops_util.py │ │ ├── control_test.py │ │ ├── convnet_benchmarks.py │ │ ├── convnet_benchmarks_test.py │ │ ├── core.py │ │ ├── core_gradients_test.py │ │ ├── core_test.py │ │ ├── crf.py │ │ ├── data_parallel_model.py │ │ ├── data_parallel_model_test.py │ │ ├── data_parallel_model_utils.py │ │ ├── data_workers.py │ │ ├── data_workers_test.py │ │ ├── dataio.py │ │ ├── dataio_test.py │ │ ├── dataset.py │ │ ├── db_test.py │ │ ├── device_checker.py │ │ ├── dlpack.h │ │ ├── docs/ │ │ │ ├── formatter.py │ │ │ ├── generator.py │ │ │ ├── github.py │ │ │ └── parser.py │ │ ├── dyndep.py │ │ ├── embedding_generation_benchmark.py │ │ ├── examples/ │ │ │ ├── char_rnn.py │ │ │ ├── lmdb_create_example.py │ │ │ └── resnet50_trainer.py │ │ ├── experiment_util.py │ │ ├── extension_loader.py │ │ ├── functional.py │ │ ├── functional_test.py │ │ ├── fused_8bit_rowwise_conversion_ops_test.py │ │ ├── gradient_check_test.py │ │ ├── gradient_checker.py │ │ ├── gru_cell.py │ │ ├── helpers/ │ │ │ ├── __init__.py │ │ │ ├── algebra.py │ │ │ ├── arg_scope.py │ │ │ ├── array_helpers.py │ │ │ ├── control_ops.py │ │ │ ├── conv.py │ │ │ ├── db_input.py │ │ │ ├── dropout.py │ │ │ ├── elementwise_linear.py │ │ │ ├── fc.py │ │ │ ├── nonlinearity.py │ │ │ ├── normalization.py │ │ │ ├── pooling.py │ │ │ ├── tools.py │ │ │ └── train.py │ │ ├── hsm_util.py │ │ ├── hypothesis_test.py │ │ ├── hypothesis_test_util.py │ │ ├── layer_model_helper.py │ │ ├── layer_model_instantiator.py │ │ ├── layer_parameter_sharing_test.py │ │ ├── layer_test_util.py │ │ ├── layers/ │ │ │ ├── __init__.py │ │ │ ├── add_bias.py │ │ │ ├── arc_cosine_feature_map.py │ │ │ ├── batch_distill_lr_loss.py │ │ │ ├── batch_lr_loss.py │ │ │ ├── batch_mse_loss.py │ │ │ ├── batch_normalization.py │ │ │ ├── batch_sigmoid_cross_entropy_loss.py │ │ │ ├── batch_softmax_loss.py │ │ │ ├── concat.py │ │ │ ├── conv.py │ │ │ ├── dropout.py │ │ │ ├── fc.py │ │ │ ├── fc_without_bias.py │ │ │ ├── feature_sparse_to_dense.py │ │ │ ├── functional.py │ │ │ ├── gather_record.py │ │ │ ├── last_n_window_collector.py │ │ │ ├── layers.py │ │ │ ├── margin_rank_loss.py │ │ │ ├── merge_id_lists.py │ │ │ ├── pairwise_dot_product.py │ │ │ ├── position_weighted.py │ │ │ ├── random_fourier_features.py │ │ │ ├── reservoir_sampling.py │ │ │ ├── sampling_train.py │ │ │ ├── sampling_trainable_mixin.py │ │ │ ├── select_record_by_context.py │ │ │ ├── semi_random_features.py │ │ │ ├── sparse_feature_hash.py │ │ │ ├── sparse_lookup.py │ │ │ ├── split.py │ │ │ ├── tags.py │ │ │ └── uniform_sampling.py │ │ ├── layers_test.py │ │ ├── lengths_reducer_fused_8bit_rowwise_ops_test.py │ │ ├── lengths_reducer_rowwise_8bit_ops_test.py │ │ ├── lstm_benchmark.py │ │ ├── memonger.py │ │ ├── memonger_test.py │ │ ├── mint/ │ │ │ ├── app.py │ │ │ ├── static/ │ │ │ │ └── css/ │ │ │ │ └── simple-sidebar.css │ │ │ └── templates/ │ │ │ └── index.html │ │ ├── mkl/ │ │ │ ├── convnet_benchmarks.py │ │ │ ├── mkl_LRN_op_test.py │ │ │ ├── mkl_LRN_speed_test.py │ │ │ ├── mkl_concat_op_test.py │ │ │ ├── mkl_conv_op_test.py │ │ │ ├── mkl_copy_op_test.py │ │ │ ├── mkl_elementwise_add_op_test.py │ │ │ ├── mkl_elementwise_sum_op_test.py │ │ │ ├── mkl_fc_op_test.py │ │ │ ├── mkl_fc_speed_test.py │ │ │ ├── mkl_fill_op_test.py │ │ │ ├── mkl_pool_op_test.py │ │ │ ├── mkl_pool_speed_test.py │ │ │ ├── mkl_relu_op_test.py │ │ │ ├── mkl_sbn_op_test.py │ │ │ ├── mkl_sbn_speed_test.py │ │ │ ├── mkl_sigmoid_op_test.py │ │ │ ├── mkl_speed_test.py │ │ │ ├── mkl_squeeze_op_test.py │ │ │ ├── rewrite_graph.py │ │ │ └── rewrite_graph_test.py │ │ ├── mkl_test_util.py │ │ ├── model_device_test.py │ │ ├── model_helper.py │ │ ├── modeling/ │ │ │ ├── __init__.py │ │ │ ├── compute_norm_for_blobs.py │ │ │ ├── compute_norm_for_blobs_test.py │ │ │ ├── compute_statistics_for_blobs.py │ │ │ ├── compute_statistics_for_blobs_test.py │ │ │ ├── initializers.py │ │ │ ├── initializers_test.py │ │ │ ├── net_modifier.py │ │ │ ├── parameter_info.py │ │ │ ├── parameter_sharing.py │ │ │ └── parameter_sharing_test.py │ │ ├── models/ │ │ │ ├── __init__.py │ │ │ ├── __sym_init__.py │ │ │ ├── download.py │ │ │ ├── resnet.py │ │ │ ├── resnet_test.py │ │ │ └── seq2seq/ │ │ │ ├── __init__.py │ │ │ ├── beam_search.py │ │ │ ├── seq2seq_beam_search_test.py │ │ │ ├── seq2seq_model_helper.py │ │ │ ├── seq2seq_model_helper_test.py │ │ │ ├── seq2seq_util.py │ │ │ ├── train.py │ │ │ └── translate.py │ │ ├── modifier_context.py │ │ ├── mpi_python.cc │ │ ├── muji.py │ │ ├── muji_test.py │ │ ├── net_builder.py │ │ ├── net_builder_test.py │ │ ├── net_drawer.py │ │ ├── net_printer.py │ │ ├── net_printer_test.py │ │ ├── numa_benchmark.py │ │ ├── numa_test.py │ │ ├── observer_test.py │ │ ├── onnx/ │ │ │ ├── ONNXOpCoverage.md │ │ │ ├── README.md │ │ │ ├── __init__.py │ │ │ ├── backend.py │ │ │ ├── backend_cpp_rep.py │ │ │ ├── backend_rep.py │ │ │ ├── bin/ │ │ │ │ ├── __init__.py │ │ │ │ └── conversion.py │ │ │ ├── error.py │ │ │ ├── frontend.py │ │ │ ├── helper.py │ │ │ ├── tests/ │ │ │ │ ├── __init__.py │ │ │ │ ├── c2_ref_test.py │ │ │ │ ├── conversion_test.py │ │ │ │ ├── helper_test.py │ │ │ │ ├── onnx_backend_test.py │ │ │ │ ├── optimize_onnx_test.py │ │ │ │ ├── ssa_test.py │ │ │ │ └── test_utils.py │ │ │ └── workspace.py │ │ ├── operator_test/ │ │ │ ├── activation_ops_test.py │ │ │ ├── adagrad_test.py │ │ │ ├── adam_test.py │ │ │ ├── apmeter_test.py │ │ │ ├── assert_test.py │ │ │ ├── atomic_ops_test.py │ │ │ ├── basic_rnn_test.py │ │ │ ├── batch_box_cox_test.py │ │ │ ├── batch_sparse_to_dense_op_test.py │ │ │ ├── bbox_transform_test.py │ │ │ ├── blobs_queue_db_test.py │ │ │ ├── boolean_mask_test.py │ │ │ ├── boolean_unmask_test.py │ │ │ ├── cast_op_test.py │ │ │ ├── ceil_op_test.py │ │ │ ├── channel_backprop_stats_op_test.py │ │ │ ├── channel_shuffle_test.py │ │ │ ├── channel_stats_op_test.py │ │ │ ├── checkpoint_test.py │ │ │ ├── clip_op_test.py │ │ │ ├── clip_tensor_op_test.py │ │ │ ├── concat_split_op_test.py │ │ │ ├── conditional_test.py │ │ │ ├── conv_test.py │ │ │ ├── conv_transpose_test.py │ │ │ ├── copy_ops_test.py │ │ │ ├── cosine_embedding_criterion_op_test.py │ │ │ ├── counter_ops_test.py │ │ │ ├── crf_test.py │ │ │ ├── cross_entropy_ops_test.py │ │ │ ├── cudnn_recurrent_test.py │ │ │ ├── dataset_ops_test.py │ │ │ ├── deform_conv_test.py │ │ │ ├── distance_op_test.py │ │ │ ├── dropout_op_test.py │ │ │ ├── duplicate_operands_test.py │ │ │ ├── elementwise_linear_op_test.py │ │ │ ├── elementwise_logical_ops_test.py │ │ │ ├── elementwise_op_broadcast_test.py │ │ │ ├── elementwise_ops_test.py │ │ │ ├── emptysample_ops_test.py │ │ │ ├── extend_tensor_op_test.py │ │ │ ├── fc_operator_test.py │ │ │ ├── filler_ops_test.py │ │ │ ├── find_op_test.py │ │ │ ├── flatten_op_test.py │ │ │ ├── flexible_top_k_test.py │ │ │ ├── floor_op_test.py │ │ │ ├── gather_ops_test.py │ │ │ ├── gather_ranges_op_test.py │ │ │ ├── given_tensor_fill_op_test.py │ │ │ ├── glu_op_test.py │ │ │ ├── group_conv_test.py │ │ │ ├── gru_test.py │ │ │ ├── hsm_test.py │ │ │ ├── im2col_col2im_test.py │ │ │ ├── image_input_op_test.py │ │ │ ├── index_hash_ops_test.py │ │ │ ├── index_ops_test.py │ │ │ ├── instance_norm_test.py │ │ │ ├── jsd_ops_test.py │ │ │ ├── key_split_ops_test.py │ │ │ ├── lars_test.py │ │ │ ├── layer_norm_op_test.py │ │ │ ├── lc_operator_test.py │ │ │ ├── leaky_relu_test.py │ │ │ ├── learning_rate_op_test.py │ │ │ ├── lengths_tile_op_test.py │ │ │ ├── lengths_top_k_ops_test.py │ │ │ ├── listwise_l2r_operator_test.py │ │ │ ├── load_save_test.py │ │ │ ├── loss_ops_test.py │ │ │ ├── lpnorm_op_test.py │ │ │ ├── map_ops_test.py │ │ │ ├── margin_ranking_criterion_op_test.py │ │ │ ├── math_ops_test.py │ │ │ ├── matmul_op_test.py │ │ │ ├── mean_op_test.py │ │ │ ├── merge_id_lists_op_test.py │ │ │ ├── mkl_conv_op_test.py │ │ │ ├── mkl_packed_fc_op_test.py │ │ │ ├── mkl_speed_test.py │ │ │ ├── mod_op_test.py │ │ │ ├── momentum_sgd_test.py │ │ │ ├── mpi_test.py │ │ │ ├── negate_gradient_op_test.py │ │ │ ├── ngram_ops_test.py │ │ │ ├── normalize_op_test.py │ │ │ ├── one_hot_ops_test.py │ │ │ ├── onnx_while_test.py │ │ │ ├── pack_ops_test.py │ │ │ ├── pack_rnn_sequence_op_test.py │ │ │ ├── pad_test.py │ │ │ ├── partition_ops_test.py │ │ │ ├── percentile_op_test.py │ │ │ ├── piecewise_linear_transform_test.py │ │ │ ├── pooling_test.py │ │ │ ├── prepend_dim_test.py │ │ │ ├── python_op_test.py │ │ │ ├── rank_loss_operator_test.py │ │ │ ├── rebatching_queue_test.py │ │ │ ├── record_queue_test.py │ │ │ ├── recurrent_net_executor_test.py │ │ │ ├── recurrent_network_test.py │ │ │ ├── reduce_ops_test.py │ │ │ ├── reduction_ops_test.py │ │ │ ├── relu_op_test.py │ │ │ ├── reshape_ops_test.py │ │ │ ├── resize_op_test.py │ │ │ ├── rmac_regions_op_test.py │ │ │ ├── rnn_cell_test.py │ │ │ ├── segment_ops_test.py │ │ │ ├── selu_op_test.py │ │ │ ├── sequence_ops_test.py │ │ │ ├── shape_inference_test.py │ │ │ ├── sinusoid_position_encoding_op_test.py │ │ │ ├── softmax_ops_test.py │ │ │ ├── softplus_op_test.py │ │ │ ├── sparse_gradient_checker_test.py │ │ │ ├── sparse_lengths_sum_benchmark.py │ │ │ ├── sparse_normalize_test.py │ │ │ ├── sparse_ops_test.py │ │ │ ├── sparse_to_dense_mask_op_test.py │ │ │ ├── spatial_bn_op_test.py │ │ │ ├── specialized_segment_ops_test.py │ │ │ ├── square_root_divide_op_test.py │ │ │ ├── stats_ops_test.py │ │ │ ├── string_ops_test.py │ │ │ ├── text_file_reader_test.py │ │ │ ├── thresholded_relu_op_test.py │ │ │ ├── tile_op_test.py │ │ │ ├── top_k_test.py │ │ │ ├── unique_uniform_fill_op_test.py │ │ │ ├── utility_ops_test.py │ │ │ ├── video_input_op_test.py │ │ │ ├── weighted_sample_test.py │ │ │ └── weighted_sum_test.py │ │ ├── optimizer.py │ │ ├── optimizer_context.py │ │ ├── optimizer_test.py │ │ ├── optimizer_test_util.py │ │ ├── parallel_workers.py │ │ ├── parallel_workers_test.py │ │ ├── parallelize_bmuf_distributed_test.py │ │ ├── pipeline.py │ │ ├── pipeline_test.py │ │ ├── predictor/ │ │ │ ├── __init__.py │ │ │ ├── mobile_exporter.py │ │ │ ├── mobile_exporter_test.py │ │ │ ├── predictor_exporter.py │ │ │ ├── predictor_exporter_test.py │ │ │ ├── predictor_py_utils.py │ │ │ ├── predictor_test.py │ │ │ └── serde.py │ │ ├── predictor_constants.py │ │ ├── pybind_state.cc │ │ ├── pybind_state.h │ │ ├── pybind_state_dlpack.cc │ │ ├── pybind_state_dlpack.h │ │ ├── pybind_state_gpu.cc │ │ ├── pybind_state_mkl.cc │ │ ├── python_op_test.py │ │ ├── queue_util.py │ │ ├── record_queue.py │ │ ├── recurrent.py │ │ ├── regularizer.py │ │ ├── regularizer_context.py │ │ ├── regularizer_test.py │ │ ├── rnn/ │ │ │ ├── lstm_comparison.py │ │ │ └── rnn_cell_test_util.py │ │ ├── rnn_cell.py │ │ ├── schema.py │ │ ├── schema_test.py │ │ ├── scope.py │ │ ├── scope_test.py │ │ ├── session.py │ │ ├── session_test.py │ │ ├── sparse_to_dense_mask_test.py │ │ ├── sparse_to_dense_test.py │ │ ├── task.py │ │ ├── test/ │ │ │ ├── blob_deallocation_test.py │ │ │ ├── do_op_test.py │ │ │ ├── executor_test.py │ │ │ └── executor_test_util.py │ │ ├── test_util.py │ │ ├── text_file_reader.py │ │ ├── timeout_guard.py │ │ ├── toy_regression_test.py │ │ ├── tt_core.py │ │ ├── tt_core_test.py │ │ ├── tutorials/ │ │ │ ├── Basics.ipynb │ │ │ ├── Control_Ops.ipynb │ │ │ ├── Getting_Caffe1_Models_for_Translation.ipynb │ │ │ ├── Image_Pre-Processing_Pipeline.ipynb │ │ │ ├── Loading_Pretrained_Models.ipynb │ │ │ ├── MNIST.ipynb │ │ │ ├── MNIST_Dataset_and_Databases.ipynb │ │ │ ├── Model_Quickload.ipynb │ │ │ ├── Multi-GPU_Training.ipynb │ │ │ ├── Python_Op.ipynb │ │ │ ├── README.md │ │ │ ├── Toy_Regression.ipynb │ │ │ ├── Training_a_Model.ipynb │ │ │ ├── create_your_own_dataset.ipynb │ │ │ ├── experimental/ │ │ │ │ └── Immediate.ipynb │ │ │ ├── helpers.py │ │ │ ├── inference_codes.txt │ │ │ ├── jupyter_notebook_config.py │ │ │ ├── py_gen/ │ │ │ │ ├── Basics.py │ │ │ │ ├── Control_Ops.py │ │ │ │ ├── Getting_Caffe1_Models_for_Translation.py │ │ │ │ ├── Image_Pre-Processing_Pipeline.py │ │ │ │ ├── Loading_Pretrained_Models.py │ │ │ │ ├── MNIST.py │ │ │ │ ├── MNIST_Dataset_and_Databases.py │ │ │ │ ├── Model_Quickload.py │ │ │ │ ├── Multi-GPU_Training.py │ │ │ │ ├── Python_Op.py │ │ │ │ ├── Toy_Regression.py │ │ │ │ ├── Training_a_Model.py │ │ │ │ ├── create_your_own_dataset.py │ │ │ │ └── sparseNN.py │ │ │ ├── start_ipython_notebook.sh │ │ │ └── tutorials_to_script_converter.py │ │ ├── utils.py │ │ ├── visualize.py │ │ ├── workspace.py │ │ └── workspace_test.py │ ├── queue/ │ │ ├── CMakeLists.txt │ │ ├── blobs_queue.cc │ │ ├── blobs_queue.h │ │ ├── blobs_queue_db.cc │ │ ├── blobs_queue_db.h │ │ ├── queue_ops.cc │ │ ├── queue_ops.h │ │ ├── queue_ops_gpu.cc │ │ ├── rebatching_queue.cc │ │ ├── rebatching_queue.h │ │ ├── rebatching_queue_ops.cc │ │ └── rebatching_queue_ops.h │ ├── sgd/ │ │ ├── CMakeLists.txt │ │ ├── adagrad_op.cc │ │ ├── adagrad_op.h │ │ ├── adagrad_op_gpu.cu │ │ ├── adam_op.cc │ │ ├── adam_op.h │ │ ├── adam_op_gpu.cu │ │ ├── clip_tensor_op.cc │ │ ├── clip_tensor_op.h │ │ ├── fp16_momentum_sgd_op.cu │ │ ├── fp16_momentum_sgd_op.h │ │ ├── fp32_momentum_sgd_op.cu │ │ ├── fp32_momentum_sgd_op.h │ │ ├── ftrl_op.cc │ │ ├── ftrl_op.h │ │ ├── iter_op.cc │ │ ├── iter_op.h │ │ ├── iter_op_gpu.cc │ │ ├── lars_op.cc │ │ ├── lars_op.h │ │ ├── lars_op_gpu.cu │ │ ├── learning_rate_functors.h │ │ ├── learning_rate_op.cc │ │ ├── learning_rate_op.h │ │ ├── learning_rate_op_gpu.cc │ │ ├── momentum_sgd_op.cc │ │ ├── momentum_sgd_op.h │ │ ├── momentum_sgd_op_gpu.cu │ │ ├── rmsprop_op.cc │ │ ├── rmsprop_op.h │ │ ├── rmsprop_op_gpu.cu │ │ ├── yellowfin_op.cc │ │ ├── yellowfin_op.h │ │ └── yellowfin_op_gpu.cu │ ├── share/ │ │ ├── CMakeLists.txt │ │ └── contrib/ │ │ ├── CMakeLists.txt │ │ ├── nnpack/ │ │ │ ├── CMakeLists.txt │ │ │ ├── conv_op.cc │ │ │ └── conv_op_test.cc │ │ └── zstd/ │ │ ├── CMakeLists.txt │ │ ├── quant_decomp_zstd_op.cc │ │ └── quant_decomp_zstd_op.h │ ├── test/ │ │ ├── assets/ │ │ │ └── squeeze_predict_net.pb │ │ └── caffe2_gtest_main.cc │ ├── transforms/ │ │ ├── CMakeLists.txt │ │ ├── common_subexpression_elimination.cc │ │ ├── common_subexpression_elimination.h │ │ ├── common_subexpression_elimination_test.cc │ │ ├── conv_to_nnpack_transform.cc │ │ ├── conv_to_nnpack_transform.h │ │ ├── conv_to_nnpack_transform_test.cc │ │ ├── pattern_net_transform.cc │ │ ├── pattern_net_transform.h │ │ ├── pattern_net_transform_test.cc │ │ ├── single_op_transform.cc │ │ └── single_op_transform.h │ ├── utils/ │ │ ├── CMakeLists.txt │ │ ├── GpuBitonicSort.cuh │ │ ├── GpuDefs.cuh │ │ ├── GpuScanUtils.cuh │ │ ├── cast.h │ │ ├── cblas.h │ │ ├── conversions.h │ │ ├── cpu_neon.h │ │ ├── cpuid.cc │ │ ├── cpuid.h │ │ ├── cpuid_test.cc │ │ ├── eigen_utils.h │ │ ├── fatal_signal_asan_no_sig_test.cc │ │ ├── fixed_divisor.h │ │ ├── fixed_divisor_test.cc │ │ ├── math-detail.h │ │ ├── math.h │ │ ├── math_cpu.cc │ │ ├── math_gpu.cu │ │ ├── math_gpu_test.cc │ │ ├── math_test.cc │ │ ├── mixed_utils.h │ │ ├── murmur_hash3.cc │ │ ├── murmur_hash3.h │ │ ├── proto_utils.cc │ │ ├── proto_utils.h │ │ ├── proto_utils_test.cc │ │ ├── signal_handler.cc │ │ ├── signal_handler.h │ │ ├── simple_queue.h │ │ ├── simple_queue_test.cc │ │ ├── smart_tensor_printer.cc │ │ ├── smart_tensor_printer.h │ │ ├── smart_tensor_printer_test.cc │ │ ├── string_utils.cc │ │ ├── string_utils.h │ │ ├── thread_pool.h │ │ ├── threadpool/ │ │ │ ├── ThreadPool.cc │ │ │ ├── ThreadPool.h │ │ │ ├── ThreadPoolCommon.h │ │ │ ├── WorkersPool.h │ │ │ ├── pthreadpool.cc │ │ │ ├── pthreadpool.h │ │ │ ├── pthreadpool_impl.cc │ │ │ └── pthreadpool_impl.h │ │ └── zmq_helper.h │ └── video/ │ ├── CMakeLists.txt │ ├── optical_flow.cc │ ├── optical_flow.h │ ├── video_decoder.cc │ ├── video_decoder.h │ ├── video_input_op.cc │ ├── video_input_op.h │ ├── video_input_op_gpu.cc │ ├── video_io.cc │ └── video_io.h ├── cmake/ │ ├── BuildVariables.cmake │ ├── Caffe2Config.cmake.in │ ├── Caffe2ConfigVersion.cmake.in │ ├── Dependencies.cmake │ ├── External/ │ │ ├── nccl.cmake │ │ └── nnpack.cmake │ ├── MiscCheck.cmake │ ├── Modules/ │ │ ├── FindAtlas.cmake │ │ ├── FindBenchmark.cmake │ │ ├── FindCUB.cmake │ │ ├── FindFFmpeg.cmake │ │ ├── FindGloo.cmake │ │ ├── FindHiredis.cmake │ │ ├── FindLAPACK.cmake │ │ ├── FindLMDB.cmake │ │ ├── FindLevelDB.cmake │ │ ├── FindMKL.cmake │ │ ├── FindMatlabMex.cmake │ │ ├── FindNCCL.cmake │ │ ├── FindNNPACK.cmake │ │ ├── FindNumPy.cmake │ │ ├── FindNuma.cmake │ │ ├── FindOpenBLAS.cmake │ │ ├── FindRocksDB.cmake │ │ ├── FindSnappy.cmake │ │ ├── FindZMQ.cmake │ │ ├── Findpybind11.cmake │ │ └── FindvecLib.cmake │ ├── Modules_CUDA_fix/ │ │ ├── FindCUDA/ │ │ │ ├── make2cmake.cmake │ │ │ ├── parse_cubin.cmake │ │ │ ├── run_nvcc.cmake │ │ │ └── select_compute_arch.cmake │ │ ├── FindCUDA.cmake │ │ ├── FindPackageHandleStandardArgs.cmake │ │ ├── FindPackageMessage.cmake │ │ └── README.txt │ ├── ProtoBuf.cmake │ ├── Summary.cmake │ ├── Utils.cmake │ ├── Whitelist.cmake │ ├── cmake_uninstall.cmake.in │ └── public/ │ ├── cuda.cmake │ ├── gflags.cmake │ ├── glog.cmake │ ├── protobuf.cmake │ ├── threads.cmake │ └── utils.cmake ├── conda/ │ ├── cuda/ │ │ ├── build.sh │ │ ├── conda_build_config.yaml │ │ └── meta.yaml │ ├── cuda_full/ │ │ ├── build.sh │ │ ├── conda_build_config.yaml │ │ └── meta.yaml │ └── no_cuda/ │ ├── build.sh │ ├── conda_build_config.yaml │ └── meta.yaml ├── docker/ │ ├── jenkins/ │ │ ├── README.md │ │ ├── build.sh │ │ ├── centos/ │ │ │ ├── .gitignore │ │ │ └── Dockerfile │ │ ├── centos-cuda/ │ │ │ ├── .gitignore │ │ │ └── Dockerfile │ │ ├── common/ │ │ │ ├── add_jenkins_user.sh │ │ │ ├── install_anaconda.sh │ │ │ ├── install_android.sh │ │ │ ├── install_base.sh │ │ │ ├── install_ccache.sh │ │ │ ├── install_clang.sh │ │ │ ├── install_cmake.sh │ │ │ ├── install_cuda.sh │ │ │ ├── install_gcc.sh │ │ │ ├── install_mkl.sh │ │ │ ├── install_nccl.sh │ │ │ └── install_python.sh │ │ ├── ubuntu/ │ │ │ ├── .gitignore │ │ │ └── Dockerfile │ │ └── ubuntu-cuda/ │ │ ├── .gitignore │ │ └── Dockerfile │ ├── readme.md │ ├── ubuntu-14.04-cpu-all-options/ │ │ └── Dockerfile │ ├── ubuntu-14.04-cpu-minimal/ │ │ └── Dockerfile │ ├── ubuntu-16.04-cpu-all-options/ │ │ └── Dockerfile │ ├── ubuntu-16.04-cpu-minimal/ │ │ └── Dockerfile │ ├── ubuntu-16.04-cuda8-cudnn6-all-options/ │ │ └── Dockerfile │ ├── ubuntu-16.04-cuda8-cudnn7-all-options/ │ │ └── Dockerfile │ └── ubuntu-16.04-gpu-tutorial/ │ └── Dockerfile ├── docs/ │ ├── .Doxyfile-c │ ├── .Doxyfile-python │ ├── DOXYGEN.md │ ├── DoxygenLayout-c.xml │ ├── DoxygenLayout-python.xml │ ├── README.md │ ├── footer.html │ ├── header.html │ ├── installation.md │ ├── main.css │ ├── process.py │ └── stylesheet.css ├── modules/ │ ├── CMakeLists.txt │ ├── detectron/ │ │ ├── CMakeLists.txt │ │ ├── affine_channel_op.cc │ │ ├── affine_channel_op.cu │ │ ├── affine_channel_op.h │ │ ├── batch_permutation_op.cc │ │ ├── batch_permutation_op.cu │ │ ├── batch_permutation_op.h │ │ ├── group_spatial_softmax_op.cc │ │ ├── group_spatial_softmax_op.cu │ │ ├── group_spatial_softmax_op.h │ │ ├── ps_roi_pool_op.cc │ │ ├── ps_roi_pool_op.cu │ │ ├── ps_roi_pool_op.h │ │ ├── roi_pool_f_op.cc │ │ ├── roi_pool_f_op.cu │ │ ├── roi_pool_f_op.h │ │ ├── sample_as_op.cc │ │ ├── sample_as_op.cu │ │ ├── sample_as_op.h │ │ ├── select_smooth_l1_loss_op.cc │ │ ├── select_smooth_l1_loss_op.cu │ │ ├── select_smooth_l1_loss_op.h │ │ ├── sigmoid_cross_entropy_loss_op.cc │ │ ├── sigmoid_cross_entropy_loss_op.cu │ │ ├── sigmoid_cross_entropy_loss_op.h │ │ ├── sigmoid_focal_loss_op.cc │ │ ├── sigmoid_focal_loss_op.cu │ │ ├── sigmoid_focal_loss_op.h │ │ ├── smooth_l1_loss_op.cc │ │ ├── smooth_l1_loss_op.cu │ │ ├── smooth_l1_loss_op.h │ │ ├── softmax_focal_loss_op.cc │ │ ├── softmax_focal_loss_op.cu │ │ ├── softmax_focal_loss_op.h │ │ ├── spatial_narrow_as_op.cc │ │ ├── spatial_narrow_as_op.cu │ │ ├── spatial_narrow_as_op.h │ │ ├── upsample_nearest_op.cc │ │ ├── upsample_nearest_op.cu │ │ └── upsample_nearest_op.h │ ├── module_test/ │ │ ├── CMakeLists.txt │ │ └── module_test_dynamic.cc │ ├── observers/ │ │ ├── CMakeLists.txt │ │ ├── net_observer_reporter.h │ │ ├── net_observer_reporter_print.cc │ │ ├── net_observer_reporter_print.h │ │ ├── observer_config.cc │ │ ├── observer_config.h │ │ ├── perf_observer.cc │ │ └── perf_observer.h │ └── rocksdb/ │ ├── CMakeLists.txt │ └── rocksdb.cc ├── release-notes.md ├── scripts/ │ ├── add_apache_header.sh │ ├── apache_header.txt │ ├── appveyor/ │ │ ├── install.bat │ │ └── install_cuda.bat │ ├── diagnose_protobuf.py │ ├── get_python_cmake_flags.py │ ├── read_conda_versions.sh │ ├── start_ipython_notebook.sh │ └── temp.sh └── setup.py
Showing preview only (924K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (9818 symbols across 1431 files)
FILE: binaries/caffe2_benchmark.cc
function writeTextOutput (line 77) | static void writeTextOutput(
function main (line 114) | int main(int argc, char** argv) {
FILE: binaries/convert_caffe_image_db.cc
function main (line 35) | int main(int argc, char** argv) {
FILE: binaries/convert_db.cc
function main (line 32) | int main(int argc, char** argv) {
FILE: binaries/convert_encoded_to_raw_leveldb.cc
type caffe2 (line 47) | namespace caffe2 {
function ConvertToRawDataset (line 52) | void ConvertToRawDataset(
function main (line 151) | int main(int argc, char** argv) {
FILE: binaries/core_overhead_benchmark.cc
function BM_CUDAContextCreation (line 31) | static void BM_CUDAContextCreation(benchmark::State& state) {
function BM_CUDAContextStreamAccess (line 40) | static void BM_CUDAContextStreamAccess(benchmark::State& state) {
function BM_cudaGetDevice (line 49) | static void BM_cudaGetDevice(benchmark::State& state) {
function BM_cudaSetDevice (line 58) | static void BM_cudaSetDevice(benchmark::State& state) {
function BM_cudaSetAndGetDevice (line 68) | static void BM_cudaSetAndGetDevice(benchmark::State& state) {
function BM_cudaSetSameDevice (line 80) | static void BM_cudaSetSameDevice(benchmark::State& state) {
function BM_cudaStreamCreateSyncDelete (line 88) | static void BM_cudaStreamCreateSyncDelete(benchmark::State& state) {
function BM_cudaStreamSynchronize (line 99) | static void BM_cudaStreamSynchronize(benchmark::State& state) {
function BM_cudaEventRecord (line 109) | static void BM_cudaEventRecord(benchmark::State& state) {
function BM_cudaStreamWaitEventThenStreamSynchronize (line 122) | static void BM_cudaStreamWaitEventThenStreamSynchronize(
function BM_CudaPointerAffinity (line 140) | static void BM_CudaPointerAffinity(benchmark::State& state) {
class DummyEmptyOp (line 152) | class DummyEmptyOp : public Operator<Context> {
method DummyEmptyOp (line 154) | DummyEmptyOp(const OperatorDef& def, Workspace* ws)
method RunOnDevice (line 157) | bool RunOnDevice() final { return true; }
function BM_OperatorCreationCPU (line 165) | static void BM_OperatorCreationCPU(benchmark::State& state) {
function BM_OperatorCreationCUDA (line 177) | static void BM_OperatorCreationCUDA(benchmark::State& state) {
function BM_RawAllocDeallocCPU (line 190) | static void BM_RawAllocDeallocCPU(benchmark::State& state) {
function BM_TensorAllocDeallocCPU (line 200) | static void BM_TensorAllocDeallocCPU(benchmark::State& state) {
function BM_TensorAllocDeallocCUDA (line 211) | static void BM_TensorAllocDeallocCUDA(benchmark::State& state) {
FILE: binaries/db_throughput.cc
function TestThroughputWithDB (line 39) | void TestThroughputWithDB() {
function TestThroughputWithReaderWorker (line 61) | void TestThroughputWithReaderWorker(const DBReader* reader, int thread_i...
function TestThroughputWithReader (line 76) | void TestThroughputWithReader() {
function main (line 90) | int main(int argc, char** argv) {
FILE: binaries/inspect_gpus.cc
function main (line 30) | int main(int argc, char** argv) {
FILE: binaries/make_cifar_db.cc
type caffe2 (line 45) | namespace caffe2 {
function ReadImage (line 58) | void ReadImage(std::ifstream* file, int* label, char* buffer) {
function WriteToDB (line 79) | void WriteToDB(const string& filename, const int num_items,
function ConvertCIFAR (line 111) | void ConvertCIFAR() {
function main (line 144) | int main(int argc, char** argv) {
FILE: binaries/make_image_db.cc
type caffe2 (line 67) | namespace caffe2 {
class Converter (line 69) | class Converter {
method Converter (line 71) | explicit Converter() {
method queue (line 97) | void queue(const std::pair<std::string, int>& pair) {
method start (line 101) | void start() {
method get (line 105) | std::string get() {
method run (line 117) | void run() {
function ConvertImageDataset (line 201) | void ConvertImageDataset(
function main (line 274) | int main(int argc, char** argv) {
FILE: binaries/make_mnist_db.cc
type caffe2 (line 40) | namespace caffe2 {
function swap_endian (line 41) | uint32_t swap_endian(uint32_t val) {
function convert_dataset (line 46) | void convert_dataset(const char* image_filename, const char* label_fil...
function main (line 134) | int main(int argc, char** argv) {
FILE: binaries/predictor_verifier.cc
type caffe2 (line 28) | namespace caffe2 {
function run (line 30) | void run() {
function main (line 51) | int main(int argc, char** argv) {
FILE: binaries/print_core_object_sizes.cc
function main (line 29) | int main(int /* unused */, char** /* unused */) {
FILE: binaries/print_registered_core_operators.cc
function HasSchema (line 27) | static bool HasSchema(const std::string& str) {
function HasDoc (line 31) | static bool HasDoc(const std::string& str) {
function main (line 36) | int main(int argc, char** argv) {
FILE: binaries/run_plan.cc
function main (line 25) | int main(int argc, char** argv) {
FILE: binaries/run_plan_mpi.cc
function main (line 27) | int main(int argc, char** argv) {
FILE: binaries/speed_benchmark.cc
function main (line 79) | int main(int argc, char** argv) {
FILE: binaries/split_db.cc
type caffe2 (line 30) | namespace caffe2 {
function Split (line 32) | static int Split(int argc, char** argv) {
function main (line 75) | int main(int argc, char** argv) {
FILE: binaries/tutorial_blob.cc
function main (line 26) | int main(int argc, char** argv) {
FILE: binaries/zmq_feeder.cc
function main (line 34) | int main(int argc, char** argv) {
FILE: caffe2/contrib/aten/aten_op.cc
type caffe2 (line 20) | namespace caffe2 {
type math (line 31) | namespace math {
FILE: caffe2/contrib/aten/aten_op_cuda.cc
type caffe2 (line 20) | namespace caffe2 {
type math (line 28) | namespace math {
FILE: caffe2/contrib/aten/aten_op_template.h
function namespace (line 33) | namespace caffe2 {
FILE: caffe2/contrib/aten/aten_test.py
class TestATen (line 32) | class TestATen(hu.HypothesisTestCase):
method test_add (line 35) | def test_add(self, inputs, gc, dc):
method test_pow (line 47) | def test_pow(self, inputs, gc, dc):
method test_sort (line 60) | def test_sort(self, x, gc, dc):
method test_sum (line 73) | def test_sum(self, inputs, gc, dc):
method test_ones (line 86) | def test_ones(self, gc, dc):
FILE: caffe2/contrib/aten/docs/sample.py
class MyFunction (line 10) | class MyFunction(Function):
method forward (line 12) | def forward(ctx, x, y):
method symbolic (line 15) | def symbolic(graph, x, y):
class MyModule (line 23) | class MyModule(nn.Module):
method forward (line 24) | def forward(self, x, y):
FILE: caffe2/contrib/aten/gen_op.py
function write (line 51) | def write(filename, s):
function read (line 56) | def read(filename):
function value_has_tensors (line 61) | def value_has_tensors(v):
function value_is_tensor_type (line 66) | def value_is_tensor_type(v):
function expand (line 94) | def expand(o):
function supports (line 107) | def supports(o):
function get_output (line 153) | def get_output(o, i):
function attribute_names (line 160) | def attribute_names(o):
function required_attribute_names (line 164) | def required_attribute_names(o):
function self_as_first_argument (line 168) | def self_as_first_argument(arguments):
function get_num_inputs (line 173) | def get_num_inputs(o):
FILE: caffe2/contrib/cuda-convnet2/convdata.py
class JPEGBatchLoaderThread (line 29) | class JPEGBatchLoaderThread(Thread):
method __init__ (line 30) | def __init__(self, dp, batch_num, label_offset, list_out):
method load_jpeg_batch (line 38) | def load_jpeg_batch(rawdics, dp, label_offset):
method run (line 59) | def run(self):
class ColorNoiseMakerThread (line 66) | class ColorNoiseMakerThread(Thread):
method __init__ (line 67) | def __init__(self, pca_stdevs, pca_vecs, num_noise, list_out):
method run (line 73) | def run(self):
class ImageDataProvider (line 77) | class ImageDataProvider(LabeledDataProvider):
method __init__ (line 78) | def __init__(self, data_dir, batch_range=None, init_epoch=1, init_batc...
method showimg (line 109) | def showimg(self, img):
method get_data_dims (line 117) | def get_data_dims(self, idx=0):
method start_loader (line 124) | def start_loader(self, batch_idx):
method start_color_noise_maker (line 132) | def start_color_noise_maker(self):
method set_labels (line 138) | def set_labels(self, datadic):
method get_data_from_loader (line 141) | def get_data_from_loader(self):
method add_color_noise (line 158) | def add_color_noise(self):
method get_next_batch (line 185) | def get_next_batch(self):
method get_plottable_data (line 205) | def get_plottable_data(self, data, add_mean=True):
class CIFARDataProvider (line 209) | class CIFARDataProvider(LabeledDataProvider):
method __init__ (line 210) | def __init__(self, data_dir, batch_range=None, init_epoch=1, init_batc...
method get_next_batch (line 232) | def get_next_batch(self):
method get_data_dims (line 244) | def get_data_dims(self, idx=0):
method get_plottable_data (line 251) | def get_plottable_data(self, data):
method __trim_borders (line 254) | def __trim_borders(self, x, target):
class DummyConvNetLogRegDataProvider (line 277) | class DummyConvNetLogRegDataProvider(LabeledDummyDataProvider):
method __init__ (line 278) | def __init__(self, data_dim):
method get_next_batch (line 283) | def get_next_batch(self):
method get_data_dims (line 290) | def get_data_dims(self, idx=0):
FILE: caffe2/contrib/cuda-convnet2/convnet.py
class Driver (line 30) | class Driver(object):
method __init__ (line 31) | def __init__(self, convnet):
method on_start_batch (line 34) | def on_start_batch(self, batch_data, train):
method on_finish_batch (line 37) | def on_finish_batch(self):
class GradCheckDriver (line 40) | class GradCheckDriver(Driver):
method on_start_batch (line 41) | def on_start_batch(self, batch_data, train):
class TrainingDriver (line 45) | class TrainingDriver(Driver):
method on_start_batch (line 46) | def on_start_batch(self, batch_data, train):
class MultiviewTestDriver (line 50) | class MultiviewTestDriver(TrainingDriver):
method on_start_batch (line 51) | def on_start_batch(self, batch_data, train):
method on_finish_batch (line 66) | def on_finish_batch(self):
class FeatureWriterDriver (line 73) | class FeatureWriterDriver(Driver):
method __init__ (line 74) | def __init__(self, convnet):
method on_start_batch (line 78) | def on_start_batch(self, batch_data, train):
method on_finish_batch (line 91) | def on_finish_batch(self):
class ConvNet (line 100) | class ConvNet(IGPUModel):
method __init__ (line 101) | def __init__(self, op, load_dic, dp_params={}):
method import_model (line 108) | def import_model(self):
method init_model_lib (line 114) | def init_model_lib(self):
method init_model_state (line 120) | def init_model_state(self):
method do_decouple_conv (line 134) | def do_decouple_conv(self):
method do_unshare_weights (line 141) | def do_unshare_weights(self):
method set_driver (line 156) | def set_driver(self):
method fill_excused_options (line 166) | def fill_excused_options(self):
method parse_batch_data (line 174) | def parse_batch_data(self, batch_data, train=True):
method start_batch (line 179) | def start_batch(self, batch_data, train=True):
method finish_batch (line 182) | def finish_batch(self):
method print_iteration (line 187) | def print_iteration(self):
method print_train_time (line 190) | def print_train_time(self, compute_time_py):
method print_costs (line 193) | def print_costs(self, cost_outputs):
method print_train_results (line 215) | def print_train_results(self):
method print_test_status (line 218) | def print_test_status(self):
method print_test_results (line 221) | def print_test_results(self):
method conditional_save (line 237) | def conditional_save(self):
method aggregate_test_outputs (line 240) | def aggregate_test_outputs(self, test_outputs):
method get_options_parser (line 251) | def get_options_parser(cls):
FILE: caffe2/contrib/cuda-convnet2/cudaconvnet/include/jpeg.h
function class (line 38) | class DecoderThread : public Thread {
FILE: caffe2/contrib/cuda-convnet2/cudaconvnet/src/jpeg.cpp
type jpeg_decompress_struct (line 70) | struct jpeg_decompress_struct
type jpeg_error_mgr (line 71) | struct jpeg_error_mgr
FILE: caffe2/contrib/cuda-convnet2/initw.py
function get_src (line 19) | def get_src(filename):
function makew (line 24) | def makew(name, idx, shape, params):
function makeb (line 29) | def makeb(name, shape, params):
function concat (line 33) | def concat(shape, src, src_layers, src_func):
function makewcat (line 43) | def makewcat(name, idx, shape, params):
function makebcat (line 48) | def makebcat(name, shape, params):
function makeb_vec (line 53) | def makeb_vec(name, shape, params):
FILE: caffe2/contrib/cuda-convnet2/layer.py
class LayerParsingError (line 27) | class LayerParsingError(Exception):
class NeuronParser (line 31) | class NeuronParser:
method __init__ (line 32) | def __init__(self, type, func_str, uses_acts=True, uses_inputs=True):
method parse (line 38) | def parse(self, type):
class ParamNeuronParser (line 47) | class ParamNeuronParser(NeuronParser):
method __init__ (line 49) | def __init__(self, type, func_str, uses_acts=True, uses_inputs=True):
method parse (line 56) | def parse(self, type):
class AbsTanhNeuronParser (line 70) | class AbsTanhNeuronParser(ParamNeuronParser):
method __init__ (line 71) | def __init__(self):
method parse (line 74) | def parse(self, type):
class ParamParser (line 82) | class ParamParser:
method __init__ (line 86) | def __init__(self, type):
method parse (line 96) | def parse(self, type):
class MyConfigParser (line 109) | class MyConfigParser(cfg.SafeConfigParser):
method safe_get (line 110) | def safe_get(self, section, option, f=cfg.SafeConfigParser.get, typest...
method safe_get_list (line 122) | def safe_get_list(self, section, option, f=str, typestr='strings', def...
method safe_get_int (line 131) | def safe_get_int(self, section, option, default=None):
method safe_get_float (line 134) | def safe_get_float(self, section, option, default=None):
method safe_get_bool (line 137) | def safe_get_bool(self, section, option, default=None):
method safe_get_float_list (line 140) | def safe_get_float_list(self, section, option, default=None):
method safe_get_int_list (line 143) | def safe_get_int_list(self, section, option, default=None):
method safe_get_bool_list (line 146) | def safe_get_bool_list(self, section, option, default=None):
class FakeConfigParser (line 150) | class FakeConfigParser(object):
method __init__ (line 151) | def __init__(self, dic):
method safe_get (line 154) | def safe_get(self, section, option, default=None):
method safe_get_int (line 159) | def safe_get_int(self, section, option, default=None):
method safe_get_int_list (line 162) | def safe_get_int_list(self, section, option, default=None):
class LayerParser (line 165) | class LayerParser:
method __init__ (line 166) | def __init__(self):
method optimize (line 171) | def optimize(self, layers):
method parse_params (line 178) | def parse_params(self, vals, parsers, param_name, human_name, num_para...
method add_params (line 200) | def add_params(self, mcp):
method init (line 204) | def init(self, dic):
method set_defaults (line 208) | def set_defaults(self):
method parse (line 247) | def parse(self, name, mcp, prev_layers, model=None):
method verify_float_range (line 255) | def verify_float_range(self, v, param_name, _min, _max):
method verify_num_range (line 258) | def verify_num_range(self, v, param_name, _min, _max, strconv=lambda x...
method _verify_num_range (line 265) | def _verify_num_range(self, v, param_name, _min, _max, input=-1, strco...
method verify_divisible (line 274) | def verify_divisible(self, value, div, value_name, div_name=None, inpu...
method verify_str_in (line 279) | def verify_str_in(self, value, param_name, lst, input_idx=-1):
method verify_int_in (line 284) | def verify_int_in(self, value, param_name, lst):
method verify_all_ints_in (line 288) | def verify_all_ints_in(self, values, param_name, lst):
method verify_input_dims (line 292) | def verify_input_dims(self, dims):
method detach_neuron_layers (line 300) | def detach_neuron_layers(layers):
method parse_layers (line 306) | def parse_layers(layer_cfg_path, param_cfg_path, model, layers={}):
method register_layer_parser (line 348) | def register_layer_parser(ltype, cls):
class LayerWithInputParser (line 354) | class LayerWithInputParser(LayerParser):
method __init__ (line 355) | def __init__(self, num_inputs=-1):
method verify_num_params (line 359) | def verify_num_params(self, params, auto_expand=True):
method optimize (line 368) | def optimize(self, layers):
method parse (line 395) | def parse(self, name, mcp, prev_layers, model=None):
method verify_img_size (line 440) | def verify_img_size(self):
method grad_consumers_below (line 446) | def grad_consumers_below(dic):
method verify_no_grads (line 452) | def verify_no_grads(self):
class NailbedLayerParser (line 456) | class NailbedLayerParser(LayerWithInputParser):
method __init__ (line 457) | def __init__(self):
method parse (line 460) | def parse(self, name, mcp, prev_layers, model=None):
class GaussianBlurLayerParser (line 485) | class GaussianBlurLayerParser(LayerWithInputParser):
method __init__ (line 486) | def __init__(self):
method parse (line 489) | def parse(self, name, mcp, prev_layers, model=None):
class HorizontalReflectionLayerParser (line 518) | class HorizontalReflectionLayerParser(LayerWithInputParser):
method __init__ (line 519) | def __init__(self):
method parse (line 522) | def parse(self, name, mcp, prev_layers, model=None):
class ResizeLayerParser (line 538) | class ResizeLayerParser(LayerWithInputParser):
method __init__ (line 539) | def __init__(self):
method parse (line 542) | def parse(self, name, mcp, prev_layers, model=None):
class RandomScaleLayerParser (line 568) | class RandomScaleLayerParser(LayerWithInputParser):
method __init__ (line 569) | def __init__(self):
method parse (line 572) | def parse(self, name, mcp, prev_layers, model=None):
class CropLayerParser (line 606) | class CropLayerParser(LayerWithInputParser):
method __init__ (line 607) | def __init__(self):
method parse (line 610) | def parse(self, name, mcp, prev_layers, model=None):
class ColorTransformLayerParser (line 641) | class ColorTransformLayerParser(LayerWithInputParser):
method __init__ (line 642) | def __init__(self):
method parse (line 645) | def parse(self, name, mcp, prev_layers, model=None):
class RGBToYUVLayerParser (line 662) | class RGBToYUVLayerParser(ColorTransformLayerParser):
method __init__ (line 663) | def __init__(self):
method parse (line 666) | def parse(self, name, mcp, prev_layers, model=None):
class RGBToLABLayerParser (line 671) | class RGBToLABLayerParser(ColorTransformLayerParser):
method __init__ (line 672) | def __init__(self):
method parse (line 675) | def parse(self, name, mcp, prev_layers, model=None):
class NeuronLayerParser (line 681) | class NeuronLayerParser(LayerWithInputParser):
method __init__ (line 682) | def __init__(self):
method get_unused_layer_name (line 686) | def get_unused_layer_name(layers, wish):
method parse_neuron (line 695) | def parse_neuron(self, neuron_str):
method detach_neuron_layer (line 714) | def detach_neuron_layer(self, src_name, layers):
method parse (line 734) | def parse(self, name, mcp, prev_layers, model=None):
class EltwiseSumLayerParser (line 742) | class EltwiseSumLayerParser(LayerWithInputParser):
method __init__ (line 743) | def __init__(self):
method add_params (line 746) | def add_params(self, mcp):
method parse (line 751) | def parse(self, name, mcp, prev_layers, model):
class EltwiseMaxLayerParser (line 765) | class EltwiseMaxLayerParser(LayerWithInputParser):
method __init__ (line 766) | def __init__(self):
method parse (line 769) | def parse(self, name, mcp, prev_layers, model):
class SumLayerParser (line 780) | class SumLayerParser(LayerWithInputParser):
method __init__ (line 781) | def __init__(self):
method parse (line 784) | def parse(self, name, mcp, prev_layers, model):
class DropoutLayerParser (line 794) | class DropoutLayerParser(LayerWithInputParser):
method __init__ (line 795) | def __init__(self):
method add_params (line 798) | def add_params(self, mcp):
method parse (line 804) | def parse(self, name, mcp, prev_layers, model):
class Dropout2LayerParser (line 815) | class Dropout2LayerParser(DropoutLayerParser):
method __init__ (line 816) | def __init__(self):
class WeightLayerParser (line 819) | class WeightLayerParser(LayerWithInputParser):
method __init__ (line 822) | def __init__(self, num_inputs=-1):
method get_layer_name (line 826) | def get_layer_name(name_str):
method add_params (line 832) | def add_params(self, mcp):
method unshare_weights (line 864) | def unshare_weights(layer, layers, matrix_idx=None):
method call_init_func (line 880) | def call_init_func(self, param_name, shapes, input_idx=-1):
method make_weights (line 894) | def make_weights(self, initW, rows, cols, order='C'):
method make_biases (line 927) | def make_biases(self, rows, cols, order='C'):
method parse (line 944) | def parse(self, name, mcp, prev_layers, model):
class FCLayerParser (line 991) | class FCLayerParser(WeightLayerParser):
method __init__ (line 992) | def __init__(self):
method parse (line 995) | def parse(self, name, mcp, prev_layers, model):
class SplitFCLayerParser (line 1007) | class SplitFCLayerParser(WeightLayerParser):
method __init__ (line 1008) | def __init__(self):
method parse (line 1011) | def parse(self, name, mcp, prev_layers, model):
class LocalLayerParser (line 1027) | class LocalLayerParser(WeightLayerParser):
method __init__ (line 1028) | def __init__(self):
method conv_to_local (line 1033) | def conv_to_local(layers, lname):
method parse (line 1062) | def parse(self, name, mcp, prev_layers, model):
class ConvLayerParser (line 1134) | class ConvLayerParser(LocalLayerParser):
method __init__ (line 1135) | def __init__(self):
method add_params (line 1138) | def add_params(self, mcp):
method parse (line 1147) | def parse(self, name, mcp, prev_layers, model):
class LocalUnsharedLayerParser (line 1162) | class LocalUnsharedLayerParser(LocalLayerParser):
method __init__ (line 1163) | def __init__(self):
method parse (line 1166) | def parse(self, name, mcp, prev_layers, model):
class DataLayerParser (line 1176) | class DataLayerParser(LayerParser):
method __init__ (line 1177) | def __init__(self):
method parse (line 1180) | def parse(self, name, mcp, prev_layers, model):
class SoftmaxLayerParser (line 1190) | class SoftmaxLayerParser(LayerWithInputParser):
method __init__ (line 1191) | def __init__(self):
method parse (line 1194) | def parse(self, name, mcp, prev_layers, model):
class ConcatentionLayerParser (line 1200) | class ConcatentionLayerParser(LayerWithInputParser):
method __init__ (line 1201) | def __init__(self):
method parse (line 1204) | def parse(self, name, mcp, prev_layers, model):
class PassThroughLayerParser (line 1211) | class PassThroughLayerParser(LayerWithInputParser):
method __init__ (line 1212) | def __init__(self):
method parse (line 1218) | def parse(self, name, mcp, prev_layers, model):
class PoolLayerParser (line 1233) | class PoolLayerParser(LayerWithInputParser):
method __init__ (line 1234) | def __init__(self):
method add_params (line 1237) | def add_params(self, mcp):
method parse (line 1241) | def parse(self, name, mcp, prev_layers, model):
class CrossMapPoolLayerParser (line 1279) | class CrossMapPoolLayerParser(LayerWithInputParser):
method __init__ (line 1280) | def __init__(self):
method parse (line 1283) | def parse(self, name, mcp, prev_layers, model):
class NormLayerParser (line 1318) | class NormLayerParser(LayerWithInputParser):
method __init__ (line 1323) | def __init__(self, norm_type):
method add_params (line 1327) | def add_params(self, mcp):
method parse (line 1335) | def parse(self, name, mcp, prev_layers, model):
class CostParser (line 1365) | class CostParser(LayerWithInputParser):
method __init__ (line 1366) | def __init__(self, num_inputs=-1):
method parse (line 1369) | def parse(self, name, mcp, prev_layers, model):
method add_params (line 1386) | def add_params(self, mcp):
class CrossEntCostParser (line 1392) | class CrossEntCostParser(CostParser):
method __init__ (line 1393) | def __init__(self):
method parse (line 1396) | def parse(self, name, mcp, prev_layers, model):
class LogregCostParser (line 1409) | class LogregCostParser(CostParser):
method __init__ (line 1410) | def __init__(self):
method add_params (line 1413) | def add_params(self, mcp):
method parse (line 1420) | def parse(self, name, mcp, prev_layers, model):
class BinomialCrossEntCostParser (line 1434) | class BinomialCrossEntCostParser(CostParser):
method __init__ (line 1435) | def __init__(self):
method add_params (line 1438) | def add_params(self, mcp):
method parse (line 1442) | def parse(self, name, mcp, prev_layers, model):
class DetectionCrossEntCostParser (line 1458) | class DetectionCrossEntCostParser(BinomialCrossEntCostParser):
method __init__ (line 1459) | def __init__(self):
method parse (line 1462) | def parse(self, name, mcp, prev_layers, model):
class SumOfSquaresCostParser (line 1472) | class SumOfSquaresCostParser(CostParser):
method __init__ (line 1473) | def __init__(self):
method parse (line 1476) | def parse(self, name, mcp, prev_layers, model):
FILE: caffe2/contrib/cuda-convnet2/make-data/make-data.py
function pickle (line 50) | def pickle(filename, data):
function unpickle (line 54) | def unpickle(filename):
function partition_list (line 60) | def partition_list(l, partition_size):
function open_tar (line 64) | def open_tar(path, name):
function makedir (line 70) | def makedir(path):
function parse_devkit_meta (line 74) | def parse_devkit_meta(ILSVRC_DEVKIT_TAR):
function write_batches (line 87) | def write_batches(target_dir, name, start_batch_num, labels, jpeg_files):
FILE: caffe2/contrib/cuda-convnet2/make-data/pyext/include/pyext.h
function class (line 37) | class DecoderThread : public Thread {
FILE: caffe2/contrib/cuda-convnet2/make-data/pyext/src/pyext.cpp
function init_MakeDataPyExt (line 25) | void init_MakeDataPyExt() {
function PyObject (line 29) | PyObject* resizeJPEG(PyObject *self, PyObject *args) {
function PyObject (line 83) | PyObject* DecoderThread::getTargetList() {
FILE: caffe2/contrib/cuda-convnet2/python_util/data.py
class DataLoaderThread (line 23) | class DataLoaderThread(Thread):
method __init__ (line 24) | def __init__(self, path, tgt):
method run (line 28) | def run(self):
class DataProvider (line 31) | class DataProvider:
method __init__ (line 33) | def __init__(self, data_dir, batch_range=None, init_epoch=1, init_batc...
method get_next_batch (line 49) | def get_next_batch(self):
method get_batch (line 57) | def get_batch(self, batch_num):
method get_data_dims (line 73) | def get_data_dims(self,idx=0):
method advance_batch (line 76) | def advance_batch(self):
method get_next_batch_idx (line 82) | def get_next_batch_idx(self):
method get_next_batch_num (line 85) | def get_next_batch_num(self):
method get_data_file_name (line 89) | def get_data_file_name(self, batchnum=None):
method get_instance (line 95) | def get_instance(cls, data_dir, batch_range=None, init_epoch=1, init_b...
method register_data_provider (line 113) | def register_data_provider(cls, name, desc, _class):
method get_batch_meta (line 120) | def get_batch_meta(data_dir):
method get_batch_filenames (line 124) | def get_batch_filenames(srcdir):
method get_batch_nums (line 128) | def get_batch_nums(srcdir):
method get_num_batches (line 133) | def get_num_batches(srcdir):
class DummyDataProvider (line 136) | class DummyDataProvider(DataProvider):
method __init__ (line 137) | def __init__(self, data_dim):
method get_next_batch (line 145) | def get_next_batch(self):
class LabeledDataProvider (line 151) | class LabeledDataProvider(DataProvider):
method __init__ (line 152) | def __init__(self, data_dir, batch_range=None, init_epoch=1, init_batc...
method get_num_classes (line 155) | def get_num_classes(self):
class LabeledDummyDataProvider (line 158) | class LabeledDummyDataProvider(DummyDataProvider):
method __init__ (line 159) | def __init__(self, data_dim, num_classes=10, num_cases=7):
method get_num_classes (line 172) | def get_num_classes(self):
method get_next_batch (line 175) | def get_next_batch(self):
class DataProviderException (line 193) | class DataProviderException(Exception):
FILE: caffe2/contrib/cuda-convnet2/python_util/gpumodel.py
class ModelStateException (line 30) | class ModelStateException(Exception):
class CheckpointWriter (line 33) | class CheckpointWriter(Thread):
method __init__ (line 34) | def __init__(self, path, dic):
method run (line 39) | def run(self):
class IGPUModel (line 53) | class IGPUModel:
method __init__ (line 54) | def __init__(self, model_name, op, load_dic, filename_options=[], dp_p...
method import_model (line 102) | def import_model(self):
method fill_excused_options (line 107) | def fill_excused_options(self):
method init_data_providers (line 110) | def init_data_providers(self):
method init_model_state (line 123) | def init_model_state(self):
method init_model_lib (line 126) | def init_model_lib(self):
method start (line 129) | def start(self):
method train (line 140) | def train(self):
method cleanup (line 176) | def cleanup(self):
method print_model_state (line 181) | def print_model_state(self):
method get_num_batches_done (line 184) | def get_num_batches_done(self):
method get_next_batch (line 187) | def get_next_batch(self, train=True):
method parse_batch_data (line 193) | def parse_batch_data(self, batch_data, train=True):
method start_batch (line 196) | def start_batch(self, batch_data, train=True):
method finish_batch (line 199) | def finish_batch(self):
method print_iteration (line 202) | def print_iteration(self):
method print_elapsed_time (line 205) | def print_elapsed_time(self, compute_time_py):
method print_train_results (line 208) | def print_train_results(self):
method print_test_results (line 216) | def print_test_results(self):
method print_test_status (line 220) | def print_test_status(self):
method sync_with_host (line 224) | def sync_with_host(self):
method conditional_save (line 230) | def conditional_save(self):
method aggregate_test_outputs (line 237) | def aggregate_test_outputs(self, test_outputs):
method get_test_error (line 241) | def get_test_error(self):
method set_var (line 261) | def set_var(self, var_name, var_val):
method get_var (line 266) | def get_var(self, var_name):
method has_var (line 269) | def has_var(self, var_name):
method save_state (line 272) | def save_state(self):
method get_progress (line 293) | def get_progress(self):
method load_checkpoint (line 298) | def load_checkpoint(load_dir):
method get_options_parser (line 304) | def get_options_parser():
method print_data_providers (line 324) | def print_data_providers():
method parse_options (line 331) | def parse_options(op):
FILE: caffe2/contrib/cuda-convnet2/python_util/options.py
class Option (line 24) | class Option:
method __init__ (line 25) | def __init__(self, letter, name, desc, parser, set_once, default, excu...
method set_value (line 41) | def set_value(self, value, parse=True):
method set_default (line 49) | def set_default(self):
method eval_expr_default (line 53) | def eval_expr_default(self, env):
method get_str_value (line 62) | def get_str_value(self, get_default_str=False):
class OptionsParser (line 70) | class OptionsParser:
method __init__ (line 78) | def __init__(self):
method add_option (line 81) | def add_option(self, letter, name, parser, desc, set_once=False, defau...
method set_value (line 113) | def set_value(self, name, value, parse=True):
method get_value (line 116) | def get_value(self, name):
method delete_option (line 119) | def delete_option(self, name):
method parse (line 123) | def parse(self, eval_expr_defaults=False):
method merge_from (line 151) | def merge_from(self, op2):
method eval_expr_defaults (line 163) | def eval_expr_defaults(self):
method all_values_given (line 168) | def all_values_given(self):
method get_options_list (line 171) | def get_options_list(self, sort_order=SORT_LETTER):
method print_usage (line 182) | def print_usage(self, print_constraints=False):
method print_values (line 220) | def print_values(self):
method _longest_value (line 228) | def _longest_value(values, key=lambda x:x):
method _bold (line 233) | def _bold(str):
class OptionException (line 236) | class OptionException(Exception):
class OptionMissingException (line 239) | class OptionMissingException(OptionException):
class OptionParser (line 242) | class OptionParser:
method parse (line 244) | def parse(value):
method to_string (line 248) | def to_string(value):
method get_type_str (line 252) | def get_type_str():
class IntegerOptionParser (line 255) | class IntegerOptionParser(OptionParser):
method parse (line 257) | def parse(value):
method get_type_str (line 264) | def get_type_str():
method is_type (line 268) | def is_type(value):
class BooleanOptionParser (line 271) | class BooleanOptionParser(OptionParser):
method parse (line 273) | def parse(value):
method get_type_str (line 283) | def get_type_str():
method is_type (line 287) | def is_type(value):
class StringOptionParser (line 290) | class StringOptionParser(OptionParser):
method get_type_str (line 292) | def get_type_str():
method is_type (line 296) | def is_type(value):
class FloatOptionParser (line 299) | class FloatOptionParser(OptionParser):
method parse (line 301) | def parse(value):
method to_string (line 308) | def to_string(value):
method get_type_str (line 312) | def get_type_str():
method is_type (line 316) | def is_type(value):
class RangeOptionParser (line 319) | class RangeOptionParser(OptionParser):
method parse (line 321) | def parse(value):
method to_string (line 330) | def to_string(value):
method get_type_str (line 334) | def get_type_str():
method is_type (line 338) | def is_type(value):
class ListOptionParser (line 341) | class ListOptionParser(OptionParser):
method __init__ (line 360) | def __init__(self, parsers, sepchar=','):
method parse (line 364) | def parse(self, value):
method to_string (line 376) | def to_string(self, value):
method get_type_str (line 381) | def get_type_str(self):
method is_type (line 387) | def is_type(value):
class OptionExpression (line 390) | class OptionExpression:
method __init__ (line 400) | def __init__(self, expr):
method evaluate (line 403) | def evaluate(self, options):
FILE: caffe2/contrib/cuda-convnet2/python_util/util.py
class UnpickleError (line 20) | class UnpickleError(Exception):
function pickle (line 26) | def pickle(filename, data):
function unpickle (line 34) | def unpickle(filename):
function is_intel_machine (line 50) | def is_intel_machine():
function get_cpus_for_gpu (line 62) | def get_cpus_for_gpu(gpu):
function get_cpu (line 79) | def get_cpu():
function is_windows_machine (line 84) | def is_windows_machine():
function tryint (line 87) | def tryint(s):
function alphanum_key (line 93) | def alphanum_key(s):
FILE: caffe2/contrib/cuda-convnet2/shownet.py
class ShowNetError (line 31) | class ShowNetError(Exception):
class ShowConvNet (line 34) | class ShowConvNet(ConvNet):
method __init__ (line 35) | def __init__(self, op, load_dic):
method init_data_providers (line 38) | def init_data_providers(self):
method import_model (line 48) | def import_model(self):
method init_model_state (line 52) | def init_model_state(self):
method init_model_lib (line 56) | def init_model_lib(self):
method plot_cost (line 60) | def plot_cost(self):
method make_filter_fig (line 92) | def make_filter_fig(self, filters, filter_start, fignum, _title, num_f...
method plot_filters (line 132) | def plot_filters(self):
method plot_predictions (line 181) | def plot_predictions(self):
method start (line 294) | def start(self):
method get_options_parser (line 309) | def get_options_parser(cls):
FILE: caffe2/contrib/cuda-convnet2/util/include/matrix.h
type int64 (line 49) | typedef long long int int64;
type FUNCTION (line 81) | enum FUNCTION {
function MTYPE (line 95) | inline MTYPE& getCell(int64 i, int64 j) const {
function MTYPE (line 108) | inline MTYPE* getData() const {
function int64 (line 124) | inline int64 getNumDataBytes() const {
function isSameDims (line 144) | inline bool isSameDims(const Matrix& a) const {
function setTrans (line 158) | inline void setTrans(bool trans) {
FILE: caffe2/contrib/cuda-convnet2/util/include/matrix_funcs.h
function MTYPE (line 32) | inline MTYPE _zero(MTYPE x) {
function MTYPE (line 36) | inline MTYPE _one(MTYPE x) {
function MTYPE (line 40) | inline MTYPE _abs(MTYPE x) {
function MTYPE (line 44) | inline MTYPE _square(MTYPE x) {
function MTYPE (line 48) | inline MTYPE _sigma1(MTYPE x) {
function MTYPE (line 52) | inline MTYPE _sigma2(MTYPE x) {
function MTYPE (line 56) | inline MTYPE _recip(MTYPE x) {
function MTYPE (line 60) | inline MTYPE _exp(MTYPE x) {
function MTYPE (line 64) | inline MTYPE _log(MTYPE x) {
function MTYPE (line 68) | inline MTYPE _tanh(MTYPE x) {
function MTYPE (line 72) | inline MTYPE _sign(MTYPE x) {
function MTYPE (line 76) | inline MTYPE _rand(MTYPE x) {
function MTYPE (line 80) | inline MTYPE _divide(MTYPE x, MTYPE y) {
function MTYPE (line 84) | inline MTYPE _mult(MTYPE x, MTYPE y) {
function MTYPE (line 88) | inline MTYPE _add(MTYPE x, MTYPE y) {
function MTYPE (line 92) | inline MTYPE _addSquare(MTYPE x, MTYPE y) {
function MTYPE (line 96) | inline MTYPE _addWithScale(MTYPE x, MTYPE y, MTYPE scale) {
function MTYPE (line 100) | inline MTYPE _addWithScale2(MTYPE x, MTYPE y, MTYPE scaleThis, MTYPE sca...
function MTYPE (line 104) | inline MTYPE _max(MTYPE x, MTYPE y) {
function MTYPE (line 108) | inline MTYPE _min(MTYPE x, MTYPE y) {
function MTYPE (line 112) | inline MTYPE _bigger(MTYPE x, MTYPE y) {
function MTYPE (line 116) | inline MTYPE _smaller(MTYPE x, MTYPE y) {
function MTYPE (line 120) | inline MTYPE _equal(MTYPE x, MTYPE y) {
function MTYPE (line 124) | inline MTYPE _notEqual(MTYPE x, MTYPE y) {
FILE: caffe2/contrib/cuda-convnet2/util/include/queue.h
function _init (line 35) | void _init(int initialSize) {
function expand (line 47) | void expand() {
function enqueue (line 74) | void enqueue(T el) {
function T (line 90) | T dequeue() {
FILE: caffe2/contrib/cuda-convnet2/util/include/sync.h
function class (line 22) | class Lock {
function class (line 42) | class ThreadSynchronizer {
function sync (line 65) | void sync() {
FILE: caffe2/contrib/cuda-convnet2/util/include/thread.h
function class (line 31) | class Thread {
function virtual (line 55) | virtual ~Thread() {
function setAffinity (line 62) | void setAffinity(std::vector<int>& cpus) {
function pthread_t (line 77) | pthread_t start() {
function join (line 89) | void join(void **status) {
function join (line 98) | void join() {
FILE: caffe2/contrib/cuda-convnet2/util/src/matrix.cpp
function sqrt (line 21) | double sqrt(int _X) {return sqrt((double) _X);}
function log (line 22) | double log(int _X) {return log((double) _X);}
function Matrix (line 107) | Matrix& Matrix::slice(int64 startRow, int64 endRow, int64 startCol, int6...
function Matrix (line 130) | Matrix& Matrix::sliceRows(int64 startRow, int64 endRow) const {
function Matrix (line 138) | Matrix& Matrix::sliceCols(int64 startCol, int64 endCol) const {
function Matrix (line 422) | Matrix& Matrix::transpose() const {
function Matrix (line 426) | Matrix& Matrix::transpose(bool hard) const {
function Matrix (line 439) | Matrix& Matrix::tile(int64 timesY, int64 timesX) const {
function Matrix (line 522) | Matrix& Matrix::copy() const {
function MTYPE (line 544) | MTYPE Matrix::min() const {
function Matrix (line 548) | Matrix& Matrix::min(int64 axis) const {
function MTYPE (line 558) | MTYPE Matrix::max() const {
function Matrix (line 562) | Matrix& Matrix::max(int64 axis) const {
function MTYPE (line 572) | MTYPE Matrix::sum() const {
function MTYPE (line 576) | MTYPE Matrix::norm() const {
function MTYPE (line 580) | MTYPE Matrix::norm2() const {
function Matrix (line 584) | Matrix& Matrix::sum(int64 axis) const {
function MTYPE (line 608) | MTYPE Matrix::_aggregateRow(int64 row, MTYPE (*agg_func)(MTYPE, MTYPE), ...
function MTYPE (line 616) | MTYPE Matrix::_aggregateCol(int64 col, MTYPE (*agg_func)(MTYPE, MTYPE), ...
function MTYPE (line 624) | MTYPE Matrix::_aggregate(MTYPE (*agg_func)(MTYPE, MTYPE), MTYPE initialV...
function Matrix (line 750) | Matrix& Matrix::reshaped(int64 numRows, int64 numCols) {
FILE: caffe2/contrib/gloo/allgather_ops.cc
type caffe2 (line 21) | namespace caffe2 {
type gloo (line 22) | namespace gloo {
FILE: caffe2/contrib/gloo/allgather_ops.h
function namespace (line 29) | namespace caffe2 {
FILE: caffe2/contrib/gloo/allreduce_ops.cc
type caffe2 (line 24) | namespace caffe2 {
type gloo (line 25) | namespace gloo {
FILE: caffe2/contrib/gloo/allreduce_ops.h
function namespace (line 29) | namespace caffe2 {
FILE: caffe2/contrib/gloo/allreduce_ops_gpu.cc
type caffe2 (line 27) | namespace caffe2 {
type gloo (line 28) | namespace gloo {
function initializeAlgorithm (line 34) | std::unique_ptr<::gloo::Algorithm> initializeAlgorithm(
FILE: caffe2/contrib/gloo/barrier_ops.cc
type caffe2 (line 19) | namespace caffe2 {
type gloo (line 20) | namespace gloo {
FILE: caffe2/contrib/gloo/barrier_ops.h
function namespace (line 27) | namespace caffe2 {
FILE: caffe2/contrib/gloo/broadcast_ops.cc
type caffe2 (line 21) | namespace caffe2 {
type gloo (line 22) | namespace gloo {
FILE: caffe2/contrib/gloo/broadcast_ops.h
function namespace (line 29) | namespace caffe2 {
FILE: caffe2/contrib/gloo/broadcast_ops_gpu.cc
type caffe2 (line 23) | namespace caffe2 {
type gloo (line 24) | namespace gloo {
FILE: caffe2/contrib/gloo/common.cc
type caffe2 (line 27) | namespace caffe2 {
type gloo (line 28) | namespace gloo {
function signalFailure (line 30) | void signalFailure(Blob* status_blob, std::exception& /* unused */) {
function createDevice (line 36) | std::shared_ptr<::gloo::transport::Device> createDevice(
FILE: caffe2/contrib/gloo/common.h
function namespace (line 27) | namespace caffe2 {
function other (line 82) | bool operator==(GlooParameters const& other) const {
FILE: caffe2/contrib/gloo/common_world_ops.cc
type caffe2 (line 21) | namespace caffe2 {
type gloo (line 22) | namespace gloo {
FILE: caffe2/contrib/gloo/common_world_ops.h
function namespace (line 33) | namespace caffe2 {
function RunOnDevice (line 246) | bool RunOnDevice() override {
FILE: caffe2/contrib/gloo/common_world_ops_gpu.cc
type caffe2 (line 24) | namespace caffe2 {
type gloo (line 25) | namespace gloo {
FILE: caffe2/contrib/gloo/context.cc
type caffe2 (line 23) | namespace caffe2 {
FILE: caffe2/contrib/gloo/gloo_test.py
class TemporaryDirectory (line 46) | class TemporaryDirectory:
method __enter__ (line 47) | def __enter__(self):
method __exit__ (line 51) | def __exit__(self, type, value, traceback):
class TestCase (line 55) | class TestCase(hu.HypothesisTestCase):
method run_test_locally (line 59) | def run_test_locally(self, fn, device_option=None, **kwargs):
method run_test_distributed (line 101) | def run_test_distributed(self, fn, device_option=None, **kwargs):
method create_common_world (line 112) | def create_common_world(self, comm_rank, comm_size, tmpdir=None, exist...
method synchronize (line 153) | def synchronize(self, store_handler, value, comm_rank=None):
method _test_broadcast (line 171) | def _test_broadcast(self,
method test_broadcast (line 229) | def test_broadcast(self, comm_size, blob_size, num_blobs, device_option,
method _test_allreduce (line 250) | def _test_allreduce(self,
method _test_allreduce_multicw (line 300) | def _test_allreduce_multicw(self,
method test_allreduce (line 344) | def test_allreduce(self, comm_size, blob_size, num_blobs, device_option,
method _test_reduce_scatter (line 365) | def _test_reduce_scatter(self,
method test_reduce_scatter (line 432) | def test_reduce_scatter(self, comm_size, blob_size, num_blobs,
method _test_allgather (line 453) | def _test_allgather(self,
method test_allgather (line 512) | def test_allgather(self, comm_size, blob_size, num_blobs, device_option,
method test_forked_cw (line 534) | def test_forked_cw(self, device_option):
method _test_barrier (line 548) | def _test_barrier(
method test_barrier (line 574) | def test_barrier(self, comm_size, device_option):
method _test_close_connection (line 588) | def _test_close_connection(
method test_close_connection (line 624) | def test_close_connection(self, comm_size, device_option):
method _test_io_error (line 642) | def _test_io_error(
method test_io_error (line 680) | def test_io_error(self, comm_size, device_option):
FILE: caffe2/contrib/gloo/py_export.cc
type gloo (line 4) | namespace gloo {
type python (line 5) | namespace python {
function PYBIND11_MODULE (line 9) | PYBIND11_MODULE(python, m) {
FILE: caffe2/contrib/gloo/reduce_scatter_ops.cc
type caffe2 (line 22) | namespace caffe2 {
type gloo (line 23) | namespace gloo {
FILE: caffe2/contrib/gloo/reduce_scatter_ops.h
function namespace (line 29) | namespace caffe2 {
FILE: caffe2/contrib/gloo/store_handler.cc
type caffe2 (line 19) | namespace caffe2 {
type gloo (line 20) | namespace gloo {
FILE: caffe2/contrib/gloo/store_handler.h
function namespace (line 23) | namespace caffe2 {
FILE: caffe2/contrib/nccl/cuda_nccl_gpu.cc
type caffe2 (line 19) | namespace caffe2 {
type nccl (line 21) | namespace nccl {
function getDevices (line 25) | std::vector<int> getDevices(const NCCLExecution& ex) {
class NCCLContext (line 34) | class NCCLContext {
method NCCLContext (line 36) | explicit NCCLContext(const NCCLExecution& ex)
function ncclKey (line 95) | std::string ncclKey(const NCCLExecution& ex) {
function NCCLContext (line 106) | NCCLContext* getNCCLContext(const NCCLExecution& ex) {
method NCCLContext (line 36) | explicit NCCLContext(const NCCLExecution& ex)
class ncclTypeWrapper (line 117) | class ncclTypeWrapper
class ncclTypeWrapper<float> (line 120) | class ncclTypeWrapper<float> {
class ncclTypeWrapper<int> (line 126) | class ncclTypeWrapper<int> {
class ncclTypeWrapper<float16> (line 133) | class ncclTypeWrapper<float16> {
function runNCCL (line 140) | void runNCCL(const NCCLExecution& ex, InitF&& init_f, F&& f) {
class NCCL<float> (line 331) | class NCCL<float>
class NCCL<int> (line 332) | class NCCL<int>
class NCCL<float16> (line 334) | class NCCL<float16>
FILE: caffe2/contrib/nccl/cuda_nccl_gpu.h
function namespace (line 33) | namespace caffe2 {
FILE: caffe2/contrib/nccl/cuda_nccl_op_gpu.cc
type caffe2 (line 22) | namespace caffe2 {
function getNCCLElements (line 24) | nccl::NCCLExecution getNCCLElements(
function AllInputsAre (line 55) | bool AllInputsAre(OperatorBase* op) {
class NCCLAllreduceOp (line 67) | class NCCLAllreduceOp final : public Operator<CUDAContext> {
method NCCLAllreduceOp (line 70) | NCCLAllreduceOp(const OperatorDef& operator_def, Workspace* ws)
method RunOnDevice (line 72) | bool RunOnDevice() override {
class NCCLBroadcastOp (line 90) | class NCCLBroadcastOp final : public Operator<CUDAContext> {
method RunOnDevice (line 94) | bool RunOnDevice() override {
class NCCLReduceOp (line 111) | class NCCLReduceOp final : public Operator<CUDAContext> {
method RunOnDevice (line 115) | bool RunOnDevice() override {
class NCCLAllGatherOp (line 134) | class NCCLAllGatherOp final : public Operator<CUDAContext> {
method RunOnDevice (line 138) | bool RunOnDevice() override {
class NCCLReduceScatterOp (line 155) | class NCCLReduceScatterOp final : public Operator<CUDAContext> {
method RunOnDevice (line 159) | bool RunOnDevice() override {
function ncclOpDevInfer (line 176) | std::pair<std::vector<DeviceOption>, std::vector<DeviceOption>> ncclOp...
FILE: caffe2/contrib/nccl/nccl_ops_test.py
function gpu_device (line 36) | def gpu_device(i):
function benchmark (line 43) | def benchmark(ws, net, warmups=5, iters=100):
class NCCLOpsTest (line 57) | class NCCLOpsTest(hu.HypothesisTestCase):
method test_nccl_allreduce (line 61) | def test_nccl_allreduce(self, n, m, in_place):
method test_nccl_broadcast (line 85) | def test_nccl_broadcast(self, n, m, root):
method test_nccl_reduce (line 105) | def test_nccl_reduce(self, n, m, root, in_place):
method test_nccl_allgather (line 124) | def test_nccl_allgather(self, n, m):
method test_nccl_reduce_scatter (line 144) | def test_nccl_reduce_scatter(self, n, m):
method _test_nccl_sync (line 166) | def _test_nccl_sync(self, n, m, iters, net_type):
method test_timings (line 187) | def test_timings(self):
FILE: caffe2/contrib/nervana/nervana.h
function namespace (line 30) | namespace caffe2 {
FILE: caffe2/contrib/nervana/nervana_fc_op_gpu.cc
type caffe2 (line 22) | namespace caffe2 {
FILE: caffe2/contrib/nervana/nervana_fc_op_gpu_test.cc
type caffe2 (line 32) | namespace caffe2 {
function AddConstInput (line 35) | static void AddConstInput(const std::vector<int>& shape, const float v...
function TEST (line 50) | TEST(NervanaFullyConnectedTest, Test) {
FILE: caffe2/contrib/nervana/nervana_init_gpu.cc
type caffe2 (line 28) | namespace caffe2 {
function NervanaKernelLoaded (line 34) | bool NervanaKernelLoaded() { return g_nervana_kernel_loaded; }
function Caffe2InitializeNervanaKernels (line 36) | bool Caffe2InitializeNervanaKernels(int*, char***) {
FILE: caffe2/contrib/nervana/nervana_math_gpu.cc
type caffe2 (line 22) | namespace caffe2 {
type math (line 24) | namespace math {
FILE: caffe2/contrib/nnpack/nnpack_ops.cc
type caffe2 (line 40) | namespace caffe2 {
function has_nnpack (line 47) | bool has_nnpack() {
function nnp_convolution_algorithm (line 54) | nnp_convolution_algorithm get_nnp_convolution_algorithm(
function nnp_convolution_transform_strategy (line 71) | nnp_convolution_transform_strategy get_nnp_convolution_transform_strat...
function pthreadpool_t (line 88) | pthreadpool_t nnpack_threadpool() {
class NNPACKConvOp (line 112) | class NNPACKConvOp final : public ConvPoolOpBase<CPUContext> {
method NNPACKConvOp (line 114) | NNPACKConvOp(const OperatorDef& operator_def, Workspace* ws)
method RunOnDeviceWithOrderNCHW (line 132) | bool RunOnDeviceWithOrderNCHW() override {
class NNPACKMaxPoolOp (line 232) | class NNPACKMaxPoolOp final : public ConvPoolOpBase<CPUContext> {
method NNPACKMaxPoolOp (line 234) | NNPACKMaxPoolOp(const OperatorDef& operator_def, Workspace* ws)
method RunOnDeviceWithOrderNCHW (line 265) | bool RunOnDeviceWithOrderNCHW() override {
class NNPACKReluOp (line 309) | class NNPACKReluOp final : public Operator<CPUContext> {
method NNPACKReluOp (line 311) | NNPACKReluOp(const OperatorDef& operator_def, Workspace* ws)
method RunOnDevice (line 318) | bool RunOnDevice() override {
class NNPACKLeakyReluOp (line 335) | class NNPACKLeakyReluOp final : public LeakyReluOp<float, CPUContext> {
method NNPACKLeakyReluOp (line 337) | NNPACKLeakyReluOp(const OperatorDef& operator_def, Workspace* ws)
method RunOnDevice (line 344) | bool RunOnDevice() override {
FILE: caffe2/contrib/nnpack/nnpack_ops_test.py
function benchmark (line 36) | def benchmark(ws, net, warmups=5, iters=100):
function has_avx2 (line 49) | def has_avx2():
class NNPackOpsTest (line 60) | class NNPackOpsTest(hu.HypothesisTestCase):
method test_convolution_correctness (line 69) | def test_convolution_correctness(self, stride, pad, kernel, size,
method test_max_pool_correctness (line 114) | def test_max_pool_correctness(self, size, input_channels, batch_size):
method test_relu_correctness (line 147) | def test_relu_correctness(self, size, input_channels, batch_size):
method test_leaky_relu_correctness (line 171) | def test_leaky_relu_correctness(self, size, input_channels, batch_size,
method test_timings (line 202) | def test_timings(self, stride, pad, kernel, size,
method test_relu_timings (line 236) | def test_relu_timings(self, size, input_channels, batch_size):
FILE: caffe2/contrib/playground/AnyExp.py
function initOpts (line 27) | def initOpts(opts):
function initDefaultModuleMap (line 54) | def initDefaultModuleMap():
function registerModuleMap (line 58) | def registerModuleMap(module_map):
function aquireDatasets (line 62) | def aquireDatasets(opts):
function createTrainerClass (line 67) | def createTrainerClass(opts):
function runShardedTrainLoop (line 71) | def runShardedTrainLoop(opts, myTrainFun):
function trainFun (line 122) | def trainFun():
function initialize_params_from_file (line 130) | def initialize_params_from_file(*args, **kwargs):
class AnyExpTrainer (line 133) | class AnyExpTrainer(object):
method __init__ (line 135) | def __init__(self, opts):
method get_input_dataset (line 185) | def get_input_dataset(self, opts):
method get_model_input_fun (line 189) | def get_model_input_fun(self):
method init_model (line 193) | def init_model(self):
method init_metrics (line 196) | def init_metrics(self):
method getMeterClass (line 205) | def getMeterClass(self, meterName):
method add_metric (line 208) | def add_metric(self, name, calculator, is_train):
method extendMetricsOutput (line 215) | def extendMetricsOutput(self):
method init_plots (line 231) | def init_plots(self):
method add_plot (line 234) | def add_plot(self, x, x_title, ys, y_title):
method init_logs (line 244) | def init_logs(self):
method list_of_epochs (line 247) | def list_of_epochs(self):
method list_of_epoch_iters (line 253) | def list_of_epoch_iters(self):
method fun_per_epoch_b4RunNet (line 257) | def fun_per_epoch_b4RunNet(self, epoch):
method fun_per_epoch_aftRunNet (line 261) | def fun_per_epoch_aftRunNet(self, epoch):
method checkpoint (line 264) | def checkpoint(self, epoch):
method gen_checkpoint_path (line 269) | def gen_checkpoint_path(self, is_checkpoint, epoch):
method fun_per_iter_b4RunNet (line 281) | def fun_per_iter_b4RunNet(self, epoch, epoch_iter):
method fun_per_iter_aftRunNetB4Test (line 285) | def fun_per_iter_aftRunNetB4Test(self, epoch, epoch_iter):
method fun_per_iter_aftRunNetAftTest (line 289) | def fun_per_iter_aftRunNetAftTest(self, epoch, epoch_iter):
method fun_conclude_operator (line 293) | def fun_conclude_operator(self, opts):
method createMetricsPlotsModelsOutputs (line 296) | def createMetricsPlotsModelsOutputs(self):
method assembleAllOutputs (line 301) | def assembleAllOutputs(self):
method gen_input_builder_fun (line 305) | def gen_input_builder_fun(self, model, dataset, is_train):
method gen_forward_pass_builder_fun (line 309) | def gen_forward_pass_builder_fun(self, model, dataset, is_train):
method gen_param_update_builder_fun (line 313) | def gen_param_update_builder_fun(self, model, dataset, is_train):
method gen_optimizer_fun (line 317) | def gen_optimizer_fun(self, model, dataset, is_train):
method gen_rendezvous_ctx (line 321) | def gen_rendezvous_ctx(self, model, dataset, is_train):
method planning_output (line 325) | def planning_output(self):
method prep_data_parallel_models (line 330) | def prep_data_parallel_models(self):
method prep_a_data_parallel_model (line 336) | def prep_a_data_parallel_model(self, model, dataset, is_train):
method loadCheckpoint (line 382) | def loadCheckpoint(self):
method buildModelAndTrain (line 415) | def buildModelAndTrain(self, opts):
FILE: caffe2/contrib/playground/ModuleRegister.py
function registerModuleMap (line 15) | def registerModuleMap(module_map):
function constructTrainerClass (line 21) | def constructTrainerClass(myTrainerClass, opts):
function getModule (line 81) | def getModule(moduleName):
function getClassFromModule (line 97) | def getClassFromModule(moduleName, className):
FILE: caffe2/contrib/playground/checkpoint.py
function initialize_params_from_file (line 20) | def initialize_params_from_file(
function initialize_master_xpu_model_params (line 29) | def initialize_master_xpu_model_params(model, weights_file, opts, reset_...
function broadcast_parameters (line 99) | def broadcast_parameters(opts, model, num_xpus, broadcast_computed_param...
function save_model_params (line 124) | def save_model_params(is_checkpoint, model, checkpoint_path, epoch, opts...
function save_model_params_blob (line 135) | def save_model_params_blob(model, params_file, epoch, opts, best_metric):
function unscope_name (line 166) | def unscope_name(blob_name):
function scoped_name (line 170) | def scoped_name(blob_name):
FILE: caffe2/contrib/playground/compute_loss.py
class ComputeLoss (line 10) | class ComputeLoss(Meter.Meter):
method __init__ (line 11) | def __init__(self, opts=None, blob_name=''):
method Reset (line 17) | def Reset(self):
method Add (line 21) | def Add(self):
method Compute (line 32) | def Compute(self):
FILE: caffe2/contrib/playground/compute_topk_accuracy.py
class ComputeTopKAccuracy (line 11) | class ComputeTopKAccuracy(Meter.Meter):
method __init__ (line 18) | def __init__(self, blob_name=None, opts=None, topk=1):
method Reset (line 27) | def Reset(self):
method Add (line 31) | def Add(self):
method Compute (line 56) | def Compute(self):
FILE: caffe2/contrib/playground/meter.py
class Meter (line 9) | class Meter(object):
method __init__ (line 12) | def __init__(self, **kwargs):
method Reset (line 16) | def Reset(self):
method Add (line 20) | def Add(self):
method Compute (line 24) | def Compute(self):
FILE: caffe2/contrib/playground/output_generator.py
function fun_conclude_operator (line 8) | def fun_conclude_operator(self):
function assembleAllOutputs (line 14) | def assembleAllOutputs(self):
FILE: caffe2/contrib/playground/resnet50demo/IN1k_resnet50.py
function init_model (line 13) | def init_model(self):
function fun_per_epoch_b4RunNet (line 34) | def fun_per_epoch_b4RunNet(self, epoch):
function fun_per_iter_b4RunNet (line 38) | def fun_per_iter_b4RunNet(self, epoch, epoch_iter):
function run_training_net (line 54) | def run_training_net(self):
FILE: caffe2/contrib/playground/resnet50demo/caffe2_resnet50_default_forward.py
function gen_forward_pass_builder_fun (line 9) | def gen_forward_pass_builder_fun(self, model, dataset, is_train):
FILE: caffe2/contrib/playground/resnet50demo/caffe2_resnet50_default_param_update.py
function gen_param_update_builder_fun (line 7) | def gen_param_update_builder_fun(self, model, dataset, is_train):
FILE: caffe2/contrib/playground/resnet50demo/explicit_resnet_forward.py
function gen_forward_pass_builder_fun (line 11) | def gen_forward_pass_builder_fun(self, model, dataset, is_train):
function resnet_imagenet_create_model (line 28) | def resnet_imagenet_create_model(model, data, labels, split, opts, datas...
class ResNetModelHelper (line 114) | class ResNetModelHelper():
method __init__ (line 116) | def __init__(self, model, split, opts):
method add_shortcut (line 122) | def add_shortcut(self, blob_in, dim_in, dim_out, stride, prefix):
method conv_bn (line 144) | def conv_bn(
method conv_bn_relu (line 164) | def conv_bn_relu(
method multiway_bottleneck_block (line 174) | def multiway_bottleneck_block(
method group_bottleneck_block (line 211) | def group_bottleneck_block(
method bottleneck_block (line 236) | def bottleneck_block(
method basic_block (line 260) | def basic_block(
method residual_layer (line 276) | def residual_layer(
FILE: caffe2/contrib/playground/resnet50demo/explicit_resnet_param_update.py
function gen_param_update_builder_fun (line 10) | def gen_param_update_builder_fun(self, model, dataset, is_train):
FILE: caffe2/contrib/playground/resnet50demo/gfs_IN1k.py
function gen_input_builder_fun (line 8) | def gen_input_builder_fun(self, model, dataset, is_train):
function get_input_dataset (line 49) | def get_input_dataset(opts):
function get_model_input_fun (line 53) | def get_model_input_fun(self):
FILE: caffe2/contrib/playground/resnet50demo/rendezvous_filestore.py
function gen_rendezvous_ctx (line 19) | def gen_rendezvous_ctx(self, model, dataset, is_train):
FILE: caffe2/contrib/prof/cuda_profile_ops.cc
type caffe2 (line 25) | namespace caffe2 {
class CudaProfileInitializeOp (line 47) | class CudaProfileInitializeOp : public OperatorBase {
method CudaProfileInitializeOp (line 49) | CudaProfileInitializeOp(const OperatorDef& operator_def, Workspace* ws)
method Run (line 74) | virtual bool Run(int /* unused */ /*stream_id*/ = 0) {
class CudaProfileStartOp (line 86) | class CudaProfileStartOp : public OperatorBase {
method CudaProfileStartOp (line 88) | CudaProfileStartOp(const OperatorDef& operator_def, Workspace* ws)
method Run (line 91) | virtual bool Run(int /* unused */ /*stream_id*/ = 0) {
class CudaProfileStopOp (line 97) | class CudaProfileStopOp : public OperatorBase {
method CudaProfileStopOp (line 99) | CudaProfileStopOp(const OperatorDef& operator_def, Workspace* ws)
method Run (line 102) | virtual bool Run(int /* unused */ /*stream_id*/ = 0) {
FILE: caffe2/contrib/prof/cuda_profile_ops_test.py
class CudaProfileOpsTest (line 28) | class CudaProfileOpsTest(unittest.TestCase):
method test_run (line 30) | def test_run(self):
FILE: caffe2/contrib/prof/htrace_async_dag_net_gpu.cc
type caffe2 (line 23) | namespace caffe2 {
class HTraceAsyncDAGNet (line 26) | class HTraceAsyncDAGNet : public AsyncDAGNet {
method HTraceAsyncDAGNet (line 28) | HTraceAsyncDAGNet(const std::shared_ptr<const NetDef>& net_def, Work...
method DoRunAsync (line 54) | bool DoRunAsync() override {
FILE: caffe2/contrib/prof/htrace_conf.cc
type caffe2 (line 28) | namespace caffe2 {
function string (line 30) | const string defaultHTraceConf(const string& net_name) {
FILE: caffe2/contrib/prof/htrace_conf.h
function namespace (line 23) | namespace caffe2 {
FILE: caffe2/contrib/prof/htrace_dag_net.cc
type caffe2 (line 23) | namespace caffe2 {
class HTraceDAGNet (line 26) | class HTraceDAGNet : public DAGNetBase {
method HTraceDAGNet (line 28) | HTraceDAGNet(const std::shared_ptr<const NetDef>& net_def, Workspace...
method SupportsAsync (line 41) | bool SupportsAsync() override {
method DoRunAsync (line 58) | bool DoRunAsync() override {
method RunAt (line 66) | bool RunAt(int /* unused */, const std::vector<int>& chain) override {
FILE: caffe2/contrib/prof/htrace_to_chrome.py
function stop_display (line 31) | def stop_display(limit, curr):
function build_trace_dict (line 35) | def build_trace_dict(f, start_time, end_time):
function generate_chrome_trace (line 80) | def generate_chrome_trace(root_list, display):
function get_argument_parser (line 189) | def get_argument_parser():
function main (line 203) | def main():
FILE: caffe2/contrib/prof/prof_dag_net.cc
type caffe2 (line 24) | namespace caffe2 {
function ProfDAGProto (line 103) | ProfDAGProto ProfDAGNet::ProtoMsg(std::pair<std::string, Stats> op_sta...
function ProfDAGProtos (line 113) | ProfDAGProtos ProfDAGNet::GetOperatorStats() {
function ProfDAGProtos (line 124) | ProfDAGProtos ProfDAGNet::GetPerOperatorCost() {
FILE: caffe2/contrib/prof/prof_dag_net.h
function namespace (line 22) | namespace caffe2 {
FILE: caffe2/contrib/prof/prof_dag_stats_op.cc
type caffe2 (line 19) | namespace caffe2 {
FILE: caffe2/contrib/script/caffe2_script_test.py
function feed_inputs (line 16) | def feed_inputs(inputs):
function assert_proto_equals (line 21) | def assert_proto_equals(proto, expected):
class TestCaffe2Script (line 31) | class TestCaffe2Script(hu.HypothesisTestCase):
method test_foo (line 56) | def test_foo(self, firstdim, seconddim, seed, gc, dc):
method test_trinary (line 76) | def test_trinary(self):
method test_bool_literal (line 90) | def test_bool_literal(self):
method test_bool_operators (line 102) | def test_bool_operators(self):
method expect_fail (line 120) | def expect_fail(self, fn, msg):
method test_fails (line 129) | def test_fails(self):
method test_print (line 154) | def test_print(self):
method test_method (line 170) | def test_method(self):
method test_plus_eq (line 180) | def test_plus_eq(self):
method test_cast (line 191) | def test_cast(self):
method test_global (line 201) | def test_global(self):
method test_module_as_arg_ret (line 214) | def test_module_as_arg_ret(self):
method test_call_extern (line 235) | def test_call_extern(self):
method test_if (line 266) | def test_if(self, seed, gc, dc):
method test_while (line 289) | def test_while(self, seed, gc, dc):
method test_gather (line 310) | def test_gather(self, seed, gc, dc):
method test_slice (line 368) | def test_slice(self, seed, gc, dc):
FILE: caffe2/contrib/script/compiler.cc
type caffe2 (line 7) | namespace caffe2 {
type script (line 8) | namespace script {
type FunctionDefinition (line 19) | struct FunctionDefinition {
method FunctionDefinition (line 20) | explicit FunctionDefinition(Def tree)
method FunctionDefinition (line 23) | explicit FunctionDefinition(std::unique_ptr<NetDef> def)
method isExtern (line 41) | bool isExtern() const {
type DefCompiler (line 54) | struct DefCompiler {
method DefCompiler (line 55) | DefCompiler(FunctionDefinition& def, SymbolTable& symbol_table)
method run (line 59) | void run() {
method emitExpressionStatement (line 74) | void emitExpressionStatement(TreeRef stmt) {
method emitStatements (line 78) | void emitStatements(const ListView<TreeRef>& statements) {
method map (line 102) | void map(const std::string& name, const std::string& value) {
method emitAssignment (line 110) | void emitAssignment(const Assign& stmt) {
method emitIf (line 141) | void emitIf(const If& stmt) {
method emitWhile (line 161) | void emitWhile(const While& stmt) {
method getLHS (line 183) | std::string getLHS(const TreeRef& tree) {
method getValue (line 200) | std::string getValue(const TreeRef& tree) {
method fresh (line 218) | std::string fresh(std::string prefix = "$t") {
method fillArg (line 258) | void fillArg(Argument* arg, const Attribute& attr) {
method getValues (line 285) | std::vector<std::string> getValues(const Trees& trees) {
method renameLookup (line 293) | bool renameLookup(
method renameOp (line 315) | void renameOp(
method hasBypassRename (line 358) | bool hasBypassRename(const Apply& apply) {
method emitFunctionCall (line 376) | void emitFunctionCall(Apply& apply, const std::vector<std::string>...
method expectOutputs (line 406) | void expectOutputs(
method appendOutputs (line 416) | void appendOutputs(
method emitOperator (line 426) | void emitOperator(
method emit (line 473) | void emit(const TreeRef& tree, const std::vector<std::string>& out...
method desugarAndEmitOperator (line 573) | void desugarAndEmitOperator(
method TensorProto_DataType (line 589) | TensorProto_DataType getType(int type) {
method OperatorDef (line 605) | OperatorDef* emitConst(
method NetDef (line 636) | NetDef& cur() {
method emitFillOp (line 647) | void emitFillOp(const Apply& apply, const std::vector<std::string>...
method emitModule (line 709) | void emitModule(const Apply& apply, const std::vector<std::string>...
type CompilationUnitImpl (line 725) | struct CompilationUnitImpl {
method defineFunction (line 726) | void defineFunction(const Def& def) {
method define (line 737) | void define(const std::string& str) {
method createNet (line 744) | std::unique_ptr<NetBase> createNet(Workspace* ws, const std::strin...
method defineExtern (line 751) | void defineExtern(const std::string& name, std::unique_ptr<NetDef>...
method getProto (line 759) | std::string getProto(const std::string& functionName) {
FILE: caffe2/contrib/script/compiler.h
function namespace (line 6) | namespace caffe2 {
FILE: caffe2/contrib/script/error_report.h
function namespace (line 5) | namespace caffe2 {
FILE: caffe2/contrib/script/lexer.cc
type caffe2 (line 4) | namespace caffe2 {
type script (line 5) | namespace script {
function kindToString (line 7) | std::string kindToString(int kind) {
function SharedParserData (line 21) | SharedParserData& sharedParserData() {
FILE: caffe2/contrib/script/lexer.h
function namespace (line 13) | namespace caffe2 {
type SharedParserData (line 115) | struct SharedParserData {
function isUnary (line 265) | bool isUnary(int kind, int* prec) {
function isBinary (line 273) | bool isBinary(int kind, int* prec) {
function isRightAssociative (line 281) | bool isRightAssociative(int kind) {
type SourceRange (line 306) | struct SourceRange {
function text (line 354) | struct Token {
type Lookahead (line 373) | struct Lookahead {
function next (line 380) | struct Lexer {
function nextIf (line 407) | bool nextIf(int kind) {
function reportError (line 414) | [[noreturn]] void reportError(const std::string& what) {
function reportError (line 417) | [[noreturn]] void reportError(const std::string& what, const Token& t) {
function expected (line 423) | [[noreturn]] void expected(const std::string& what, const Token& t) {
function expected (line 430) | [[noreturn]] void expected(const std::string& what) {
function Token (line 433) | Token expect(int kind) {
FILE: caffe2/contrib/script/parser.h
function namespace (line 6) | namespace caffe2 {
FILE: caffe2/contrib/script/tree.h
type Tree (line 27) | struct Tree
function Tree (line 33) | struct Tree : std::enable_shared_from_this<Tree> {
function Tree (line 94) | struct String : public Tree {
function Tree (line 107) | struct Number : public Tree {
function Tree (line 120) | struct Bool : public Tree {
function virtual (line 151) | virtual const TreeList& trees() const override {
function virtual (line 161) | virtual TreeRef map(std::function<TreeRef(TreeRef)> fn) override {
FILE: caffe2/contrib/script/tree_views.h
function namespace (line 5) | namespace caffe2 {
FILE: caffe2/contrib/shm_mutex/shm_mutex.cc
function ShmProcessMutexCheck (line 19) | ShmProcessMutexCheck& ShmProcessMutexCheck::getInstance() {
FILE: caffe2/contrib/shm_mutex/shm_mutex.h
function class (line 59) | class ShmProcessMutexCheck {
function explicit (line 88) | explicit ShmProcessMutex(const char* name)
function lock (line 190) | void lock() {
function try_lock (line 218) | bool try_lock() {
function unlock (line 241) | void unlock() noexcept {
function explicit (line 287) | explicit ShmTTSetMutex(const char* name, int timeout = kTimeout)
function subUnlock (line 303) | void subUnlock() noexcept {}
function explicit (line 311) | explicit ShmTicketMutex(const char* name, int delay = kTicketDelay)
function subUnlock (line 333) | void subUnlock() noexcept {
FILE: caffe2/contrib/tensorboard/tensorboard.py
class Config (line 18) | class Config(object):
function _show_graph (line 47) | def _show_graph(graph_def):
function visualize_cnn (line 63) | def visualize_cnn(cnn, **kwargs):
function visualize_net (line 68) | def visualize_net(nets, **kwargs):
function visualize_ops (line 73) | def visualize_ops(ops, **kwargs):
function cli (line 79) | def cli():
function write_events (line 83) | def write_events(tf_dir, events):
function graph_def_to_event (line 97) | def graph_def_to_event(step, graph_def):
function tensorboard_graphs (line 106) | def tensorboard_graphs(c2_netdef, tf_dir):
function tensorboard_events (line 130) | def tensorboard_events(c2_dir, tf_dir):
FILE: caffe2/contrib/tensorboard/tensorboard_exporter.py
function _make_unique_name (line 19) | def _make_unique_name(seen, name, min_version=0):
function _convert_to_ssa (line 30) | def _convert_to_ssa(shapes, track_blob_names, ops):
function _get_blob_names (line 76) | def _get_blob_names(ops):
function _remap_keys (line 84) | def _remap_keys(m, f):
function _rename_all (line 90) | def _rename_all(shapes, track_blob_names, ops, f):
function _add_gradient_scope (line 124) | def _add_gradient_scope(shapes, track_blob_names, ops):
function _replace_colons (line 140) | def _replace_colons(shapes, track_blob_names, ops, repl):
function _fill_missing_operator_names (line 149) | def _fill_missing_operator_names(ops):
function _tf_device (line 174) | def _tf_device(device_option):
function _add_tf_shape (line 184) | def _add_tf_shape(m, ints):
function _set_tf_attr (line 193) | def _set_tf_attr(m, arg):
function _operator_to_node (line 225) | def _operator_to_node(shapes, op):
function _blob_to_node (line 244) | def _blob_to_node(producing_ops, shapes, name):
function _operators_to_graph_def (line 264) | def _operators_to_graph_def(
function _propagate_device_option (line 298) | def _propagate_device_option(net):
function _try_get_shapes (line 306) | def _try_get_shapes(nets):
function nets_to_graph_def (line 316) | def nets_to_graph_def(nets, shapes=None, **kwargs):
function cnn_to_graph_def (line 330) | def cnn_to_graph_def(cnn, **kwargs):
function ops_to_graph_def (line 334) | def ops_to_graph_def(ops, shapes=None, **kwargs):
FILE: caffe2/contrib/tensorboard/tensorboard_exporter_test.py
class TensorboardExporterTest (line 591) | class TensorboardExporterTest(unittest.TestCase):
method test_that_operators_gets_non_colliding_names (line 592) | def test_that_operators_gets_non_colliding_names(self):
method test_that_replacing_colons_gives_non_colliding_names (line 600) | def test_that_replacing_colons_gives_non_colliding_names(self):
method test_that_adding_gradient_scope_does_no_fancy_renaming (line 619) | def test_that_adding_gradient_scope_does_no_fancy_renaming(self):
method test_that_auto_ssa_gives_non_colliding_names (line 638) | def test_that_auto_ssa_gives_non_colliding_names(self):
method test_simple_cnnmodel (line 662) | def test_simple_cnnmodel(self):
FILE: caffe2/contrib/tensorboard/tensorboard_test.py
class TensorboardTest (line 18) | class TensorboardTest(unittest.TestCase):
method test_events (line 20) | def test_events(self):
method test_tensorboard_graphs (line 52) | def test_tensorboard_graphs(self):
FILE: caffe2/contrib/torch/th_ops.cc
type caffe2 (line 24) | namespace caffe2 {
function UniqueTHFloatTensor (line 31) | UniqueTHFloatTensor aliasFromTensorCPU(TensorCPU* tensor) {
function copyToTensorCPU (line 51) | void copyToTensorCPU(UniqueTHFloatTensor th, TensorCPU* tensor) {
class THNNELUCPUOp (line 75) | class THNNELUCPUOp final : public Operator<CPUContext> {
method RunOnDevice (line 79) | bool RunOnDevice() override {
class THNNELUCPUGradientOp (line 94) | class THNNELUCPUGradientOp final : public Operator<CPUContext> {
method RunOnDevice (line 99) | bool RunOnDevice() override {
class GetELUGradient (line 121) | class GetELUGradient : public GradientMakerBase {
method GetGradientDefs (line 123) | vector<OperatorDef> GetGradientDefs() override {
FILE: caffe2/contrib/torch/th_ops_test.py
class THOpsTest (line 41) | class THOpsTest(hu.HypothesisTestCase):
method test_elu (line 46) | def test_elu(self, X, alpha, in_place, gc, dc):
FILE: caffe2/contrib/torch/torch_op.cpp
type caffe2 (line 19) | namespace caffe2 {
type torch (line 21) | namespace torch {
type GetTorchGradient (line 31) | struct GetTorchGradient : public GradientMakerBase {
method GetGradientDefs (line 33) | std::vector<OperatorDef> GetGradientDefs() override {
FILE: caffe2/contrib/torch/torch_op.h
function namespace (line 32) | namespace caffe2 {
FILE: caffe2/contrib/torch/torch_op_gpu.cpp
type caffe2 (line 26) | namespace caffe2 {
type torch (line 28) | namespace torch {
type TyTraits<CUDAContext> (line 31) | struct TyTraits<CUDAContext> {
function THCState (line 46) | THCState* cudaState(Torch<CUDAContext>* t) {
FILE: caffe2/contrib/torch/torch_ops_test.py
class TorchOpTest (line 49) | class TorchOpTest(hu.HypothesisTestCase):
method test_feed (line 53) | def test_feed(self, n, i, h):
method test_gradient (line 77) | def test_gradient(self, n, i, h, gc, dc):
method test_iterated (line 97) | def test_iterated(self, n, i, h, iters):
method test_leakage_torch (line 123) | def test_leakage_torch(self):
FILE: caffe2/contrib/warpctc/ctc_op.cpp
type caffe2 (line 21) | namespace caffe2 {
type detail (line 23) | namespace detail {
function ctcComputeInfo (line 25) | ctcComputeInfo workspaceInfo<CPUContext>(const CPUContext& /*context...
class GetCTCGradient (line 40) | class GetCTCGradient : public GradientMakerBase {
method GetGradientDefs (line 42) | vector<OperatorDef> GetGradientDefs() override {
FILE: caffe2/contrib/warpctc/ctc_op.h
function namespace (line 40) | namespace caffe2 {
FILE: caffe2/contrib/warpctc/ctc_op_gpu.cpp
type caffe2 (line 21) | namespace caffe2 {
type detail (line 23) | namespace detail {
function ctcComputeInfo (line 25) | ctcComputeInfo workspaceInfo<CUDAContext>(const CUDAContext& context) {
FILE: caffe2/contrib/warpctc/ctc_ops_test.py
function softmax (line 29) | def softmax(w):
class CTCOpsTest (line 36) | class CTCOpsTest(test_util.TestCase):
method verify_cost (line 37) | def verify_cost(self, device_option, is_test):
method test_ctc_cost_cpu (line 82) | def test_ctc_cost_cpu(self):
method test_ctc_cost_gpu (line 87) | def test_ctc_cost_gpu(self):
method test_ctc_forward_only_cpu (line 93) | def test_ctc_forward_only_cpu(self):
method test_ctc_forward_only_gpu (line 98) | def test_ctc_forward_only_gpu(self):
FILE: caffe2/core/allocator.cc
type caffe2 (line 32) | namespace caffe2 {
function NoDelete (line 34) | void NoDelete(void*) {}
function CPUAllocator (line 37) | CPUAllocator* GetCPUAllocator() {
function SetCPUAllocator (line 41) | void SetCPUAllocator(CPUAllocator* alloc) {
FILE: caffe2/core/allocator.h
function namespace (line 28) | namespace caffe2 {
FILE: caffe2/core/blob.h
function namespace (line 32) | namespace caffe2 {
FILE: caffe2/core/blob_gpu_test.cc
type caffe2 (line 25) | namespace caffe2 {
class TensorGPUTest (line 28) | class TensorGPUTest : public ::testing::Test {}
class TensorGPUDeathTest (line 29) | class TensorGPUDeathTest : public ::testing::Test {}
function TYPED_TEST (line 34) | TYPED_TEST(TensorGPUTest, TensorInitializedEmpty) {
function TYPED_TEST (line 51) | TYPED_TEST(TensorGPUTest, TensorInitializedNonEmpty) {
function TYPED_TEST (line 78) | TYPED_TEST(TensorGPUTest, TensorShareData) {
function TYPED_TEST (line 93) | TYPED_TEST(TensorGPUTest, TensorShareDataCanUseDifferentShapes) {
function TYPED_TEST (line 112) | TYPED_TEST(TensorGPUTest, NoLongerSharesAfterResize) {
function TYPED_TEST (line 131) | TYPED_TEST(TensorGPUDeathTest, CannotAccessDataWhenEmpty) {
function TEST (line 189) | TEST(TensorTest, TensorSerializationMultiDevices) {
FILE: caffe2/core/blob_serialization.cc
type caffe2 (line 40) | namespace caffe2 {
class StringSerializer (line 47) | class StringSerializer : public BlobSerializerBase {
method StringSerializer (line 49) | StringSerializer() {}
method Serialize (line 55) | void Serialize(
class StringDeserializer (line 73) | class StringDeserializer : public BlobDeserializerBase {
method Deserialize (line 75) | void Deserialize(const BlobProto& proto, Blob* blob) override {
FILE: caffe2/core/blob_serialization.h
function namespace (line 36) | namespace caffe2 {
function processChunk (line 223) | auto processChunk = [&](int64_t chunkStart) {
FILE: caffe2/core/blob_serialization_gpu.cc
type caffe2 (line 21) | namespace caffe2 {
FILE: caffe2/core/blob_serializer_base.h
function namespace (line 22) | namespace caffe2 {
FILE: caffe2/core/blob_stats.cc
type caffe2 (line 19) | namespace caffe2 {
function BlobStatGetter (line 21) | const BlobStatGetter* BlobStatRegistry::get(CaffeTypeId id) {
function BlobStatRegistry (line 29) | BlobStatRegistry& BlobStatRegistry::instance() {
type BlobStat (line 44) | namespace BlobStat {
function sizeBytes (line 46) | size_t sizeBytes(const Blob& blob) {
FILE: caffe2/core/blob_stats.h
function namespace (line 25) | namespace caffe2 {
FILE: caffe2/core/blob_test.cc
type caffe2 (line 41) | namespace caffe2 {
class BlobTestFoo (line 44) | class BlobTestFoo {
class BlobTestBar (line 48) | class BlobTestBar {}
class BlobTestFooSerializer (line 54) | class BlobTestFooSerializer : public BlobSerializerBase {
method BlobTestFooSerializer (line 56) | BlobTestFooSerializer() {}
method Serialize (line 62) | void Serialize(
class BlobTestFooDeserializer (line 79) | class BlobTestFooDeserializer : public BlobDeserializerBase {
method Deserialize (line 81) | void Deserialize(const BlobProto& proto, Blob* blob) override {
function TEST (line 92) | TEST(BlobTest, Blob) {
function TEST (line 104) | TEST(BlobTest, BlobNewObjectFlag) {
function TEST (line 120) | TEST(BlobTest, BlobUninitialized) {
function TEST (line 125) | TEST(BlobTest, BlobWrongType) {
function TEST (line 135) | TEST(BlobTest, BlobReset) {
function TEST (line 143) | TEST(BlobTest, BlobMove) {
function TEST (line 156) | TEST(BlobTest, BlobShareExternalPointer) {
function TEST (line 165) | TEST(BlobTest, BlobShareExternalObject) {
function TEST (line 174) | TEST(BlobTest, StringSerialization) {
function TEST (line 188) | TEST(TensorNonTypedTest, TensorChangeType) {
class TensorCPUTest (line 222) | class TensorCPUTest : public ::testing::Test {}
class TensorCPUDeathTest (line 223) | class TensorCPUDeathTest : public ::testing::Test {}
function TYPED_TEST (line 228) | TYPED_TEST(TensorCPUTest, TensorInitializedEmpty) {
function TYPED_TEST (line 245) | TYPED_TEST(TensorCPUTest, TensorInitializedNonEmpty) {
function TYPED_TEST (line 271) | TYPED_TEST(TensorCPUTest, TensorInitializedZeroDim) {
function TYPED_TEST (line 285) | TYPED_TEST(TensorCPUTest, TensorResizeZeroDim) {
function TYPED_TEST (line 312) | TYPED_TEST(TensorCPUTest, TensorInitializedScalar) {
function TYPED_TEST (line 321) | TYPED_TEST(TensorCPUTest, TensorShareData) {
function TYPED_TEST (line 340) | TYPED_TEST(TensorCPUTest, TensorShareDataRawPointer) {
function TYPED_TEST (line 357) | TYPED_TEST(TensorCPUTest, TensorShareDataRawPointerWithMeta) {
function TYPED_TEST (line 375) | TYPED_TEST(TensorCPUTest, CannotShareDataWhenShapeNotSet) {
function TYPED_TEST (line 381) | TYPED_TEST(TensorCPUTest, TensorShareDataCanUseDifferentShapes) {
function TYPED_TEST (line 405) | TYPED_TEST(TensorCPUTest, NoLongerSharesAfterResize) {
function TYPED_TEST (line 423) | TYPED_TEST(TensorCPUTest, NoLongerSharesAfterFreeMemory) {
function TYPED_TEST (line 440) | TYPED_TEST(TensorCPUTest, KeepOnShrink) {
function TYPED_TEST (line 471) | TYPED_TEST(TensorCPUTest, MaxKeepOnShrink) {
function TYPED_TEST (line 497) | TYPED_TEST(TensorCPUDeathTest, CannotAccessRawDataWhenEmpty) {
function TYPED_TEST (line 503) | TYPED_TEST(TensorCPUDeathTest, CannotAccessDataWhenEmpty) {
function TEST (line 509) | TEST(TensorTest, TensorNonFundamentalType) {
function TEST (line 518) | TEST(TensorTest, TensorNonFundamentalTypeCopy) {
function TEST (line 533) | TEST(TensorTest, Tensor64BitDimension) {
function TEST (line 566) | TEST(TensorDeathTest, CannotCastDownLargeDims) {
function TEST (line 645) | TEST(TensorTest, TensorSerialization_CustomType) {
function TEST (line 671) | TEST(TensorTest, float16) {
function TEST (line 711) | TEST(QTensorTest, QTensorSerialization) {
class VectorCursor (line 756) | class VectorCursor : public db::Cursor {
method VectorCursor (line 758) | explicit VectorCursor(StringMap* data) : data_(data) {
method Seek (line 762) | void Seek(const string& /* unused */) override {}
method SeekToFirst (line 763) | void SeekToFirst() override {}
method Next (line 764) | void Next() override {
method string (line 767) | string key() override {
method string (line 770) | string value() override {
method Valid (line 773) | bool Valid() override {
class VectorDB (line 782) | class VectorDB : public db::DB {
method VectorDB (line 784) | VectorDB(const string& source, db::Mode mode)
method Close (line 789) | void Close() override {}
method NewCursor (line 790) | std::unique_ptr<db::Cursor> NewCursor() override {
method NewTransaction (line 793) | std::unique_ptr<db::Transaction> NewTransaction() override {
method registerData (line 796) | static void registerData(const string& name, StringMap&& data) {
method StringMap (line 802) | StringMap* getData() {
class TypedTensorTest (line 820) | class TypedTensorTest : public ::testing::Test {}
function TYPED_TEST (line 826) | TYPED_TEST(TypedTensorTest, BigTensorSerialization) {
type DummyType (line 893) | struct DummyType {
method DummyType (line 898) | DummyType(int n_chunks_init = 0) : n_chunks(n_chunks_init) {}
method serialize (line 899) | std::string serialize(const std::string& name, const int32_t chunk_i...
method deserialize (line 909) | void deserialize(const BlobProto& /* unused */) {
class DummyTypeSerializer (line 915) | class DummyTypeSerializer : public BlobSerializerBase {
method DummyTypeSerializer (line 917) | DummyTypeSerializer() {}
method Serialize (line 919) | void Serialize(
class DummyTypeDeserializer (line 932) | class DummyTypeDeserializer : public BlobDeserializerBase {
method Deserialize (line 934) | void Deserialize(const BlobProto& proto, Blob* blob) override {
function TEST (line 950) | TEST(ContentChunks, Serialization) {
function TEST (line 1000) | TEST(CustomChunkSize, BigTensorSerialization) {
function TEST (line 1030) | TEST(QTensor, QTensorSizingTest) {
function TEST (line 1041) | TEST(BlobTest, CastingMessage) {
FILE: caffe2/core/common.cc
type caffe2 (line 21) | namespace caffe2 {
function HasCudaRuntime (line 28) | bool HasCudaRuntime() {
type internal (line 32) | namespace internal {
function SetCudaRuntimeFlag (line 33) | void SetCudaRuntimeFlag() {
FILE: caffe2/core/common.h
function namespace (line 44) | namespace caffe2 {
FILE: caffe2/core/common_cudnn.cc
type caffe2 (line 22) | namespace caffe2 {
function PrintCuDNNInfo (line 33) | bool PrintCuDNNInfo(int*, char***) {
FILE: caffe2/core/common_cudnn.h
function namespace (line 44) | namespace caffe2 {
FILE: caffe2/core/common_gpu.cc
type caffe2 (line 40) | namespace caffe2 {
function NumCudaDevices (line 42) | int NumCudaDevices() {
function SetDefaultGPUID (line 111) | void SetDefaultGPUID(const int deviceid) {
function GetDefaultGPUID (line 123) | int GetDefaultGPUID() { return gDefaultGPUID; }
function CaffeCudaGetDevice (line 125) | int CaffeCudaGetDevice() {
function CaffeCudaSetDevice (line 138) | void CaffeCudaSetDevice(const int id) {
function GetGPUIDForPointer (line 149) | int GetGPUIDForPointer(const void* ptr) {
type CudaDevicePropWrapper (line 172) | struct CudaDevicePropWrapper {
method CudaDevicePropWrapper (line 173) | CudaDevicePropWrapper() : props(NumCudaDevices()) {
function cudaDeviceProp (line 182) | const cudaDeviceProp& GetDeviceProperty(const int deviceid) {
function DeviceQuery (line 199) | void DeviceQuery(const int device) {
function GetCudaPeerAccessPattern (line 234) | bool GetCudaPeerAccessPattern(vector<vector<bool> >* pattern) {
function TensorCoreAvailable (line 254) | bool TensorCoreAvailable() {
class CudaRuntimeFlagFlipper (line 333) | class CudaRuntimeFlagFlipper {
method CudaRuntimeFlagFlipper (line 335) | CudaRuntimeFlagFlipper() {
FILE: caffe2/core/common_gpu.h
function namespace (line 82) | namespace caffe2 {
FILE: caffe2/core/common_test.cc
type caffe2 (line 25) | namespace caffe2 {
function TEST (line 32) | TEST(CommonTest, TestStoi) {
function TEST (line 40) | TEST(CommonTest, TestStod) {
FILE: caffe2/core/context.cc
type caffe2 (line 24) | namespace caffe2 {
function RandomNumberSeed (line 26) | uint32_t RandomNumberSeed() {
FILE: caffe2/core/context.h
function namespace (line 33) | namespace caffe2 {
FILE: caffe2/core/context_gpu.h
function namespace (line 32) | namespace caffe2 {
function CPUAllocator (line 302) | struct PinnedCPUAllocator final : CPUAllocator {
type Tensor (line 352) | typedef Tensor<CUDAContext> TensorCUDA;
FILE: caffe2/core/context_gpu_test.cc
type caffe2 (line 29) | namespace caffe2 {
function shared_from_new (line 32) | std::shared_ptr<void> shared_from_new(std::pair<void*, MemoryDeleter>&...
function TEST (line 37) | TEST(CUDATest, HasCudaRuntime) {
function TEST (line 41) | TEST(CUDAContextTest, TestAllocDealloc) {
function TEST (line 49) | TEST(CUDAContextTest, TestSetGetDeviceWithoutCaffeMode) {
function TEST (line 61) | TEST(CUDAContextTest, TestSetGetDeviceWithCaffeMode) {
function TEST (line 75) | TEST(CUDAContextTest, MemoryPoolAllocateDealloc) {
function cudaStream_t (line 104) | cudaStream_t getStreamForHandle(cublasHandle_t handle) {
function TEST (line 111) | TEST(CUDAContextTest, TestSameThreadSameObject) {
function TEST (line 123) | TEST(CUDAContextTest, TestSameThreadDifferntObjectIfDifferentDevices) {
function TEST_GetStreamAddress (line 139) | void TEST_GetStreamAddress(cudaStream_t* ptr) {
function TEST (line 147) | TEST(CUDAContextTest, TestDifferntThreadDifferentobject) {
FILE: caffe2/core/context_test.cc
type caffe2 (line 23) | namespace caffe2 {
function TEST (line 25) | TEST(CPUContextTest, TestAllocAlignment) {
function TEST (line 33) | TEST(CPUContextTest, TestAllocDealloc) {
FILE: caffe2/core/cudnn_wrappers.h
function reset (line 35) | void reset() {
function nbytes_ (line 42) | size_t nbytes_{0}
function class (line 49) | class CuDNNState {
function cudaEvent_t (line 87) | cudaEvent_t before_{nullptr};
FILE: caffe2/core/db.cc
type caffe2 (line 24) | namespace caffe2 {
type db (line 29) | namespace db {
class MiniDBCursor (line 38) | class MiniDBCursor : public Cursor {
method MiniDBCursor (line 40) | explicit MiniDBCursor(FILE* f, std::mutex* mutex)
method Seek (line 47) | void Seek(const string& /*key*/) override {
method SeekToFirst (line 51) | void SeekToFirst() override {
method Next (line 59) | void Next() override {
method string (line 86) | string key() override {
method string (line 91) | string value() override {
method Valid (line 96) | bool Valid() override { return valid_; }
class MiniDBTransaction (line 108) | class MiniDBTransaction : public Transaction {
method MiniDBTransaction (line 110) | explicit MiniDBTransaction(FILE* f, std::mutex* mutex)
method Put (line 116) | void Put(const string& key, const string& value) override {
method Commit (line 127) | void Commit() override {
class MiniDB (line 141) | class MiniDB : public DB {
method MiniDB (line 143) | MiniDB(const string& source, Mode mode) : DB(source, mode), file_(...
method Close (line 161) | void Close() override {
method NewCursor (line 168) | unique_ptr<Cursor> NewCursor() override {
method NewTransaction (line 173) | unique_ptr<Transaction> NewTransaction() override {
FILE: caffe2/core/db.h
function namespace (line 26) | namespace caffe2 {
function Cursor (line 270) | inline Cursor* cursor() const {
function class (line 307) | class DBReaderSerializer : public BlobSerializerBase {
function class (line 319) | class DBReaderDeserializer : public BlobDeserializerBase {
FILE: caffe2/core/event.cc
type caffe2 (line 19) | namespace caffe2 {
function EventCreateCPU (line 38) | void EventCreateCPU(const DeviceOption& option, Event* event) {
function EventRecordCPU (line 42) | void EventRecordCPU(
function EventFinishCPU (line 71) | void EventFinishCPU(const Event* event) {
function EventWaitCPUCPU (line 80) | void EventWaitCPUCPU(const Event* event, void* /* context */) {
function EventStatus (line 84) | EventStatus EventQueryCPU(const Event* event) {
function EventSetFinishedCPU (line 100) | void EventSetFinishedCPU(const Event* event, const char* err_msg) {
function EventResetCPU (line 118) | void EventResetCPU(Event* event) {
FILE: caffe2/core/event.h
function namespace (line 24) | namespace caffe2 {
function explicit (line 209) | explicit EventCreateFunctionRegisterer(EventCreateFunction f) {
function explicit (line 221) | explicit EventRecordFunctionRegisterer(EventRecordFunction f) {
function explicit (line 233) | explicit EventWaitFunctionRegisterer(EventWaitFunction f) {
function explicit (line 246) | explicit EventQueryFunctionRegisterer(EventQueryFunction f) {
function explicit (line 258) | explicit EventErrorMessageFunctionRegisterer(EventErrorMessageFunction f) {
function explicit (line 270) | explicit EventSetFinishedFunctionRegisterer(EventSetFinishedFunction f) {
function explicit (line 282) | explicit EventFinishFunctionRegisterer(EventFinishFunction f) {
function explicit (line 294) | explicit EventResetFunctionRegisterer(EventResetFunction f) {
FILE: caffe2/core/event_cpu.h
function namespace (line 22) | namespace caffe2 {
FILE: caffe2/core/event_gpu.cc
type caffe2 (line 23) | namespace caffe2 {
type CudaEventWrapper (line 25) | struct CudaEventWrapper {
method CudaEventWrapper (line 26) | explicit CudaEventWrapper(const DeviceOption& option)
function EventCreateCUDA (line 54) | void EventCreateCUDA(const DeviceOption& option, Event* event) {
function EventRecordCUDA (line 58) | void EventRecordCUDA(Event* event, const void* context, const char* er...
function EventFinishCUDA (line 104) | void EventFinishCUDA(const Event* event) {
function EventWaitCUDACUDA (line 130) | void EventWaitCUDACUDA(const Event* event, void* context) {
function EventWaitCPUCUDA (line 153) | void EventWaitCPUCUDA(const Event* event, void* context) {
function EventWaitCUDACPU (line 158) | void EventWaitCUDACPU(const Event* event, void* context) {
function EventStatus (line 162) | EventStatus EventQueryCUDA(const Event* event) {
function EventSetFinishedCUDA (line 189) | void EventSetFinishedCUDA(const Event* event, const char* err_msg) {
function EventResetCUDA (line 209) | void EventResetCUDA(Event* event) {
FILE: caffe2/core/event_gpu_test.cc
type caffe2 (line 22) | namespace caffe2 {
function TEST (line 24) | TEST(EventCUDATest, EventBasics) {
FILE: caffe2/core/event_test.cc
type caffe2 (line 21) | namespace caffe2 {
function TEST (line 23) | TEST(EventCPUTest, EventBasics) {
FILE: caffe2/core/flags.cc
type caffe2 (line 24) | namespace caffe2 {
function SetUsageMessage (line 28) | void SetUsageMessage(const string& str) {
function ParseCaffeCommandLineFlags (line 40) | bool ParseCaffeCommandLineFlags(int* pargc, char*** pargv) {
function CommandLineFlagsHasBeenParsed (line 45) | bool CommandLineFlagsHasBeenParsed() {
function SetUsageMessage (line 68) | void SetUsageMessage(const string& str) { gUsageMessage = str; }
function ParseCaffeCommandLineFlags (line 71) | bool ParseCaffeCommandLineFlags(int* pargc, char*** pargv) {
function CommandLineFlagsHasBeenParsed (line 155) | bool CommandLineFlagsHasBeenParsed() {
FILE: caffe2/core/flags.h
function namespace (line 41) | namespace caffe2 {
function namespace (line 115) | namespace caffe2 {
FILE: caffe2/core/graph.cc
type caffe2 (line 24) | namespace caffe2 {
type transform (line 26) | namespace transform {
function NetDef (line 117) | NetDef Graph::GetNetDef() {
function OperatorDef (line 211) | OperatorDef* AddOp(
function MatchStrings (line 230) | bool MatchStrings(string p, string s) {
function MatchArguments (line 244) | bool MatchArguments(const OperatorDef& p_op, const OperatorDef& g_op) {
FILE: caffe2/core/graph.h
function namespace (line 28) | namespace caffe2 {
FILE: caffe2/core/graph_test.cc
type caffe2 (line 23) | namespace caffe2 {
class GraphDummyOp (line 31) | class GraphDummyOp final : public OperatorBase {
method Run (line 34) | bool Run(int /* unused */) override {
function compare_netdefs (line 62) | void compare_netdefs(const NetDef& net_a, const NetDef& net_b) {
function TEST (line 77) | TEST(GraphTest, TestGenerateGraphChain) {
function TEST (line 101) | TEST(GraphTest, TestGenerateGraphChainInPlace) {
function TEST (line 126) | TEST(GraphTest, TestGenerateGraphBranch) {
function TEST (line 153) | TEST(GraphTest, TestReusedInputs) {
function TEST (line 188) | TEST(GraphTest, TestGetPerimeter) {
FILE: caffe2/core/init.cc
type caffe2 (line 25) | namespace caffe2 {
type internal (line 27) | namespace internal {
function Caffe2InitializeRegistry (line 28) | Caffe2InitializeRegistry* Caffe2InitializeRegistry::Registry() {
function GlobalInit (line 34) | bool GlobalInit(int* pargc, char*** pargv) {
FILE: caffe2/core/init.h
function namespace (line 24) | namespace caffe2 {
function class (line 75) | class InitRegisterer {
FILE: caffe2/core/init_intrinsics_check.cc
type caffe2 (line 30) | namespace caffe2 {
function QuitIfFeatureUnsupported (line 32) | static void QuitIfFeatureUnsupported(
function WarnIfFeatureUnused (line 50) | static void WarnIfFeatureUnused(
function Caffe2CheckIntrinsicsFeatures (line 68) | bool Caffe2CheckIntrinsicsFeatures(int*, char***) {
FILE: caffe2/core/init_omp.cc
type caffe2 (line 42) | namespace caffe2 {
function Caffe2SetOpenMPThreads (line 45) | bool Caffe2SetOpenMPThreads(int*, char***) {
function Caffe2SetMKLThreads (line 66) | bool Caffe2SetMKLThreads(int*, char***) {
FILE: caffe2/core/init_test.cc
type caffe2 (line 23) | namespace caffe2 {
function TestInitFunction (line 27) | bool TestInitFunction(int*, char***) {
function TEST (line 41) | TEST(InitTest, TestInitFunctionHasRun) {
function TEST (line 46) | TEST(InitTest, CanRerunGlobalInit) {
FILE: caffe2/core/logging.cc
type caffe2 (line 30) | namespace caffe2 {
function StripBasename (line 31) | std::string StripBasename(const std::string &full_path) {
function ReplaceAll (line 41) | size_t ReplaceAll(string& s, const char* from, const char* to) {
function SetStackTraceFetcher (line 58) | void SetStackTraceFetcher(std::function<string(void)> fetcher) {
function SetOperatorLogger (line 65) | void SetOperatorLogger(std::function<void(const OperatorDef&)> tracer) {
function GetOperatorLogger (line 69) | std::function<void(const OperatorDef&)> GetOperatorLogger() {
function string (line 102) | string EnforceNotMet::msg() const {
function InitCaffeLogging (line 151) | bool InitCaffeLogging(int* argc, char** argv) {
function ShowLogInfoToStderr (line 178) | void ShowLogInfoToStderr() {
function InitCaffeLogging (line 194) | bool InitCaffeLogging(int* argc, char** argv) {
function ShowLogInfoToStderr (line 212) | void ShowLogInfoToStderr() {
type google (line 143) | namespace google {
type glog_internal_namespace_ (line 144) | namespace glog_internal_namespace_ {
type caffe2 (line 150) | namespace caffe2 {
function StripBasename (line 31) | std::string StripBasename(const std::string &full_path) {
function ReplaceAll (line 41) | size_t ReplaceAll(string& s, const char* from, const char* to) {
function SetStackTraceFetcher (line 58) | void SetStackTraceFetcher(std::function<string(void)> fetcher) {
function SetOperatorLogger (line 65) | void SetOperatorLogger(std::function<void(const OperatorDef&)> tracer) {
function GetOperatorLogger (line 69) | std::function<void(const OperatorDef&)> GetOperatorLogger() {
function string (line 102) | string EnforceNotMet::msg() const {
function InitCaffeLogging (line 151) | bool InitCaffeLogging(int* argc, char** argv) {
function ShowLogInfoToStderr (line 178) | void ShowLogInfoToStderr() {
function InitCaffeLogging (line 194) | bool InitCaffeLogging(int* argc, char** argv) {
function ShowLogInfoToStderr (line 212) | void ShowLogInfoToStderr() {
type caffe2 (line 193) | namespace caffe2 {
function StripBasename (line 31) | std::string StripBasename(const std::string &full_path) {
function ReplaceAll (line 41) | size_t ReplaceAll(string& s, const char* from, const char* to) {
function SetStackTraceFetcher (line 58) | void SetStackTraceFetcher(std::function<string(void)> fetcher) {
function SetOperatorLogger (line 65) | void SetOperatorLogger(std::function<void(const OperatorDef&)> tracer) {
function GetOperatorLogger (line 69) | std::function<void(const OperatorDef&)> GetOperatorLogger() {
function string (line 102) | string EnforceNotMet::msg() const {
function InitCaffeLogging (line 151) | bool InitCaffeLogging(int* argc, char** argv) {
function ShowLogInfoToStderr (line 178) | void ShowLogInfoToStderr() {
function InitCaffeLogging (line 194) | bool InitCaffeLogging(int* argc, char** argv) {
function ShowLogInfoToStderr (line 212) | void ShowLogInfoToStderr() {
FILE: caffe2/core/logging.h
function IsUsingGoogleLogging (line 52) | constexpr bool IsUsingGoogleLogging() {
function MakeStringInternal (line 70) | inline void MakeStringInternal(std::stringstream& /*ss*/) {}
function MakeStringInternal (line 73) | void MakeStringInternal(std::stringstream& ss, const T& t) {
function MakeStringInternal (line 78) | void
function string (line 93) | inline string MakeString(const string& str) {
function string (line 96) | inline string MakeString(const char* c_str) {
function string (line 101) | string Join(const string& delimiter, const Container& v) {
function namespace (line 194) | namespace enforce_detail {
FILE: caffe2/core/logging_is_not_google_glog.h
function namespace (line 45) | namespace caffe2 {
function class (line 65) | class LoggerVoidify {
function namespace (line 185) | namespace caffe2 {
FILE: caffe2/core/logging_test.cc
type caffe2 (line 22) | namespace caffe2 {
function TEST (line 24) | TEST(LoggingTest, TestEnforceTrue) {
function TEST (line 29) | TEST(LoggingTest, TestEnforceFalse) {
function TEST (line 41) | TEST(LoggingTest, TestEnforceEquals) {
function TEST (line 58) | TEST(LoggingTest, EnforceShowcase) {
function TEST (line 83) | TEST(LoggingTest, Join) {
function TEST (line 93) | TEST(LoggingDeathTest, TestEnforceUsingFatal) {
FILE: caffe2/core/memonger.cc
type caffe2 (line 25) | namespace caffe2 {
type memonger (line 26) | namespace memonger {
function NetDef (line 28) | NetDef optimize_inference_net(
class ComputeBlobRecyclingForDag (line 143) | class ComputeBlobRecyclingForDag {
method ComputeBlobRecyclingForDag (line 145) | explicit ComputeBlobRecyclingForDag(const int size)
method NetDef (line 150) | NetDef OptimizeNet(
method NetDef (line 264) | NetDef apply_assignments(const NetDef& net) {
method apply_recurrent_blob_assignments (line 289) | void apply_recurrent_blob_assignments(OperatorDef* op) {
method has_key (line 334) | inline bool has_key(const std::unordered_map<K, V>& in_map, const ...
method has_key (line 339) | inline bool has_key(const std::unordered_set<K>& in_set, const K& ...
method process_op (line 343) | void process_op(
method infer_blob_size (line 468) | inline int infer_blob_size(
method string (line 482) | inline string get_blob_or_mapped_blob(const string& blob_name) {
method can_use_blob (line 492) | inline bool can_use_blob(
method string (line 510) | inline string get_free_blob(
function NetDef (line 590) | NetDef compute_blob_recycling_for_dag(
FILE: caffe2/core/memonger.h
function namespace (line 26) | namespace caffe2 {
FILE: caffe2/core/module.cc
type caffe2 (line 24) | namespace caffe2 {
function CurrentModuleHandles (line 38) | static CaffeMap<string, void*> CurrentModuleHandles() {
function HasModule (line 53) | bool HasModule(const string& name) {
function LoadModule (line 60) | void LoadModule(const string& name, const string& filename) {
function LoadModule (line 68) | void LoadModule(const string& name, const string& filename) {
FILE: caffe2/core/module.h
function namespace (line 35) | namespace caffe2 {
FILE: caffe2/core/module_test.cc
type caffe2 (line 29) | namespace caffe2 {
class Caffe2ModuleTestStaticDummyOp (line 31) | class Caffe2ModuleTestStaticDummyOp : public OperatorBase {
method Run (line 34) | bool Run(int /* unused */ /*stream_id*/) override {
method string (line 37) | virtual string type() {
function TEST (line 46) | TEST(ModuleTest, StaticModule) {
function TEST (line 68) | TEST(ModuleTest, DynamicModule) {
FILE: caffe2/core/net.cc
type caffe2 (line 29) | namespace caffe2 {
function SetGlobalNetObserverCreator (line 112) | void SetGlobalNetObserverCreator(NetObserverCreator creator) {
function CreateNet (line 117) | unique_ptr<NetBase> CreateNet(const NetDef& net_def, Workspace* ws) {
function CreateNet (line 122) | unique_ptr<NetBase> CreateNet(
FILE: caffe2/core/net.h
function namespace (line 39) | namespace caffe2 {
function virtual (line 93) | virtual vector<float> TEST_Benchmark(
function virtual (line 114) | virtual vector<OperatorBase*> GetOperators() const = 0;
FILE: caffe2/core/net_async_base.cc
type caffe2 (line 54) | namespace caffe2 {
function Event (line 182) | Event& AsyncNetBase::event(int task_id) const {
function EventStatus (line 188) | EventStatus AsyncNetBase::query(int task_id) const {
function CAFFE_DEFINE_SHARED_REGISTRY (line 257) | CAFFE_DEFINE_SHARED_REGISTRY(
function GetAsyncNetCPUThreadPool (line 276) | std::shared_ptr<TaskThreadPool> GetAsyncNetCPUThreadPool(int numa_node...
FILE: caffe2/core/net_async_base.h
function namespace (line 31) | namespace caffe2 {
FILE: caffe2/core/net_async_dag_gpu.cc
type caffe2 (line 51) | namespace caffe2 {
class ProfiledRange (line 64) | class ProfiledRange {
method ProfiledRange (line 66) | ProfiledRange(const OperatorDef& def, Color color) {
method ProfiledRange (line 97) | ProfiledRange(const OperatorDef& def, Color color) {}
class ProfiledRange (line 95) | class ProfiledRange {
method ProfiledRange (line 66) | ProfiledRange(const OperatorDef& def, Color color) {
method ProfiledRange (line 97) | ProfiledRange(const OperatorDef& def, Color color) {}
FILE: caffe2/core/net_async_dag_gpu.h
function namespace (line 25) | namespace caffe2 {
FILE: caffe2/core/net_async_gpu_thread_pool.h
function namespace (line 22) | namespace caffe2 {
FILE: caffe2/core/net_async_gpu_thread_pool_gpu.cc
type caffe2 (line 23) | namespace caffe2 {
function AsyncNetGPUThreadPoolCreator (line 26) | std::shared_ptr<TaskThreadPool> AsyncNetGPUThreadPoolCreator(
function GetAsyncNetGPUThreadPool (line 38) | std::shared_ptr<TaskThreadPool> GetAsyncNetGPUThreadPool(int gpu_id) {
FILE: caffe2/core/net_async_polling.cc
type caffe2 (line 24) | namespace caffe2 {
FILE: caffe2/core/net_async_polling.h
function namespace (line 22) | namespace caffe2 {
FILE: caffe2/core/net_async_scheduling.cc
type caffe2 (line 24) | namespace caffe2 {
FILE: caffe2/core/net_async_scheduling.h
function namespace (line 22) | namespace caffe2 {
FILE: caffe2/core/net_dag.cc
type caffe2 (line 40) | namespace caffe2 {
FILE: caffe2/core/net_dag.h
function namespace (line 42) | namespace caffe2 {
FILE: caffe2/core/net_dag_utils.cc
type caffe2 (line 30) | namespace caffe2 {
type dag_utils (line 31) | namespace dag_utils {
function prune (line 34) | void prune(int node_idx, std::vector<OpGraphNode>& nodes) {
function pruneOpNodeGraph (line 95) | std::vector<OpGraphNode> pruneOpNodeGraph(
function updateOperatorNodes (line 123) | void updateOperatorNodes(
function ExecutionChains (line 138) | ExecutionChains computeChains(std::vector<OperatorNode>& orig_nodes) {
function ExecutionChains (line 296) | ExecutionChains singleChains(std::vector<OperatorNode>& nodes) {
function prepareOperatorNodes (line 305) | std::vector<OperatorNode> prepareOperatorNodes(
function prepareChainGraphNodes (line 397) | std::vector<OpGraphNode> prepareChainGraphNodes(
FILE: caffe2/core/net_dag_utils.h
function namespace (line 41) | namespace caffe2 {
FILE: caffe2/core/net_gpu_test.cc
type caffe2 (line 27) | namespace caffe2 {
class NetTestDummyOp (line 36) | class NetTestDummyOp final : public OperatorBase {
method NetTestDummyOp (line 40) | NetTestDummyOp(const OperatorDef& operator_def, Workspace* ws)
method Run (line 44) | bool Run(int /* unused */ /*stream_id*/) override {
method HasAsyncPart (line 53) | bool HasAsyncPart() const override {
method SupportsAsyncScheduling (line 57) | bool SupportsAsyncScheduling() const override {
function testExecution (line 81) | void testExecution(std::unique_ptr<NetBase>& net, int num_ops) {
function checkChainingAndRun (line 90) | void checkChainingAndRun(
function TEST (line 112) | TEST(NetTest, DISABLED_ChainingForDifferentDevices) {
FILE: caffe2/core/net_simple.cc
type caffe2 (line 30) | namespace caffe2 {
function PairLargerThan (line 92) | bool PairLargerThan(const std::pair<A, B>& x, const std::pair<A, B>& y) {
FILE: caffe2/core/net_simple.h
function namespace (line 30) | namespace caffe2 {
FILE: caffe2/core/net_simple_async.cc
type caffe2 (line 30) | namespace caffe2 {
FILE: caffe2/core/net_simple_async.h
function namespace (line 30) | namespace caffe2 {
FILE: caffe2/core/net_singlethread_async_gpu.cc
type caffe2 (line 30) | namespace caffe2 {
type gpu_single_thread (line 32) | namespace gpu_single_thread {
type Task (line 34) | struct Task {
class GPUExecutor (line 42) | class GPUExecutor {
method GPUExecutor (line 44) | explicit GPUExecutor(int gpu_id) : gpu_id_(gpu_id) {}
method RunJob (line 51) | void RunJob(Task* task) {
method start (line 55) | void start() {
class SingleThreadAsyncNet (line 168) | class SingleThreadAsyncNet : public SimpleNet {
method Run (line 181) | bool Run() override {
method initialize (line 206) | void initialize() {
FILE: caffe2/core/net_test.cc
type caffe2 (line 26) | namespace caffe2 {
class NetTestDummyOp (line 35) | class NetTestDummyOp final : public OperatorBase {
method NetTestDummyOp (line 39) | NetTestDummyOp(const OperatorDef& operator_def, Workspace* ws)
method Run (line 43) | bool Run(int /* unused */ /*stream_id*/) override {
method HasAsyncPart (line 52) | bool HasAsyncPart() const override {
method SupportsAsyncScheduling (line 56) | bool SupportsAsyncScheduling() const override {
function CreateNetTestHelper (line 78) | unique_ptr<NetBase> CreateNetTestHelper(
function TEST (line 107) | TEST(NetTest, ConstructionNoDeclaredInputOutput) {
function TEST (line 115) | TEST(NetTest, ConstructionDeclaredInput) {
function TEST (line 123) | TEST(NetTest, ConstructionDeclaredOutput) {
function TEST (line 131) | TEST(NetTest, DeclaredInputInsufficient) {
function TEST (line 140) | TEST(NetDeathTest, DeclaredOutputNotMet) {
function testExecution (line 149) | void testExecution(std::unique_ptr<NetBase>& net, int num_ops) {
function checkChainingAndRun (line 158) | void checkChainingAndRun(
function checkNumChainsAndRun (line 180) | void checkNumChainsAndRun(const char* spec, const int expected_num_cha...
function TEST (line 206) | TEST(NetTest, ChainingForLinearModel) {
function TEST (line 225) | TEST(NetTest, ChainingForFork) {
function TEST (line 278) | TEST(NetTest, ChainingForForkJoin) {
function TEST (line 308) | TEST(NetTest, ChainingForwardBackward) {
function TEST (line 519) | TEST(NetTest, ChainingForHogwildModel) {
function TEST (line 558) | TEST(NetTest, FailingOperator) {
FILE: caffe2/core/numa.cc
type caffe2 (line 30) | namespace caffe2 {
function IsNUMAEnabled (line 33) | bool IsNUMAEnabled() {
function NUMABind (line 37) | void NUMABind(int numa_node_id) {
function GetNUMANode (line 57) | int GetNUMANode(const void* ptr) {
function GetNumNUMANodes (line 72) | int GetNumNUMANodes() {
function NUMAMove (line 81) | void NUMAMove(void* ptr, size_t size, int numa_node_id) {
function GetCurrentNUMANode (line 107) | int GetCurrentNUMANode() {
function IsNUMAEnabled (line 118) | bool IsNUMAEnabled() {
function NUMABind (line 122) | void NUMABind(int numa_node_id) {
function GetNUMANode (line 128) | int GetNUMANode(const void* ptr) {
function GetNumNUMANodes (line 133) | int GetNumNUMANodes() {
function NUMAMove (line 138) | void NUMAMove(void* ptr, size_t size, int numa_node_id) {
function GetCurrentNUMANode (line 144) | int GetCurrentNUMANode() {
FILE: caffe2/core/numa.h
function namespace (line 24) | namespace caffe2 {
FILE: caffe2/core/observer.h
function virtual (line 34) | virtual void Start() {}
function virtual (line 35) | virtual void Stop() {}
function virtual (line 37) | virtual std::unique_ptr<ObserverBase<T>> copy(T* subject) {
function virtual (line 42) | virtual std::string debugInfo() {
function virtual (line 46) | virtual ~ObserverBase() noexcept {}
function T (line 48) | T* subject() const {
FILE: caffe2/core/observer_test.cc
type caffe2 (line 28) | namespace caffe2 {
class DummyObserver (line 35) | class DummyObserver final : public ObserverBase<T> {
class ObsTestDummyOp (line 68) | class ObsTestDummyOp final : public OperatorBase {
method Run (line 71) | bool Run(int /* unused */) override {
function CreateNetTestHelper (line 86) | unique_ptr<NetBase> CreateNetTestHelper(Workspace* ws, bool isDAG = fa...
function TEST (line 110) | TEST(ObserverTest, TestNotify) {
function TEST (line 125) | TEST(ObserverTest, TestUniqueMap) {
function TEST (line 142) | TEST(ObserverTest, TestNotifyAfterDetach) {
function TEST (line 157) | TEST(ObserverTest, TestDAGNetBase) {
function TEST (line 172) | TEST(ObserverTest, TestMultipleNetBase) {
FILE: caffe2/core/operator.cc
type caffe2 (line 42) | namespace caffe2 {
function PerOpEnginePrefType (line 79) | PerOpEnginePrefType& g_per_op_engine_pref() {
function GlobalEnginePrefType (line 84) | GlobalEnginePrefType& g_global_engine_pref() {
function TryCreateOperator (line 90) | unique_ptr<OperatorBase> TryCreateOperator(
function _CreateOperator (line 111) | unique_ptr<OperatorBase> _CreateOperator(
function OpRegistryKey (line 201) | const std::string OpRegistryKey(
function SetPerOpEnginePref (line 211) | void SetPerOpEnginePref(const PerOpEnginePrefType& per_op_engine_pref) {
function SetGlobalEnginePref (line 235) | void SetGlobalEnginePref(const GlobalEnginePrefType& global_engine_pre...
function SetEnginePref (line 247) | void SetEnginePref(
function SetOpEnginePref (line 254) | void SetOpEnginePref(
function CreateOperator (line 275) | unique_ptr<OperatorBase> CreateOperator(
function GradientOpsMeta (line 319) | GradientOpsMeta GetGradientForOp(
function TensorShapes (line 373) | static TensorShapes InferBlobShapesAndTypes(
function TensorShape (line 522) | TensorShape GetTensorShapeOfBlob(const Blob* b) {
function TensorShapes (line 545) | TensorShapes InferBlobShapesAndTypesFromWorkspace(
function TensorShapes (line 559) | TensorShapes InferBlobShapesAndTypesFromMap(
function ValidateTensorDevices (line 575) | std::map<string, std::pair<DeviceOption, DeviceOption>> ValidateTensor...
function GetRegisteredOperators (line 620) | std::set<std::string> GetRegisteredOperators() {
FILE: caffe2/core/operator.h
function namespace (line 41) | namespace caffe2 {
function noexcept (line 339) | noexcept override {}
function Tensor (line 341) | inline const Tensor<Context>& Input(int idx) {
function Tensor (line 344) | inline Tensor<Context>* Output(int idx) {
function IsStreamFree (line 435) | bool IsStreamFree(int stream_id) const override {
type GenericTensorImplementation (line 555) | struct GenericTensorImplementation {}
function call (line 567) | bool call(Op* op, int value) {
function call (line 579) | bool call(Op* op, TIndex /*size*/) {
type Registry (line 657) | typedef Registry<
type Registry (line 663) | typedef Registry<
type DeviceTypeRegisterer (line 670) | struct DeviceTypeRegisterer {
function class (line 770) | class UnsupportedOperatorFeature : public std::exception {
FILE: caffe2/core/operator_gpu_test.cc
type caffe2 (line 23) | namespace caffe2 {
class JustTest (line 25) | class JustTest : public OperatorBase {
method Run (line 28) | bool Run(int /* unused */ /*stream_id*/) override {
method type (line 31) | virtual std::string type() {
class JustTestCUDA (line 36) | class JustTestCUDA : public JustTest {
method Run (line 39) | bool Run(int /* unused */ /*stream_id*/) override {
method type (line 42) | std::string type() override {
class JustTestCUDNN (line 47) | class JustTestCUDNN : public JustTest {
method Run (line 50) | bool Run(int /* unused */ /*stream_id*/) override {
method type (line 53) | std::string type() override {
function TEST (line 62) | TEST(EnginePrefTest, GPUDeviceDefaultPreferredEngines) {
FILE: caffe2/core/operator_gradient.h
function namespace (line 25) | namespace caffe2 {
type GradientOpsMeta (line 52) | struct GradientOpsMeta {
function virtual (line 101) | virtual GradientOpsMeta Get() {
function GradientMakerBase (line 288) | struct ThrowInTheTowelIfGradientIsCalled : public GradientMakerBase {
function GradientMakerBase (line 303) | struct GradientNotImplementedYet : public GradientMakerBase {
FILE: caffe2/core/operator_schema.cc
type caffe2 (line 21) | namespace caffe2 {
function OpSchema (line 109) | OpSchema& OpSchema::NumInputs(int min, int max) {
function OpSchema (line 115) | OpSchema& OpSchema::NumInputs(int n) {
function OpSchema (line 119) | OpSchema& OpSchema::NumInputs(std::function<bool(int)> func) {
function OpSchema (line 124) | OpSchema& OpSchema::NumInputs(set<int> allowed_input_nums) {
function OpSchema (line 131) | OpSchema& OpSchema::NumOutputs(int min, int max) {
function OpSchema (line 137) | OpSchema& OpSchema::NumOutputs(int n) {
function OpSchema (line 141) | OpSchema& OpSchema::NumOutputs(std::function<bool(int)> func) {
function OpSchema (line 146) | OpSchema& OpSchema::NumOutputs(set<int> allowed_output_nums) {
function OpSchema (line 153) | OpSchema& OpSchema::NumInputsOutputs(std::function<bool(int, int)> fun...
function OpSchema (line 158) | OpSchema& OpSchema::OutputCalculator(std::function<int(int)> calc) {
function OpSchema (line 163) | OpSchema& OpSchema::SameNumberOfOutput() {
function OpSchema (line 167) | OpSchema& OpSchema::AllowInplace(std::function<bool(int, int)> inplace) {
function OpSchema (line 172) | OpSchema& OpSchema::AllowInplace(set<std::pair<int, int>> inplace) {
function OpSchema (line 179) | OpSchema& OpSchema::AllowOneToOneInplace() {
function OpSchema (line 183) | OpSchema& OpSchema::EnforceInplace(std::function<bool(int, int)> inpla...
function OpSchema (line 188) | OpSchema& OpSchema::EnforceInplace(set<std::pair<int, int>> inplace) {
function OpSchema (line 195) | OpSchema& OpSchema::EnforceOneToOneInplace() {
function OpSchema (line 199) | OpSchema& OpSchema::Private() {
function OpSchema (line 204) | OpSchema& OpSchema::InputsCanCrossDevices() {
function OpSchema (line 209) | OpSchema& OpSchema::TensorInferenceFunction(
function OpSchema (line 215) | OpSchema& OpSchema::IdenticalTypeAndShape() {
function OpSchema (line 222) | OpSchema& OpSchema::IdenticalTypeAndShapeOfInput(int idx) {
function OpSchema (line 231) | OpSchema& OpSchema::IdenticalTypeAndShapeOfInputDim(int idx, int dim) {
function OpSchema (line 241) | OpSchema& OpSchema::ScalarType(::caffe2::TensorProto_DataType dt) {
function OpSchema (line 250) | OpSchema& OpSchema::CostInferenceFunction(CostInferenceFunctionType fu...
function OpSchema (line 256) | OpSchema& OpSchema::DeviceInferenceFunction(
function OpSchema (line 262) | OpSchema& OpSchema::SetDoc(const string& doc) {
function OpSchema (line 267) | OpSchema&
function OpSchema (line 283) | OpSchema& OpSchema::Input(const int n, const char* name, const char* d...
function OpSchema (line 291) | OpSchema& OpSchema::Output(const int n, const char* name, const char* ...
function OpSchema (line 299) | OpSchema& OpSchema::FillUsing(std::function<void(OpSchema&)> populator) {
FILE: caffe2/core/operator_schema.h
function namespace (line 32) | namespace caffe2 {
function TensorInferenceFunctionType (line 381) | TensorInferenceFunctionType tensor_inference_function_ =
function DeviceInferenceFunctionType (line 392) | DeviceInferenceFunctionType device_inference_function_ =
function class (line 405) | class OpSchemaRegistry {
function OpSchema (line 423) | static const OpSchema* Schema(const string& key) {
FILE: caffe2/core/operator_schema_test.cc
type caffe2 (line 24) | namespace caffe2 {
function TEST (line 32) | TEST(OperatorSchemaTest, BasicSchema) {
function TEST (line 57) | TEST(OperatorSchemaTest, SpecifiedInputOutput) {
function TEST (line 84) | TEST(OperatorSchemaTest, InputOutputRelation) {
function TEST (line 109) | TEST(OperatorSchemaTest, SameInputOutput) {
function TEST (line 134) | TEST(OperatorSchemaTest, CalculateOutput) {
function TEST (line 160) | TEST(OperatorSchemaTest, Inplace) {
function TEST (line 187) | TEST(OperatorSchemaTest, TensorInferenceIdentical) {
function TEST (line 218) | TEST(OperatorSchemaTest, TensorInferenceArbitrary) {
function TEST (line 237) | TEST(OperatorSchemaTest, TestCastSchema) {
type OpSchema::Cost (line 269) | struct OpSchema::Cost
function TEST (line 274) | TEST(OperatorSchemaTest, TestCostInference) {
FILE: caffe2/core/operator_test.cc
type caffe2 (line 23) | namespace caffe2 {
class JustTest (line 28) | class JustTest : public OperatorBase {
method Run (line 31) | bool Run(int /* unused */ /*stream_id*/) override {
method string (line 34) | virtual string type() {
class JustTestAndNeverConstructs (line 39) | class JustTestAndNeverConstructs : public JustTest {
method JustTestAndNeverConstructs (line 41) | JustTestAndNeverConstructs(const OperatorDef& def, Workspace* ws)
method Run (line 45) | bool Run(int /* unused */ /*stream_id*/) override {
method string (line 48) | string type() override {
class JustTestAndDoesConstruct (line 53) | class JustTestAndDoesConstruct : public JustTest {
method Run (line 56) | bool Run(int /* unused */ /*stream_id*/) override {
method string (line 59) | string type() override {
class JustTestWithSomeOutput (line 64) | class JustTestWithSomeOutput : public JustTest {
method Run (line 67) | bool Run(int /* unused */ /*stream_id*/) override {
method string (line 71) | string type() override {
class ThrowException (line 76) | class ThrowException : public Operator<CPUContext> {
method ThrowException (line 78) | explicit ThrowException(const OperatorDef& op_def, Workspace* ws)
method RunOnDevice (line 80) | bool RunOnDevice() override {
function TEST (line 99) | TEST(OperatorTest, DeviceTypeRegistryWorks) {
function TEST (line 103) | TEST(OperatorTest, RegistryWorks) {
function TEST (line 119) | TEST(OperatorTest, RegistryWrongDevice) {
function TEST (line 132) | TEST(OperatorTest, ExceptionWorks) {
function TEST (line 155) | TEST(OperatorTest, FallbackIfEngineDoesNotBuild) {
function TEST (line 165) | TEST(OperatorTest, MultipleEngineChoices) {
function TEST (line 175) | TEST(OperatorTest, CannotUseUninitializedBlob) {
function TEST (line 185) | TEST(OperatorTest, TestParameterAccess) {
function TEST (line 211) | TEST(OperatorTest, CannotAccessParameterWithWrongType) {
function TEST (line 226) | TEST(OperatorDeathTest, DISABLED_CannotAccessRepeatedParameterWithWron...
function TEST (line 244) | TEST(OperatorTest, TestDefaultValue) {
function TEST (line 251) | TEST(OperatorTest, TestSetUp) {
function TEST (line 264) | TEST(OperatorTest, TestSetUpInputOutputCount) {
function TEST (line 288) | TEST(OperatorTest, TestOutputValues) {
function NetDef (line 304) | NetDef GetNetDefForTest() {
function TEST (line 320) | TEST(NetTest, TestScaffoldingSimpleNet) {
function TEST (line 333) | TEST(NetTest, TestScaffoldingDAGNet) {
class GetFooGradient (line 347) | class GetFooGradient : public GradientMakerBase {
method GetGradientDefs (line 349) | vector<OperatorDef> GetGradientDefs() override {
function TEST (line 360) | TEST(OperatorGradientRegistryTest, GradientSimple) {
function TEST (line 391) | TEST(EnginePrefTest, PerOpEnginePref) {
function TEST (line 411) | TEST(EnginePrefTest, GlobalEnginePref) {
function TEST (line 438) | TEST(EnginePrefTest, GlobalEnginePrefAndPerOpEnginePref) {
function TEST (line 456) | TEST(EnginePrefTest, GlobalEnginePrefAndPerOpEnginePrefAndOpDef) {
function TEST (line 475) | TEST(EnginePrefTest, SetOpEnginePref) {
function TEST (line 493) | TEST(EnginePrefTest, SetDefaultEngine) {
class JustTestWithRequiredArg (line 511) | class JustTestWithRequiredArg : public JustTest {
method Run (line 514) | bool Run(int /* unused */ /*stream_id*/) override {
method string (line 517) | string type() override {
function TEST (line 528) | TEST(RequiredArg, Basic) {
class JustTestWithStandardIsTestArg (line 551) | class JustTestWithStandardIsTestArg : public JustTest {
method Run (line 554) | bool Run(int /* unused */ /*stream_id*/) override {
method string (line 557) | string type() override {
function TEST (line 570) | TEST(IsTestArg, standard) {
class JustTestWithNonStandardIsTestArg (line 594) | class JustTestWithNonStandardIsTestArg : public JustTest {
method Run (line 597) | bool Run(int /* unused */ /*stream_id*/) override {
method string (line 600) | string type() override {
function TEST (line 613) | TEST(IsTestArg, non_standard) {
FILE: caffe2/core/parallel_net_test.cc
type caffe2 (line 26) | namespace caffe2 {
class SleepOp (line 38) | class SleepOp final : public Operator<CPUContext> {
method SleepOp (line 40) | SleepOp(const OperatorDef& operator_def, Workspace* ws)
method RunOnDevice (line 47) | bool RunOnDevice() override {
function RunNetAndGetDuration (line 104) | int RunNetAndGetDuration(const string& net_def_str, const string& type) {
function TEST (line 123) | TEST(DAGNetTest, TestDAGNetTiming) {
function TEST (line 130) | TEST(SimpleNetTest, TestSimpleNetTiming) {
function TEST (line 172) | TEST(DAGNetTest, TestDAGNetTimingReadAfterRead) {
function TEST (line 179) | TEST(SimpleNetTest, TestSimpleNetTimingReadAfterRead) {
function TEST (line 220) | TEST(DAGNetTest, TestDAGNetTimingWriteAfterWrite) {
function TEST (line 226) | TEST(SimpleNetTest, TestSimpleNetTimingWriteAfterWrite) {
function TEST (line 268) | TEST(DAGNetTest, TestDAGNetTimingWriteAfterRead) {
function TEST (line 274) | TEST(SimpleNetTest, TestSimpleNetTimingWriteAfterRead) {
function TEST (line 318) | TEST(DAGNetTest, TestDAGNetTimingControlDependency) {
function TEST (line 324) | TEST(SimpleNetTest, TestSimpleNetTimingControlDependency) {
FILE: caffe2/core/plan_executor.cc
type caffe2 (line 36) | namespace caffe2 {
type NetDefInfo (line 40) | struct NetDefInfo {
type Reporter (line 50) | struct Reporter {
type ReporterInstance (line 51) | struct ReporterInstance {
method ReporterInstance (line 55) | ReporterInstance(int intervalMillis, bool* done, std::function<voi...
method start (line 68) | void start(int64_t intervalMillis, std::function<void()> f) {
function getContinuationTest (line 90) | std::function<bool(int64_t)> getContinuationTest(
function getShouldStop (line 118) | inline bool getShouldStop(const Blob* b) {
type WorkspaceIdInjector (line 136) | struct WorkspaceIdInjector {
method InjectWorkspaceId (line 140) | void InjectWorkspaceId(Workspace* workspace) {
type CompiledExecutionStep (line 165) | struct CompiledExecutionStep
method CompiledExecutionStep (line 256) | CompiledExecutionStep(
type ExecutionStepWrapper (line 186) | struct ExecutionStepWrapper {
method ExecutionStepWrapper (line 187) | ExecutionStepWrapper(
class CompiledGuard (line 206) | class CompiledGuard {
method reset (line 207) | void reset(std::unique_ptr<CompiledExecutionStep>&& compiled) {
method reset (line 211) | void reset(CompiledExecutionStep* compiledRef) {
method CompiledExecutionStep (line 217) | CompiledExecutionStep* operator->() {
method CompiledGuard (line 222) | CompiledGuard() {}
method ExecutionStep (line 228) | const ExecutionStep& step() {
method CompiledGuard (line 232) | CompiledGuard compiled() {
method reset (line 207) | void reset(std::unique_ptr<CompiledExecutionStep>&& compiled) {
method reset (line 211) | void reset(CompiledExecutionStep* compiledRef) {
method CompiledExecutionStep (line 217) | CompiledExecutionStep* operator->() {
method CompiledGuard (line 222) | CompiledGuard() {}
type CompiledExecutionStep (line 253) | struct CompiledExecutionStep {
method CompiledExecutionStep (line 256) | CompiledExecutionStep(
function ExecuteStepRecursive (line 372) | bool ExecuteStepRecursive(ExecutionStepWrapper& stepWrapper) {
function RunPlanOnWorkspace (line 494) | bool RunPlanOnWorkspace(
FILE: caffe2/core/plan_executor.h
function namespace (line 24) | namespace caffe2 {
FILE: caffe2/core/predictor.cc
type caffe2 (line 21) | namespace caffe2 {
function enforceIsTensor (line 25) | void enforceIsTensor(Workspace* ws, const std::string& name) {
function shareInputTensor (line 32) | void shareInputTensor(
function TensorCPU (line 44) | TensorCPU* extractOutputTensor(Workspace* ws, const std::string& name) {
function NetDef (line 51) | const NetDef& getNet(const MetaNetDef& def, const std::string& name) {
FILE: caffe2/core/predictor.h
function namespace (line 25) | namespace caffe2 {
FILE: caffe2/core/predictor_test.cc
type caffe2 (line 26) | namespace caffe2 {
function randomTensor (line 147) | std::unique_ptr<Blob> randomTensor(
function NetDef (line 158) | NetDef parseNetDef(const std::string& value) {
function MetaNetDef (line 167) | MetaNetDef parseMetaNetDef(const std::string& value) {
class PredictorTest (line 177) | class PredictorTest : public testing::Test {
method SetUp (line 179) | void SetUp() override {
function TEST_F (line 192) | TEST_F(PredictorTest, SimpleBatchSized) {
function TEST_F (line 204) | TEST_F(PredictorTest, SimpleBatchSizedMapInput) {
class PredictorMetaNetDefTest (line 217) | class PredictorMetaNetDefTest : public testing::Test {
method SetUp (line 219) | void SetUp() override {
function TEST_F (line 230) | TEST_F(PredictorMetaNetDefTest, SimpleMetaNetDefInitializer) {
FILE: caffe2/core/qtensor.cc
type caffe2 (line 19) | namespace caffe2 {
FILE: caffe2/core/qtensor.h
function namespace (line 30) | namespace caffe2 {
function SetScale (line 131) | void SetScale(const double scale) {
function SetBias (line 135) | void SetBias(const double bias) {
function dim32 (line 201) | inline int dim32(const int i) const {
function canonical_axis_index (line 219) | inline int canonical_axis_index(int axis_index) const {
function TIndex (line 231) | inline TIndex size_from_dim(int k) const {
function TIndex (line 242) | inline TIndex size_to_dim(int k) const {
FILE: caffe2/core/qtensor_serialization.cc
type caffe2 (line 19) | namespace caffe2 {
FILE: caffe2/core/qtensor_serialization.h
function namespace (line 23) | namespace caffe2 {
function Context (line 85) | Context context{}
FILE: caffe2/core/registry.h
function namespace (line 34) | namespace caffe2 {
function ObjectPtrType (line 137) | ObjectPtrType DefaultCreator(Args... args) {
FILE: caffe2/core/registry_test.cc
type caffe2 (line 24) | namespace caffe2 {
class Foo (line 27) | class Foo {
method Foo (line 29) | explicit Foo(int x) { LOG(INFO) << "Foo " << x; }
class Bar (line 37) | class Bar : public Foo {
method Bar (line 39) | explicit Bar(int x) : Foo(x) { LOG(INFO) << "Bar " << x; }
class AnotherBar (line 43) | class AnotherBar : public Foo {
method AnotherBar (line 45) | explicit AnotherBar(int x) : Foo(x) {
function TEST (line 51) | TEST(RegistryTest, CanRunCreator) {
function TEST (line 58) | TEST(RegistryTest, ReturnNullOnNonExistingCreator) {
FILE: caffe2/core/scope_guard.h
function namespace (line 30) | namespace caffe2 {
FILE: caffe2/core/stats.cc
type caffe2 (line 22) | namespace caffe2 {
function ExportedStatMap (line 24) | ExportedStatMap toMap(const ExportedStatList& stats) {
function StatValue (line 33) | StatValue* StatRegistry::add(const std::string& name) {
function StatRegistry (line 65) | StatRegistry& StatRegistry::get() {
FILE: caffe2/core/stats.h
function namespace (line 28) | namespace caffe2 {
type ExportedStatValue (line 47) | struct ExportedStatValue {
function class (line 133) | class StatRegistry {
type Stat (line 172) | struct Stat {
function class (line 183) | class ExportedStat : public Stat {
function class (line 200) | class AvgExportedStat : public ExportedStat {
function class (line 219) | class StdDevExportedStat : public ExportedStat {
FILE: caffe2/core/stats_test.cc
type caffe2 (line 24) | namespace caffe2 {
type MyCaffeClass (line 27) | struct MyCaffeClass {
method MyCaffeClass (line 28) | explicit MyCaffeClass(const std::string& name) : stats_(name) {}
method tryRun (line 30) | void tryRun(int) {}
method run (line 32) | void run(int numRuns) {
type MyStats (line 44) | struct MyStats {
function ExportedStatMap (line 53) | ExportedStatMap filterMap(
function TEST (line 67) | TEST(StatsTest, StatsTestClass) {
function TEST (line 86) | TEST(StatsTest, StatsTestDuration) {
function TEST (line 107) | TEST(StatsTest, StatsTestSimple) {
FILE: caffe2/core/tensor.cc
type caffe2 (line 33) | namespace caffe2 {
function TypeCall (line 68) | TypeCall GetTypeCallFunction(CaffeTypeId id) {
function RegisterTypeCallFunction (line 76) | void RegisterTypeCallFunction(CaffeTypeId id, TypeCall c) {
function TensorInfoCall (line 83) | TensorInfoCall GetTensorInfoFunction(CaffeTypeId id) {
function RegisterTensorInfoFunction (line 91) | void RegisterTensorInfoFunction(CaffeTypeId id, TensorInfoCall c) {
type TensorCPUStatGetter (line 97) | struct TensorCPUStatGetter : BlobStatGetter {
method sizeBytes (line 98) | size_t sizeBytes(const Blob& blob) const override {
FILE: caffe2/core/tensor.h
function namespace (line 44) | namespace caffe2 {
function Shrink (line 277) | void Shrink(TIndex outer_dim) {
function ResizeLike (line 331) | void ResizeLike(const Tensor<OtherContext>& src_tensor) {
function Reshape (line 342) | inline void Reshape(const vector<TIndex>& dims) {
function T (line 500) | const T* data() const {
function T (line 594) | T* mutable_data() {
function TIndex (line 629) | inline TIndex size_from_dim(int k) const {
function TIndex (line 633) | inline TIndex size_to_dim(int k) const {
function TIndex (line 637) | inline TIndex size_between_dim(int k, int l) const {
function canonical_axis_index (line 652) | inline int canonical_axis_index(int axis_index) const {
function dim32 (line 673) | inline int dim32(const int i) const {
function TIndex (line 687) | inline TIndex dim(const int i) const {
function SetDims (line 721) | bool SetDims() {
function SetDims (line 731) | bool SetDims(const TIndex d0) {
function SetDims (line 739) | bool SetDims(const TIndex d0, const TIndex d1) {
function SetDims (line 748) | bool SetDims(const TIndex d0, const TIndex d1, const TIndex d2) {
function SetDims (line 758) | bool
type Tensor (line 776) | typedef Tensor<CPUContext> TensorCPU;
type TypeMeta (line 781) | typedef TypeMeta (*TypeCall)(const void*);
type vector (line 792) | typedef vector<TIndex> (*TensorInfoCall)(
function class (line 814) | class TensorPrinter {
FILE: caffe2/core/timer.h
function namespace (line 24) | namespace caffe2 {
FILE: caffe2/core/timer_test.cc
type caffe2 (line 24) | namespace caffe2 {
function TEST (line 27) | TEST(TimerTest, Test) {
function TEST (line 51) | TEST(TimerTest, TestLatency) {
FILE: caffe2/core/transform.cc
type caffe2 (line 25) | namespace caffe2 {
function NetDef (line 191) | NetDef Transform::ApplyTo(const NetDef& orig_net) {
function CreateTransform (line 199) | unique_ptr<Transform> CreateTransform(string key) {
function NetDef (line 207) | NetDef ApplyTransform(const string& key, const NetDef& netdef) {
function average_net_run_duration (line 212) | double average_net_run_duration(
function NetDef (line 257) | NetDef ApplyTransformIfFaster(
FILE: caffe2/core/transform.h
function namespace (line 25) | namespace caffe2 {
FILE: caffe2/core/transform_test.cc
type caffe2 (line 23) | namespace caffe2 {
class TransformDummyOp (line 31) | class TransformDummyOp final : public OperatorBase {
method Run (line 34) | bool Run(int /* unused */) override {
class DummyTransform (line 66) | class DummyTransform : public Transform {
method PatternRule (line 69) | bool PatternRule(const Graph& g, const std::vector<int>& subgraph, i...
method ValidatorRule (line 94) | bool ValidatorRule(const Graph& g, const std::vector<int>& subgraph)
method ReplaceRule (line 107) | bool ReplaceRule(const std::vector<int>& match, Graph* g_ptr) overri...
function TEST (line 154) | TEST(TransformTest, TestPatternMatch) {
function TEST (line 175) | TEST(TransformTest, TestReplacePattern) {
function TEST (line 211) | TEST(TransformTest, TestTransformApply) {
class SortedDummyTransform (line 236) | class SortedDummyTransform : public Transform {
method SortedDummyTransform (line 238) | SortedDummyTransform() {
method PatternRule (line 241) | bool PatternRule(const Graph& g, const std::vector<int>& subgraph, i...
method ValidatorRule (line 248) | bool ValidatorRule(const Graph& g, const std::vector<int>& subgraph)
method ReplaceRule (line 258) | bool ReplaceRule(const std::vector<int>& match, Graph* g_ptr) overri...
function TEST (line 269) | TEST(TransformTest, TestPatternMatchTypeSortedOrder) {
class GeneralDummyTransform (line 293) | class GeneralDummyTransform : public Transform {
method GeneralDummyTransform (line 295) | GeneralDummyTransform() {
method PatternRule (line 298) | bool PatternRule(const Graph& g, const std::vector<int>& subgraph, i...
method ValidatorRule (line 308) | bool ValidatorRule(const Graph& g, const std::vector<int>& subgraph)
method ReplaceRule (line 318) | bool ReplaceRule(const std::vector<int>& match, Graph* g_ptr) overri...
function TEST (line 329) | TEST(TransformTest, TestPatternMatchTypeGeneral) {
class TransformSleepFastOp (line 347) | class TransformSleepFastOp final : public OperatorBase {
method Run (line 350) | bool Run(int /* unused */) override {
class TransformSleepSlowOp (line 363) | class TransformSleepSlowOp final : public OperatorBase {
method Run (line 366) | bool Run(int /* unused */) override {
class TypeSwapTransform (line 383) | class TypeSwapTransform : public Transform {
method TypeSwapTransform (line 386) | explicit TypeSwapTransform(string old_type, string new_type)
method PatternRule (line 390) | bool PatternRule(const Graph& g, const std::vector<int>& subgraph, i...
method ValidatorRule (line 398) | bool ValidatorRule(const Graph& g, const std::vector<int>& subgraph)
method ReplaceRule (line 408) | bool ReplaceRule(const std::vector<int>& match, Graph* g_ptr) overri...
class FastToSlowTransform (line 420) | class FastToSlowTransform : public TypeSwapTransform {
method FastToSlowTransform (line 422) | explicit FastToSlowTransform()
class SlowToFastTransform (line 428) | class SlowToFastTransform : public TypeSwapTransform {
method SlowToFastTransform (line 430) | explicit SlowToFastTransform()
function TEST (line 436) | TEST(TransformTest, TestApplyTransformIfFasterIsFaster) {
function TEST (line 455) | TEST(TransformTest, TestApplyTransformIfFasterButSlower) {
FILE: caffe2/core/typeid.cc
type caffe2 (line 24) | namespace caffe2 {
function string (line 42) | string Demangle(const char* name) {
function string (line 46) | string Demangle(const char* name) {
function string (line 57) | string GetExceptionString(const std::exception& e) {
type UninitializedTypeNameRegisterer (line 69) | struct UninitializedTypeNameRegisterer {
method UninitializedTypeNameRegisterer (line 70) | UninitializedTypeNameRegisterer() {
FILE: caffe2/core/typeid.h
function namespace (line 35) | namespace caffe2 {
function class (line 104) | class TypeMeta {
function m (line 188) | inline bool operator==(const TypeMeta& m) const {
function m (line 191) | inline bool operator!=(const TypeMeta& m) const {
function ItemSize (line 216) | size_t ItemSize() {
function _Ctor (line 236) | void _Ctor(void* ptr, size_t n) {
function _Copy (line 247) | void _Copy(const void* src, void* dst, size_t n) {
function _CopyNotAllowed (line 259) | void
function _Dtor (line 270) | void _Dtor(void* ptr, size_t n) {
function TypeMeta (line 293) | TypeMeta Make() {
FILE: caffe2/core/typeid_test.cc
type caffe2 (line 21) | namespace caffe2 {
class TypeMetaTestFoo (line 24) | class TypeMetaTestFoo {}
class TypeMetaTestBar (line 25) | class TypeMetaTestBar {}
function TEST (line 33) | TEST(TypeMetaTest, TypeMetaStatic) {
function TEST (line 45) | TEST(TypeMetaTest, Names) {
function TEST (line 60) | TEST(TypeMetaTest, TypeMeta) {
class ClassAllowAssignment (line 99) | class ClassAllowAssignment {
method ClassAllowAssignment (line 101) | ClassAllowAssignment() : x(42) {}
method ClassAllowAssignment (line 102) | ClassAllowAssignment(const ClassAllowAssignment& src) : x(src.x) {}
method ClassAllowAssignment (line 103) | ClassAllowAssignment& operator=(const ClassAllowAssignment& src) = d...
class ClassNoAssignment (line 107) | class ClassNoAssignment {
method ClassNoAssignment (line 109) | ClassNoAssignment() : x(42) {}
method ClassNoAssignment (line 110) | ClassNoAssignment(const ClassNoAssignment& src) = delete;
method ClassNoAssignment (line 111) | ClassNoAssignment& operator=(const ClassNoAssignment& src) = delete;
function TEST (line 121) | TEST(TypeMetaTest, CtorDtorAndCopy) {
function TEST (line 151) | TEST(TypeMetaTest, Float16IsNotUint16) {
FILE: caffe2/core/types.cc
type caffe2 (line 25) | namespace caffe2 {
function TypeMetaToDataType (line 52) | TensorProto::DataType TypeMetaToDataType(const TypeMeta& meta) {
function TypeMeta (line 77) | const TypeMeta& DataTypeToTypeMeta(const TensorProto::DataType& dt) {
FILE: caffe2/core/types.h
function namespace (line 29) | namespace caffe2 {
function namespace (line 68) | namespace caffe2 {
function namespace (line 88) | namespace std {
FILE: caffe2/core/workspace.cc
type caffe2 (line 35) | namespace caffe2 {
function Blob (line 120) | Blob* Workspace::CreateBlob(const string& name) {
function Blob (line 134) | Blob* Workspace::CreateLocalBlob(const string& name) {
function Blob (line 144) | Blob* Workspace::RenameBlob(const string& old_name, const string& new_...
function Blob (line 180) | const Blob* Workspace::GetBlob(const string& name) const {
function Blob (line 230) | Blob* Workspace::GetBlob(const string& name) {
function NetBase (line 234) | NetBase* Workspace::CreateNet(const NetDef& net_def, bool overwrite) {
function NetBase (line 239) | NetBase* Workspace::CreateNet(
function NetBase (line 271) | NetBase* Workspace::GetNet(const string& name) {
function ThreadPool (line 323) | ThreadPool* Workspace::GetThreadPool() {
FILE: caffe2/core/workspace.h
function namespace (line 39) | namespace caffe2 {
function class (line 63) | class Workspace {
function string (line 183) | const string& RootFolder() { return root_folder_; }
function HasBlob (line 187) | inline bool HasBlob(const string& name) const {
FILE: caffe2/core/workspace_test.cc
type caffe2 (line 23) | namespace caffe2 {
class WorkspaceTestFoo (line 25) | class WorkspaceTestFoo {}
function TEST (line 29) | TEST(WorkspaceTest, BlobAccess) {
function TEST (line 73) | TEST(WorkspaceTest, RunEmptyPlan) {
function TEST (line 79) | TEST(WorkspaceTest, Sharing) {
function TEST (line 111) | TEST(WorkspaceTest, BlobMapping) {
FILE: caffe2/cuda_rtc/common_rtc.h
function namespace (line 35) | namespace caffe2 {
function std (line 121) | inline std::string GetUniqueName() {
FILE: caffe2/cuda_rtc/elemenntwise_rtc_gpu.cc
type caffe2 (line 22) | namespace caffe2 {
class ElementwiseRTCFunction (line 24) | class ElementwiseRTCFunction
method ElementwiseRTCFunction (line 27) | ElementwiseRTCFunction() : CudaRTCFunction(), name_(GetUniqueName()) {}
method string (line 30) | string KernelName(Args... /*args*/) {
function string (line 42) | string ElementwiseRTCFunction::GetSource(
class ElementwiseRTCOp (line 90) | class ElementwiseRTCOp final : public Operator<CUDAContext> {
method ElementwiseRTCOp (line 92) | ElementwiseRTCOp(const OperatorDef& operator_def, Workspace* ws)
method RunOnDevice (line 101) | bool RunOnDevice() override {
FILE: caffe2/cuda_rtc/pool_op_rtc_gpu.cc
type caffe2 (line 24) | namespace caffe2 {
class AveragePool (line 26) | class AveragePool {}
class MaxPool (line 27) | class MaxPool {}
class MaxPoolRTCFunction (line 118) | class MaxPoolRTCFunction : public CudaRTCFunction<MaxPoolRTCFunction> {
method MaxPoolRTCFunction (line 120) | MaxPoolRTCFunction() : CudaRTCFunction(), name_(GetUniqueName()) {}
method string (line 123) | string KernelName(Args... /*args*/) {
class MaxPoolGradientRTCFunction (line 134) | class MaxPoolGradientRTCFunction
method MaxPoolGradientRTCFunction (line 137) | MaxPoolGradientRTCFunction() : CudaRTCFunction(), name_(GetUniqueNam...
method string (line 140) | string KernelName(Args... /*args*/) {
function string (line 153) | string MaxPoolRTCFunction::GetSource(
function string (line 177) | string MaxPoolGradientRTCFunction::GetSource(
class MaxPoolRTCOp (line 204) | class MaxPoolRTCOp final : public ConvPoolOpBase<CUDAContext> {
method MaxPoolRTCOp (line 206) | MaxPoolRTCOp(const OperatorDef& operator_def, Workspace* ws)
method RunOnDeviceWithOrderNCHW (line 213) | bool RunOnDeviceWithOrderNCHW() override {
method RunOnDeviceWithOrderNHWC (line 244) | bool RunOnDeviceWithOrderNHWC() override {
class MaxPoolGradientRTCOp (line 254) | class MaxPoolGradientRTCOp final : public ConvPoolOpBase<CUDAContext> {
method MaxPoolGradientRTCOp (line 256) | MaxPoolGradientRTCOp(const OperatorDef& operator_def, Workspace* ws)
method RunOnDeviceWithOrderNCHW (line 263) | bool RunOnDeviceWithOrderNCHW() override {
method RunOnDeviceWithOrderNHWC (line 297) | bool RunOnDeviceWithOrderNHWC() override {
FILE: caffe2/db/create_db_op.cc
type caffe2 (line 19) | namespace caffe2 {
FILE: caffe2/db/create_db_op.h
function namespace (line 24) | namespace caffe2 {
FILE: caffe2/db/create_db_op_gpu.cc
type caffe2 (line 20) | namespace caffe2 {
FILE: caffe2/db/db_test.cc
type caffe2 (line 28) | namespace caffe2 {
type db (line 29) | namespace db {
function CreateAndFill (line 33) | static bool CreateAndFill(const string& db_type, const string& name) {
function TestCursor (line 52) | static void TestCursor(Cursor* cursor) {
function DBSeekTestWrapper (line 81) | static void DBSeekTestWrapper(const string& db_type) {
function TEST (line 93) | TEST(DBSeekTest, RocksDB) {
function TEST (line 97) | TEST(DBSeekTest, LevelDB) {
function TEST (line 101) | TEST(DBSeekTest, LMDB) {
function TEST (line 105) | TEST(DBReaderTest, Reader) {
function TEST (line 170) | TEST(DBReaderShardedTest, Reader) {
FILE: caffe2/db/leveldb.cc
type caffe2 (line 26) | namespace caffe2 {
type db (line 27) | namespace db {
class LevelDBCursor (line 29) | class LevelDBCursor : public Cursor {
method LevelDBCursor (line 31) | explicit LevelDBCursor(leveldb::DB* db)
method Seek (line 36) | void Seek(const string& key) override { iter_->Seek(key); }
method SupportsSeek (line 37) | bool SupportsSeek() override { return true; }
method SeekToFirst (line 38) | void SeekToFirst() override { iter_->SeekToFirst(); }
method Next (line 39) | void Next() override { iter_->Next(); }
method string (line 40) | string key() override { return iter_->key().ToString(); }
method string (line 41) | string value() override { return iter_->value().ToString(); }
method Valid (line 42) | bool Valid() override { return iter_->Valid(); }
class LevelDBTransaction (line 48) | class LevelDBTransaction : public Transaction {
method LevelDBTransaction (line 50) | explicit LevelDBTransaction(leveldb::DB* db) : db_(db) {
method Put (line 55) | void Put(const string& key, const string& value) override {
method Commit (line 58) | void Commit() override {
class LevelDB (line 73) | class LevelDB : public DB {
method LevelDB (line 75) | LevelDB(const string& source, Mode mode) : DB(source, mode) {
method Close (line 91) | void Close() override { db_.reset(); }
method NewCursor (line 92) | unique_ptr<Cursor> NewCursor() override {
method NewTransaction (line 95) | unique_ptr<Transaction> NewTransaction() override {
FILE: caffe2/db/lmdb.cc
type caffe2 (line 30) | namespace caffe2 {
type db (line 31) | namespace db {
function MDB_CHECK (line 35) | inline void MDB_CHECK(int mdb_status) {
class LMDBCursor (line 39) | class LMDBCursor : public Cursor {
method LMDBCursor (line 41) | explicit LMDBCursor(MDB_env* mdb_env)
method Seek (line 54) | void Seek(const string& key) override {
method SupportsSeek (line 72) | bool SupportsSeek() override { return true; }
method SeekToFirst (line 74) | void SeekToFirst() override { SeekLMDB(MDB_FIRST); }
method Next (line 76) | void Next() override { SeekLMDB(MDB_NEXT); }
method string (line 78) | string key() override {
method string (line 82) | string value() override {
method Valid (line 87) | bool Valid() override { return valid_; }
method SeekLMDB (line 90) | void SeekLMDB(MDB_cursor_op op) {
class LMDBTransaction (line 108) | class LMDBTransaction final : public Transaction {
method LMDBTransaction (line 110) | explicit LMDBTransaction(MDB_env* mdb_env)
method Commit (line 120) | void Commit() override {
class LMDB (line 136) | class LMDB : public DB {
method Close (line 140) | void Close() override {
method NewCursor (line 146) | unique_ptr<Cursor> NewCursor() override {
method NewTransaction (line 149) | unique_ptr<Transaction> NewTransaction() override {
FILE: caffe2/db/protodb.cc
type caffe2 (line 23) | namespace caffe2 {
type db (line 24) | namespace db {
class ProtoDBCursor (line 26) | class ProtoDBCursor : public Cursor {
method ProtoDBCursor (line 28) | explicit ProtoDBCursor(const TensorProtos* proto)
method Seek (line 32) | void Seek(const string& /*str*/) override {
method SeekToFirst (line 36) | void SeekToFirst() override { iter_ = 0; }
method Next (line 37) | void Next() override { ++iter_; }
method string (line 38) | string key() override { return proto_->protos(iter_).name(); }
method string (line 39) | string value() override { return proto_->protos(iter_).SerializeAs...
method Valid (line 40) | bool Valid() override { return iter_ < proto_->protos_size(); }
class ProtoDBTransaction (line 47) | class ProtoDBTransaction : public Transaction {
method ProtoDBTransaction (line 49) | explicit ProtoDBTransaction(TensorProtos* proto)
method Put (line 56) | void Put(const string& key, const string& value) override {
method Commit (line 73) | void Commit() override {}
class ProtoDB (line 82) | class ProtoDB : public DB {
method ProtoDB (line 84) | ProtoDB(const string& source, Mode mode)
method Close (line 95) | void Close() override {
method NewCursor (line 101) | unique_ptr<Cursor> NewCursor() override {
method NewTransaction (line 104) | unique_ptr<Transaction> NewTransaction() override {
FILE: caffe2/db/zmqdb.cc
type caffe2 (line 26) | namespace caffe2 {
type db (line 27) | namespace db {
class ZmqDBCursor (line 29) | class ZmqDBCursor : public Cursor {
method ZmqDBCursor (line 31) | explicit ZmqDBCursor(const string& source)
method Seek (line 51) | void Seek(const string& /*key*/) override { /* do nothing */
method SeekToFirst (line 54) | void SeekToFirst() override { /* do nothing */ }
method Next (line 56) | void Next() override {
method string (line 65) | string key() override { return key_; }
method string (line 66) | string value() override { return value_; }
method Valid (line 67) | bool Valid() override { return true; }
method Prefetch (line 71) | void Prefetch() {
class ZmqDB (line 103) | class ZmqDB : public DB {
method ZmqDB (line 105) | ZmqDB(const string& source, Mode mode)
method Close (line 112) | void Close() override {}
method NewCursor (line 114) | unique_ptr<Cursor> NewCursor() override {
method NewTransaction (line 118) | unique_ptr<Transaction> NewTransaction() override {
FILE: caffe2/distributed/file_store_handler.cc
type caffe2 (line 37) | namespace caffe2 {
function encodeName (line 39) | static std::string encodeName(const std::string& name) {
FILE: caffe2/distributed/file_store_handler.h
function namespace (line 21) | namespace caffe2 {
FILE: caffe2/distributed/file_store_handler_op.cc
type caffe2 (line 19) | namespace caffe2 {
FILE: caffe2/distributed/file_store_handler_op.h
function namespace (line 23) | namespace caffe2 {
FILE: caffe2/distributed/file_store_handler_op_gpu.cc
type caffe2 (line 21) | namespace caffe2 {
FILE: caffe2/distributed/file_store_handler_op_test.py
class TestFileStoreHandlerOp (line 35) | class TestFileStoreHandlerOp(TestCase):
method setUp (line 38) | def setUp(self):
method tearDown (line 45) | def tearDown(self):
method create_store_handler (line 49) | def create_store_handler(self):
method test_set_get (line 72) | def test_set_get(self):
method test_get_timeout (line 75) | def test_get_timeout(self):
FILE: caffe2/distributed/py_export.cc
type caffe2 (line 5) | namespace caffe2 {
type python (line 6) | namespace python {
function PYBIND11_MODULE (line 10) | PYBIND11_MODULE(python, m) {
FILE: caffe2/distributed/redis_store_handler.cc
type caffe2 (line 25) | namespace caffe2 {
type timeval (line 32) | struct timeval
FILE: caffe2/distributed/redis_store_handler.h
function namespace (line 27) | namespace caffe2 {
FILE: caffe2/distributed/redis_store_handler_op.cc
type caffe2 (line 19) | namespace caffe2 {
FILE: caffe2/distributed/redis_store_handler_op.h
function namespace (line 25) | namespace caffe2 {
FILE: caffe2/distributed/redis_store_handler_op_gpu.cc
type caffe2 (line 21) | namespace caffe2 {
FILE: caffe2/distributed/redis_store_handler_op_test.py
class TestRedisStoreHandlerOp (line 33) | class TestRedisStoreHandlerOp(TestCase):
method setUp (line 34) | def setUp(self):
method tearDown (line 38) | def tearDown(self):
method create_store_handler (line 41) | def create_store_handler(self):
method test_set_get (line 53) | def test_set_get(self):
method test_get_timeout (line 56) | def test_get_timeout(self):
FILE: caffe2/distributed/store_handler.cc
type caffe2 (line 23) | namespace caffe2 {
FILE: caffe2/distributed/store_handler.h
function namespace (line 25) | namespace caffe2 {
FILE: caffe2/distributed/store_ops.cc
type caffe2 (line 19) | namespace caffe2 {
FILE: caffe2/distributed/store_ops.h
function namespace (line 23) | namespace caffe2 {
FILE: caffe2/distributed/store_ops_test_util.py
class StoreOpsTests (line 30) | class StoreOpsTests(object):
method _test_set_get (line 32) | def _test_set_get(cls, queue, create_store_handler_fn, index, num_procs):
method test_set_get (line 64) | def test_set_get(cls, create_store_handler_fn):
method test_get_timeout (line 87) | def test_get_timeout(cls, create_store_handler_fn):
FILE: caffe2/experiments/operators/fully_connected_op_decomposition.cc
type caffe2 (line 19) | namespace caffe2 {
class GetFCDecompGradient (line 28) | class GetFCDecompGradient : public GradientMakerBase {
method GetGradientDefs (line 30) | vector<OperatorDef> GetGradientDefs() override {
FILE: caffe2/experiments/operators/fully_connected_op_decomposition.h
function namespace (line 24) | namespace caffe2 {
FILE: caffe2/experiments/operators/fully_connected_op_decomposition_gpu.cc
type caffe2 (line 20) | namespace caffe2 {
FILE: caffe2/experiments/operators/fully_connected_op_prune.cc
type caffe2 (line 19) | namespace caffe2 {
class GetFCPruneGradient (line 32) | class GetFCPruneGradient : public GradientMakerBase {
method GetGradientDefs (line 34) | vector<OperatorDef> GetGradientDefs() override {
FILE: caffe2/experiments/operators/fully_connected_op_prune.h
function namespace (line 24) | namespace caffe2 {
function RunOnDevice (line 133) | bool RunOnDevice() override {
function RunOnDevice (line 206) | bool RunOnDevice() override {
FILE: caffe2/experiments/operators/fully_connected_op_sparse.cc
type caffe2 (line 19) | namespace caffe2 {
FILE: caffe2/experiments/operators/fully_connected_op_sparse.h
function namespace (line 27) | namespace caffe2 {
function RunOnDevice (line 102) | bool RunOnDevice() override {
FILE: caffe2/experiments/operators/funhash_op.cc
type caffe2 (line 19) | namespace caffe2 {
class GetFunHashGradient (line 64) | class GetFunHashGradient : public GradientMakerBase {
method GetGradientDefs (line 66) | vector<OperatorDef> GetGradientDefs() override {
FILE: caffe2/experiments/operators/funhash_op.h
function namespace (line 31) | namespace caffe2 {
FILE: caffe2/experiments/operators/sparse_funhash_op.cc
type caffe2 (line 19) | namespace caffe2 {
class GetSparseFunHashGradient (line 70) | class GetSparseFunHashGradient : public GradientMakerBase {
method GetGradientDefs (line 72) | vector<OperatorDef> GetGradientDefs() override {
FILE: caffe2/experiments/operators/sparse_funhash_op.h
function namespace (line 30) | namespace caffe2 {
FILE: caffe2/experiments/operators/sparse_matrix_reshape_op.cc
type caffe2 (line 19) | namespace caffe2 {
FILE: caffe2/experiments/operators/sparse_matrix_reshape_op.h
function namespace (line 24) | namespace caffe2 {
FILE: caffe2/experiments/operators/tt_contraction_op.cc
type caffe2 (line 19) | namespace caffe2 {
class GetTTContractionGradient (line 42) | class GetTTContractionGradient : public GradientMakerBase {
method GetGradientDefs (line 44) | vector<OperatorDef> GetGradientDefs() override {
FILE: caffe2/experiments/operators/tt_contraction_op.h
function namespace (line 24) | namespace caffe2 {
FILE: caffe2/experiments/operators/tt_contraction_op_gpu.cc
type caffe2 (line 20) | namespace caffe2 {
FILE: caffe2/experiments/operators/tt_pad_op.cc
type caffe2 (line 19) | namespace caffe2 {
class GetTTPadGradient (line 31) | class GetTTPadGradient : public GradientMakerBase {
method GetGradientDefs (line 33) | vector<OperatorDef> GetGradientDefs() override {
FILE: caffe2/experiments/operators/tt_pad_op.h
function namespace (line 24) | namespace caffe2 {
FILE: caffe2/experiments/python/SparseTransformer.py
class NetDefNode (line 26) | class NetDefNode():
method __init__ (line 28) | def __init__(self, name, optype, p=None, op=None):
method insertInput (line 37) | def insertInput(self, p):
method deleteInput (line 51) | def deleteInput(self, p):
function maskNallocate (line 57) | def maskNallocate(weight_name):
function transFCRelu (line 73) | def transFCRelu(cur, id2node, name2id, ops, model):
function Prune2Sparse (line 145) | def Prune2Sparse(cur, id2node, name2id, ops, model):
function net2list (line 156) | def net2list(net_root):
function netbuilder (line 175) | def netbuilder(model):
FILE: caffe2/experiments/python/convnet_benchmarks.py
function MLP (line 90) | def MLP(order):
function AlexNet (line 115) | def AlexNet(order):
function OverFeat (line 196) | def OverFeat(order):
function VGGA (line 268) | def VGGA(order):
function net_DAG_Builder (line 383) | def net_DAG_Builder(model):
function _InceptionModule (line 391) | def _InceptionModule(
function Inception (line 454) | def Inception(order):
function AddInput (line 529) | def AddInput(model, batch_size, db, db_type):
function AddParameterUpdate (line 542) | def AddParameterUpdate(model):
function Benchmark (line 553) | def Benchmark(model_gen, arg):
function GetArgumentParser (line 626) | def GetArgumentParser():
FILE: caffe2/experiments/python/device_reduce_sum_bench.py
class BenchmarkMeta (line 41) | class BenchmarkMeta(type):
method __new__ (line 42) | def __new__(metacls, name, bases, class_dict):
class Benchmark (line 50) | class Benchmark(object):
method __init__ (line 52) | def __init__(self):
method display (line 55) | def display(self):
class SumElements (line 63) | class SumElements(Benchmark):
method run (line 64) | def run(self):
class SumSqrElements (line 78) | class SumSqrElements(Benchmark):
method run (line 79) | def run(self):
class SoftMaxWithLoss (line 93) | class SoftMaxWithLoss(Benchmark):
method run (line 94) | def run(self):
function parse_args (line 110) | def parse_args():
function main (line 118) | def main():
FILE: caffe2/experiments/python/funhash_op_test.py
class TestFunHash (line 31) | class TestFunHash(hu.HypothesisTestCase):
method test_funhash (line 39) | def test_funhash(self, n_out, n_in, n_data, n_weight, n_alpha, sparsity,
FILE: caffe2/experiments/python/net_construct_bench.py
function AddMomentumParameterUpdate (line 43) | def AddMomentumParameterUpdate(train_model, LR):
function Create (line 77) | def Create(args):
function main (line 136) | def main():
FILE: caffe2/experiments/python/sparse_funhash_op_test.py
class TestFunHash (line 31) | class TestFunHash(hu.HypothesisTestCase):
method test_funhash (line 39) | def test_funhash(self, n_out, n_in, n_data, n_weight, n_alpha, sparsity,
FILE: caffe2/experiments/python/sparse_reshape_op_test.py
function test_reshape (line 28) | def test_reshape(old_shape, new_shape, stride_only=False):
class TestSparseMatrixReshapeOp (line 63) | class TestSparseMatrixReshapeOp(TestCase):
method test_basic_reshape (line 64) | def test_basic_reshape(self):
method test_missing_dim (line 67) | def test_missing_dim(self):
method test_stride_only (line 70) | def test_stride_only(self):
method test_sparse_reshape_mm (line 73) | def test_sparse_reshape_mm(self):
FILE: caffe2/experiments/python/tt_contraction_op_test.py
class TestTTContraction (line 30) | class TestTTContraction(hu.HypothesisTestCase):
method test_tt_contraction (line 36) | def test_tt_contraction(self, D, K, M, N, gc, dc):
FILE: caffe2/experiments/python/tt_pad_op_test.py
class TestTTPad (line 30) | class TestTTPad(hu.HypothesisTestCase):
method test_tt_pad (line 35) | def test_tt_pad(self, K, M, N, gc, dc):
FILE: caffe2/image/image_input_op.cc
type caffe2 (line 19) | namespace caffe2 {
FILE: caffe2/image/image_input_op.h
function namespace (line 34) | namespace caffe2 {
FILE: caffe2/image/image_input_op_gpu.cc
type caffe2 (line 21) | namespace caffe2 {
FILE: caffe2/image/transform_gpu.h
function namespace (line 47) | namespace caffe2 {
FILE: caffe2/mkl/mkl_operator.cc
type caffe2 (line 26) | namespace caffe2 {
FILE: caffe2/mkl/mkl_utils_test.cc
type caffe2 (line 28) | namespace caffe2 {
type mkl (line 29) | namespace mkl {
function TEST (line 31) | TEST(MKLDNNTest, SimpleConvolutionTest) {
function TEST (line 104) | TEST(MKLDNNTest, MKLMemoryCopyTest) {
FILE: caffe2/mkl/mklmemory_serialization.cc
type caffe2 (line 23) | namespace caffe2 {
type mkl (line 24) | namespace mkl {
class MKLMemorySerializer (line 31) | class MKLMemorySerializer : public BlobSerializerBase {
method MKLMemorySerializer (line 33) | MKLMemorySerializer() {}
method Serialize (line 36) | void Serialize(
class MKLMemoryDeserializer (line 93) | class MKLMemoryDeserializer : public BlobDeserializerBase {
method Deserialize (line 95) | void Deserialize(const BlobProto& blob_proto, Blob* blob) override {
FILE: caffe2/mkl/mklmemory_serialization_test.cc
type caffe2 (line 26) | namespace caffe2 {
function TEST (line 30) | TEST(MKLTest, MKLMemorySerialization) {
FILE: caffe2/mkl/operators/concat_op.cc
type caffe2 (line 21) | namespace caffe2 {
type mkl (line 22) | namespace mkl {
class MKLConcatOp (line 25) | class MKLConcatOp final : public MKLOperator<T> {
method MKLConcatOp (line 29) | MKLConcatOp(const OperatorDef& operator_def, Workspace* ws)
method RunOnDevice (line 55) | bool RunOnDevice() override {
FILE: caffe2/mkl/operators/conv_op.cc
type caffe2 (line 24) | namespace caffe2 {
type mkl (line 25) | namespace mkl {
class MKLConvOp (line 28) | class MKLConvOp final : public ConvPoolOpBase<MKLContext> {
method MKLConvOp (line 31) | MKLConvOp(const OperatorDef& operator_def, Workspace* ws)
method RunOnDeviceWithOrderNCHW (line 44) | bool RunOnDeviceWithOrderNCHW() override {
method RunOnDeviceWithOrderNHWC (line 179) | bool RunOnDeviceWithOrderNHWC() override {
FILE: caffe2/mkl/operators/conv_op_mkldnn.cc
type caffe2 (line 24) | namespace caffe2 {
type mkl (line 25) | namespace mkl {
class ConvMKLDNNOp (line 28) | class ConvMKLDNNOp final : public ConvPoolOpBase<CPUContext> {
method ConvMKLDNNOp (line 31) | ConvMKLDNNOp(const OperatorDef& operator_def, Workspace* ws)
method RunOnDeviceWithOrderNCHW (line 43) | bool RunOnDeviceWithOrderNCHW() override {
method RunOnDeviceWithOrderNHWC (line 118) | bool RunOnDeviceWithOrderNHWC() override {
FILE: caffe2/mkl/operators/elementwise_sum_op.cc
type caffe2 (line 23) | namespace caffe2 {
type mkl (line 24) | namespace mkl {
class MKLSumOp (line 27) | class MKLSumOp final : public MKLOperator<T> {
method MKLSumOp (line 31) | MKLSumOp(const OperatorDef& operator_def, Workspace* ws)
method RunOnDevice (line 40) | bool RunOnDevice() override {
FILE: caffe2/mkl/operators/fully_connected_op.cc
type caffe2 (line 23) | namespace caffe2 {
type mkl (line 24) | namespace mkl {
class MKLFullyConnectedOp (line 27) | class MKLFullyConnectedOp final : public MKLOperator<T> {
method MKLFullyConnectedOp (line 29) | MKLFullyConnectedOp(const OperatorDef& operator_def, Workspace* ws)
method RunOnDevice (line 34) | bool RunOnDevice() override {
FILE: caffe2/mkl/operators/local_response_normalization_op.cc
type caffe2 (line 25) | namespace caffe2 {
type mkl (line 26) | namespace mkl {
class MKLLRNOp (line 29) | class MKLLRNOp final : public LRNOpBase<T, MKLContext> {
method MKLLRNOp (line 31) | MKLLRNOp(const OperatorDef& operator_def, Workspace* ws)
FILE: caffe2/mkl/operators/operator_fallback_mkl.cc
type caffe2 (line 32) | namespace caffe2 {
type SigmoidCPUFunctor (line 34) | struct SigmoidCPUFunctor {
type caffe2 (line 46) | namespace caffe2 {
type SigmoidCPUFunctor (line 34) | struct SigmoidCPUFunctor {
FILE: caffe2/mkl/operators/operator_fallback_mkl.h
function namespace (line 27) | namespace caffe2 {
FILE: caffe2/mkl/operators/packed_fc_op.cc
type caffe2 (line 27) | namespace caffe2 {
type mkl (line 31) | namespace mkl {
class PackedFCOp (line 33) | class PackedFCOp final : public Operator<CPUContext> {
method PackedFCOp (line 36) | PackedFCOp(const OperatorDef& operator_def, Workspace* ws)
method RunOnDevice (line 55) | bool RunOnDevice() override {
method Hash (line 150) | uint32_t Hash(const float* ptr, size_t n) {
FILE: caffe2/mkl/operators/pool_op.cc
type caffe2 (line 25) | namespace caffe2 {
type mkl (line 27) | namespace mkl {
class MKLPoolOp (line 30) | class MKLPoolOp final : public ConvPoolOpBase<MKLContext> {
method MKLPoolOp (line 33) | MKLPoolOp(const OperatorDef& operator_def, Workspace* ws)
FILE: caffe2/mkl/operators/relu_op.cc
type caffe2 (line 24) | namespace caffe2 {
type mkl (line 25) | namespace mkl {
class MKLReluOp (line 28) | class MKLReluOp : public MKLOperator<T> {
method RunOnDevice (line 32) | bool RunOnDevice() override {
class MKLReluGradientOp (line 66) | class MKLReluGradientOp : public MKLOperator<T> {
method RunOnDevice (line 70) | bool RunOnDevice() override {
FILE: caffe2/mkl/operators/spatial_batch_norm_op.cc
type caffe2 (line 24) | namespace caffe2 {
type mkl (line 25) | namespace mkl {
class MKLBNOp (line 28) | class MKLBNOp final : public SpatialBNOp<MKLContext> {
method MKLBNOp (line 30) | MKLBNOp(const OperatorDef& operator_def, Workspace* ws)
method RunOnDevice (line 39) | bool RunOnDevice() {
FILE: caffe2/mkl/operators/squeeze_op.cc
type caffe2 (line 22) | namespace caffe2 {
type mkl (line 23) | namespace mkl {
class MKLSqueezeOp (line 26) | class MKLSqueezeOp final : public MKLOperator<T> {
method MKLSqueezeOp (line 30) | MKLSqueezeOp(const OperatorDef& operator_def, Workspace* ws)
method RunOnDevice (line 44) | bool RunOnDevice() override {
FILE: caffe2/mkl/operators/utility_ops.cc
type caffe2 (line 22) | namespace caffe2 {
type mkl (line 23) | namespace mkl {
class CopyCPUToMKLOp (line 25) | class CopyCPUToMKLOp final : public MKLOperator<float> {
method RunOnDevice (line 28) | bool RunOnDevice() override {
class CopyMKLToCPUOp (line 40) | class CopyMKLToCPUOp final : public MKLOperator<float> {
method RunOnDevice (line 44) | bool RunOnDevice() override {
FILE: caffe2/mkl/utils/mkl_context.cc
type caffe2 (line 21) | namespace caffe2 {
FILE: caffe2/mkl/utils/mkl_context.h
function namespace (line 26) | namespace caffe2 {
FILE: caffe2/mkl/utils/mkl_dnn_cppwrapper.h
function namespace (line 33) | namespace caffe2 {
FILE: caffe2/mkl/utils/mkl_memory.cc
type caffe2 (line 32) | namespace caffe2 {
function GetMKLTensorInfo (line 38) | static vector<TIndex> GetMKLTensorInfo(
function TypeMeta (line 53) | static TypeMeta GetMKLTensorType(const void*) {
function RegisterForType (line 58) | static void RegisterForType() {
function Caffe2InitializeMKL (line 65) | static bool Caffe2InitializeMKL(int*, char***) {
FILE: caffe2/mkl/utils/mkl_memory.h
function namespace (line 34) | namespace caffe2 {
function Reset (line 268) | void Reset() {
function CopyFrom (line 316) | void CopyFrom(const void* ptr) {
function CopyFrom (line 329) | void CopyFrom(const TensorCPU& tensor) {
function CopyFrom (line 337) | void CopyFrom(const MKLMemory<T>& other) {
function ShareFromRaw (line 355) | bool ShareFromRaw(const void* ptr) {
function ShareFromTensor (line 364) | bool ShareFromTensor(const TensorCPU& tensor) {
function ShareFrom (line 372) | bool ShareFrom(const MKLMemory<T>& other) {
function CopyTo (line 387) | void CopyTo(void* ptr) const {
function CopyTo (line 400) | void CopyTo(TensorCPU* tensor) const {
function dim32 (line 481) | inline int dim32(const int i) const {
function TIndex (line 498) | inline TIndex dim(const int i) const {
function T (line 588) | T* buffer() {
FILE: caffe2/mkl/utils/mkl_operator.h
function namespace (line 27) | namespace caffe2 {
FILE: caffe2/mkl/utils/sgemm_pack.h
function namespace (line 22) | namespace caffe2 {
FILE: caffe2/mobile/contrib/arm-compute/core/context.cc
type caffe2 (line 8) | namespace caffe2 {
function EventCreateOPENGL (line 25) | void EventCreateOPENGL(const DeviceOption & /* unused */,
function EventRecordOPENGL (line 27) | void EventRecordOPENGL(Event * /* unused */, const void * /* unused */,
function EventWaitOPENGLOPENGL (line 29) | void EventWaitOPENGLOPENGL(const Event * /* unused */, void * /* unuse...
function EventFinishOPENGL (line 30) | void EventFinishOPENGL(const Event * /* unused */) {}
function EventResetOPENGL (line 31) | void EventResetOPENGL(Event * /* unused */) {}
FILE: caffe2/mobile/contrib/arm-compute/core/context.h
function namespace (line 29) | namespace caffe2 {
function lazy_allocate (line 151) | void lazy_allocate(const Blob *b, bool allocate_tensor, bool try_to_copy...
function fillGLTensor (line 168) | void fillGLTensor(const Blob *b) const {
function dim32 (line 234) | const int32_t dim32(const int index) const { return dims_.at(index); }
function size (line 236) | const int32_t size() const {
function T (line 246) | T *map() const {
function SetDims (line 275) | bool SetDims() {
function SetDims (line 282) | bool SetDims(const TIndex d0) {
function SetDims (line 290) | bool SetDims(const TIndex d0, const TIndex d1) {
function SetDims (line 299) | bool SetDims(const TIndex d0, const TIndex d1, const TIndex d2) {
function SetDims (line 309) | bool SetDims(const TIndex d0, const TIndex d1, const TIndex d2,
FILE: caffe2/mobile/contrib/arm-compute/core/net_gl.cc
type caffe2 (line 31) | namespace caffe2 {
function PairLargerThan (line 97) | bool PairLargerThan(const std::pair<A, B>& x, const std::pair<A, B>& y) {
FILE: caffe2/mobile/contrib/arm-compute/core/net_gl.h
function namespace (line 30) | namespace caffe2 {
FILE: caffe2/mobile/contrib/arm-compute/core/operator.cc
type caffe2 (line 3) | namespace caffe2 {
FILE: caffe2/mobile/contrib/arm-compute/core/operator.h
function namespace (line 7) | namespace caffe2 {
FILE: caffe2/mobile/contrib/arm-compute/core/rewrite_net.cc
type caffe2 (line 23) | namespace caffe2 {
type Analysis (line 25) | struct Analysis {
type SSA (line 26) | struct SSA {
function Analysis (line 35) | static Analysis analyzeNet(const NetDef& net) {
type SSA (line 26) | struct SSA {
function insertCopyFromGLOp (line 61) | static void insertCopyFromGLOp(NetDef& predictNet, const std::string& ...
function NetDef (line 69) | static NetDef insertInputOutputCopyOps(const NetDef& def, std::unorder...
function tryFuseAdjacentOps (line 153) | static bool tryFuseAdjacentOps(const OperatorDef& currentOp,
function NetDef (line 186) | static NetDef runOpenGLFusion(const NetDef& def, std::unordered_set<st...
function dumpDefForOpenGL (line 222) | void dumpDefForOpenGL(const NetDef& d) {
function NetDef (line 242) | NetDef rewritePredictNetForOpenGL(const NetDef& predictNet, bool runFu...
function tryConvertToOpenGL (line 264) | bool tryConvertToOpenGL(const NetDef& predictNet,
FILE: caffe2/mobile/contrib/arm-compute/core/rewrite_net.h
function namespace (line 22) | namespace caffe2 {
FILE: caffe2/mobile/contrib/arm-compute/operators/activation_ops.cc
type caffe2 (line 7) | namespace caffe2 {
FILE: caffe2/mobile/contrib/arm-compute/operators/activation_ops.h
function namespace (line 7) | namespace caffe2 {
FILE: caffe2/mobile/contrib/arm-compute/operators/concat_op.cc
type caffe2 (line 5) | namespace caffe2 {
class GLConcatOp (line 7) | class GLConcatOp final : public Operator<GLContext> {
method GLConcatOp (line 9) | GLConcatOp(const OperatorDef &operator_def, Workspace *ws)
FILE: caffe2/mobile/contrib/arm-compute/operators/conv_op.cc
type caffe2 (line 8) | namespace caffe2 {
class GLConvOp (line 11) | class GLConvOp final : public ConvPoolOpBase<GLContext> {
method GLConvOp (line 14) | GLConvOp(const OperatorDef& operator_def, Workspace* ws)
FILE: caffe2/mobile/contrib/arm-compute/operators/copy_op.cc
type caffe2 (line 4) | namespace caffe2 {
class CopyFromGLOp (line 6) | class CopyFromGLOp final : public Operator<GLContext> {
method CopyFromGLOp (line 8) | CopyFromGLOp(const OperatorDef &operator_def, Workspace *ws)
FILE: caffe2/mobile/contrib/arm-compute/operators/elementwise_sum_op.cc
type caffe2 (line 5) | namespace caffe2 {
class GLSumOp (line 7) | class GLSumOp final : public Operator<GLContext> {
method GLSumOp (line 9) | GLSumOp(const OperatorDef &operator_def, Workspace *ws)
FILE: caffe2/mobile/contrib/arm-compute/operators/fully_connected_op.cc
type caffe2 (line 6) | namespace caffe2 {
class GLFullyConnectedOp (line 8) | class GLFullyConnectedOp final : public Operator<GLContext> {
method GLFullyConnectedOp (line 10) | GLFullyConnectedOp(const OperatorDef &operator_def, Workspace *ws)
FILE: caffe2/mobile/contrib/arm-compute/operators/norm_planar_yuv_op.cc
type caffe2 (line 4) | namespace caffe2 {
class GLNormalizePlanarYUVOp (line 7) | class GLNormalizePlanarYUVOp final : public Operator<GLContext> {
method GLNormalizePlanarYUVOp (line 9) | GLNormalizePlanarYUVOp(const OperatorDef &operator_def, Workspace *ws)
FILE: caffe2/mobile/contrib/arm-compute/operators/pool_op.cc
type caffe2 (line 5) | namespace caffe2 {
class GLAveragePoolOp (line 8) | class GLAveragePoolOp final : public ConvPoolOpBase<GLContext> {
method GLAveragePoolOp (line 11) | GLAveragePoolOp(const OperatorDef& operator_def, Workspace* ws)
class GLMaxPoolOp (line 25) | class GLMaxPoolOp final : public ConvPoolOpBase<GLContext> {
method GLMaxPoolOp (line 28) | GLMaxPoolOp(const OperatorDef& operator_def, Workspace* ws)
FILE: caffe2/mobile/contrib/arm-compute/operators/reshape_op.cc
type caffe2 (line 5) | namespace caffe2 {
class GLReshapeOp (line 7) | class GLReshapeOp final : public Operator<GLContext> {
method GLReshapeOp (line 9) | GLReshapeOp(const OperatorDef &operator_def, Workspace *ws)
FILE: caffe2/mobile/contrib/arm-compute/operators/resize_op.cc
type caffe2 (line 5) | namespace caffe2 {
class GLResizeNearestOp (line 8) | class GLResizeNearestOp final : public Operator<GLContext> {
method GLResizeNearestOp (line 10) | GLResizeNearestOp(const OperatorDef &operator_def, Workspace *ws)
FILE: caffe2/mobile/contrib/arm-compute/operators/softmax_op.cc
type caffe2 (line 6) | namespace caffe2 {
class GLSoftmaxOp (line 8) | class GLSoftmaxOp final : public Operator<GLContext> {
method GLSoftmaxOp (line 10) | GLSoftmaxOp(const OperatorDef &operator_def, Workspace *ws)
FILE: caffe2/mobile/contrib/arm-compute/operators/spatial_batch_norm_op.cc
type caffe2 (line 6) | namespace caffe2 {
class GLSpatialBNOp (line 8) | class GLSpatialBNOp final : public Operator<GLContext> {
method GLSpatialBNOp (line 10) | GLSpatialBNOp(const OperatorDef &operator_def, Workspace *ws)
FILE: caffe2/mobile/contrib/arm-compute/test/gl_activation_ops_test.cc
type caffe2 (line 3) | namespace caffe2 {
function TEST (line 5) | TEST(OPENGLOperatorTest, Sigmoid) {
function TEST (line 25) | TEST(OPENGLOperatorTest, ReLU) {
function TEST (line 45) | TEST(OPENGLOperatorTest, SigmoidTwice) {
FILE: caffe2/mobile/contrib/arm-compute/test/gl_alignment_test.cc
type caffe2 (line 4) | namespace caffe2 {
function TEST (line 9) | TEST(OPENGLOperatorTest, ConvMaxPoolConv) {
function TEST (line 78) | TEST(OPENGLOperatorTest, ConvReluConv) {
function TEST (line 138) | TEST(OPENGLOperatorTest, ConvAddConv) {
FILE: caffe2/mobile/contrib/arm-compute/test/gl_concat_op_test.cc
type caffe2 (line 3) | namespace caffe2 {
function TEST (line 5) | TEST(OPENGLOperatorTest, Concat) {
FILE: caffe2/mobile/contrib/arm-compute/test/gl_context_test.cc
type caffe2 (line 4) | namespace caffe2 {
function TEST (line 6) | TEST(OPENGLContextTest, Initialization) {
FILE: caffe2/mobile/contrib/arm-compute/test/gl_conv_op_test.cc
type caffe2 (line 4) | namespace caffe2 {
function TEST (line 8) | TEST(OPENGLOperatorTest, Conv) {
function TEST (line 51) | TEST(OPENGLOperatorTest, ConvReluConv) {
function TEST (line 112) | TEST(OPENGLOperatorTest, ConvBenchmark) {
FILE: caffe2/mobile/contrib/arm-compute/test/gl_copy_op_test.cc
type caffe2 (line 3) | namespace caffe2 {
function TEST (line 5) | TEST(OPENGLOperatorTest, CopyFromGL) {
FILE: caffe2/mobile/contrib/arm-compute/test/gl_elementwise_sum_op_test.cc
type caffe2 (line 3) | namespace caffe2 {
function TEST (line 5) | TEST(OPENGLOperatorTest, Sum) {
FILE: caffe2/mobile/contrib/arm-compute/test/gl_fully_connected_op_test.cc
type caffe2 (line 3) | namespace caffe2 {
function TEST (line 5) | TEST(OPENGLOperatorTest, FC) {
FILE: caffe2/mobile/contrib/arm-compute/test/gl_model_test.cc
type caffe2 (line 3) | namespace caffe2 {
FILE: caffe2/mobile/contrib/arm-compute/test/gl_model_test.h
function namespace (line 19) | namespace caffe2 {
FILE: caffe2/mobile/contrib/arm-compute/test/gl_norm_planar_yuv_op_test.cc
type caffe2 (line 3) | namespace caffe2 {
function TEST (line 7) | TEST(OPENGLOperatorTest, NormPlanarYUV) {
FILE: caffe2/mobile/contrib/arm-compute/test/gl_operator_test.h
function namespace (line 8) | namespace caffe2 {
FILE: caffe2/mobile/contrib/arm-compute/test/gl_pool_op_test.cc
type caffe2 (line 3) | namespace caffe2 {
function TEST (line 5) | TEST(OPENGLOperatorTest, AveragePool) {
function TEST (line 33) | TEST(OPENGLOperatorTest, MaxPool) {
function TEST (line 61) | TEST(OPENGLOperatorTest, AverageGlobalPool) {
FILE: caffe2/mobile/contrib/arm-compute/test/gl_resize_op_test.cc
type caffe2 (line 3) | namespace caffe2 {
function TEST (line 5) | TEST(OPENGLOperatorTest, ResizeNearest) {
FILE: caffe2/mobile/contrib/arm-compute/test/gl_softmax_op_test.cc
type caffe2 (line 3) | namespace caffe2 {
function TEST (line 5) | TEST(OPENGLOperatorTest, Softmax) {
FILE: caffe2/mobile/contrib/arm-compute/test/gl_spatial_batch_norm_op_test.cc
type caffe2 (line 3) | namespace caffe2 {
function TEST (line 5) | TEST(OPENGLOperatorTest, SpatialBN) {
FILE: caffe2/mobile/contrib/ios/ios_caffe.cc
function Caffe2IOSPredictor (line 23) | Caffe2IOSPredictor* MakeCaffe2Predictor(const std::string& init_net_str,
function GenerateStylizedImage (line 48) | void GenerateStylizedImage(std::vector<float>& originalImage,
FILE: caffe2/mobile/contrib/ios/ios_caffe_predictor.cc
function Caffe2IOSPredictor (line 27) | Caffe2IOSPredictor* Caffe2IOSPredictor::NewCaffe2IOSPredictor(const caff...
FILE: caffe2/mobile/contrib/ios/ios_caffe_predictor.h
type Tensor (line 25) | struct Tensor {
function Caffe2IOSPredictor (line 30) | Caffe2IOSPredictor final {
FILE: caffe2/mobile/contrib/ios/mpscnn/mpscnn.h
function namespace (line 22) | namespace caffe2 {
FILE: caffe2/mobile/contrib/ios/mpscnn/mpscnn_context.h
function namespace (line 30) | namespace caffe2 {
FILE: caffe2/mobile/contrib/ios/mpscnn/mpscnn_graph_mask.h
function namespace (line 22) | namespace caffe2 {
FILE: caffe2/mobile/contrib/ios/mpscnn/mpscnn_kernels.h
function ushort (line 37) | inline constexpr ushort divRoundUp(ushort x, ushort y) { return (x + (y ...
function kernel (line 39) | kernel void affine(constant half4* scale[[buffer(0)]],
function kernel (line 56) | kernel void affine_nonarray(constant half4* scale[[buffer(0)]],
function kernel (line 71) | kernel void prelu_nonshared(constant half4* weights[[buffer(0)]],
function kernel (line 89) | kernel void prelu_nonshared_nonarray(constant half4* weights[[buffer(0)]],
function kernel (line 112) | kernel void instance_norm(
function kernel (line 222) | kernel void instance_norm_nonarray(
function kernel (line 325) | kernel void copy_nchw_to_metal(constant float* in[[buffer(0)]],
function kernel (line 357) | kernel void copy_nchw_to_metal_nonarray(constant float* in[[buffer(0)]],
function ushort3 (line 390) | ushort3 gid[[thread_position_in_grid]]) {
function ushort2 (line 417) | ushort2 gid[[thread_position_in_grid]]) {
function kernel (line 566) | kernel void preprocess_stylizer(device uchar4* in[[buffer(0)]],
function half4 (line 599) | half4 min_h(0.0h, 0.0h, 0.0h, 255.0h);
function ushort (line 773) | inline ushort idx_3(ushort z, ushort C0, ushort C1, ushort C2, ushort C3) {
function ushort (line 786) | inline ushort idx_2(ushort z, ushort C0, ushort C1, ushort C2) {
function ushort (line 796) | inline ushort idx_1(ushort z, ushort C0, ushort C1) {
function ushort (line 804) | inline ushort idx_0(ushort z, ushort C0) { return 0; }
function ushort (line 807) | inline constexpr ushort z_off(ushort n, ushort c, ushort C) { return n *...
function kernel (line 1085) | kernel void nms(device uint* mask[[buffer(0)]],
FILE: caffe2/mobile/contrib/ios/mpscnn/mpscnn_test.h
function namespace (line 21) | namespace caffe2 {
FILE: caffe2/mobile/contrib/ios/pool_test.cc
type caffe2 (line 27) | namespace caffe2 {
function AddNoiseInput (line 31) | void AddNoiseInput(const vector<TIndex>& shape, const string& name, Wo...
function compareMaxPooling (line 46) | void compareMaxPooling(int N,
function randInt (line 117) | int randInt(int a, int b) {
function runMaxPool (line 123) | void runMaxPool(int kernel, int stride, int pad) {
function TEST (line 133) | TEST(PoolOp, MaxPool2x2s2p0Randomized) {
function TEST (line 139) | TEST(PoolOp, MaxPool4x4s3p2Randomized) {
function TEST (line 145) | TEST(PoolOp, MaxPool2x2s2p0Special) {
function TEST (line 156) | TEST(PoolOp, MaxPoolFullyRandomized) {
FILE: caffe2/mobile/contrib/ios/resize_test.cc
type caffe2 (line 27) | namespace caffe2 {
function AddNoiseInput (line 31) | void AddNoiseInput(const vector<TIndex>& shape, const string& name, Wo...
function compareResizeNeareast (line 46) | void compareResizeNeareast(int N,
function randInt (line 95) | int randInt(int a, int b) {
function TEST (line 101) | TEST(ResizeNearestOp, ResizeNearest2x) {
FILE: caffe2/mobile/contrib/libopencl-stub/include/CL/cl.h
type _cl_platform_id (line 39) | struct _cl_platform_id
type _cl_device_id (line 40) | struct _cl_device_id
type _cl_context (line 41) | struct _cl_context
type _cl_command_queue (line 42) | struct _cl_command_queue
type _cl_mem (line 43) | struct _cl_mem
type _cl_program (line 44) | struct _cl_program
type _cl_kernel (line 45) | struct _cl_kernel
type _cl_event (line 46) | struct _cl_event
type _cl_sampler (line 47) | struct _cl_sampler
type cl_uint (line 49) | typedef cl_uint cl_bool;
type cl_ulong (line 50) | typedef cl_ulong cl_bitfield;
type cl_bitfield (line 51) | typedef cl_bitfield cl_device_type;
type cl_uint (line 52) | typedef cl_uint cl_platform_info;
type cl_uint (line 53) | typedef cl_uint cl_device_info;
type cl_bitfield (line 54) | typedef cl_bitfield cl_device_fp_config;
type cl_uint (line 55) | typedef cl_uint cl_device_mem_cache_type;
type cl_uint (line 56) | typedef cl_uint cl_device_local_mem_type;
type cl_bitfield (line 57) | typedef cl_bitfield cl_device_exec_capabilities;
type cl_bitfield (line 58) | typedef cl_bitfield cl_command_queue_properties;
type cl_device_partition_property (line 59) | typedef intptr_t cl_device_partition_property;
type cl_bitfield (line 60) | typedef cl_bitfield cl_device_affinity_domain;
type cl_context_properties (line 62) | typedef intptr_t cl_context_properties;
type cl_uint (line 63) | typedef cl_uint cl_context_info;
type cl_uint (line 64) | typedef cl_uint cl_command_queue_info;
type cl_uint (line 65) | typedef cl_uint cl_channel_order;
type cl_uint (line 66) | typedef cl_uint cl_channel_type;
type cl_bitfield (line 67) | typedef cl_bitfield cl_mem_flags;
type cl_uint (line 68) | typedef cl_uint cl_mem_object_type;
type cl_uint (line 69) | typedef cl_uint cl_mem_info;
type cl_bitfield (line 70) | typedef cl_bitfield cl_mem_migration_flags;
type cl_uint (line 71) | typedef cl_uint cl_image_info;
type cl_uint (line 72) | typedef cl_uint cl_buffer_create_type;
type cl_uint (line 73) | typedef cl_uint cl_addressing_mode;
type cl_uint (line 74) | typedef cl_uint cl_filter_mode;
type cl_uint (line 75) | typedef cl_uint cl_sampler_info;
type cl_bitfield (line 76) | typedef cl_bitfield cl_map_flags;
type cl_uint (line 77) | typedef cl_uint cl_program_info;
type cl_uint (line 78) | typedef cl_uint cl_program_build_info;
type cl_uint (line 79) | typedef cl_uint cl_program_binary_type;
type cl_int (line 80) | typedef cl_int cl_build_status;
type cl_uint (line 81) | typedef cl_uint cl_kernel_info;
type cl_uint (line 82) | typedef cl_uint cl_kernel_arg_info;
type cl_uint (line 83) | typedef cl_uint cl_kernel_arg_address_qualifier;
type cl_uint (line 84) | typedef cl_uint cl_kernel_arg_access_qualifier;
type cl_bitfield (line 85) | typedef cl_bitfield cl_kernel_arg_type_qualifier;
type cl_uint (line 86) | typedef cl_uint cl_kernel_work_group_info;
type cl_uint (line 87) | typedef cl_uint cl_event_info;
type cl_uint (line 88) | typedef cl_uint cl_command_type;
type cl_uint (line 89) | typedef cl_uint cl_profiling_info;
type cl_image_format (line 92) | typedef struct _cl_image_format {
type cl_image_desc (line 97) | typedef struct _cl_image_desc {
type cl_buffer_region (line 110) | typedef struct _cl_buffer_region {
FILE: caffe2/mobile/contrib/libopencl-stub/include/CL/cl.hpp
type cl (line 230) | namespace cl {
class Memory (line 232) | class Memory
method Memory (line 2929) | Memory() : detail::Wrapper<cl_type>() { }
method Memory (line 2935) | Memory(const Memory& memory) : detail::Wrapper<cl_type>(memory) { }
method Memory (line 2949) | Memory& operator = (const Memory& rhs)
method Memory (line 2962) | Memory& operator = (const cl_mem& rhs)
method cl_int (line 2970) | cl_int getInfo(cl_mem_info name, T* param) const
method getInfo (line 2978) | typename
method cl_int (line 3005) | cl_int setDestructorCallback(
class Program (line 257) | class Program
method Program (line 4639) | Program(
method Program (line 4674) | Program(
method Program (line 4708) | Program(
method Program (line 4752) | Program(
method Program (line 4809) | Program(
method Program (line 4838) | Program() { }
method Program (line 4840) | Program(const Program& program) : detail::Wrapper<cl_type>(program) { }
method Program (line 4844) | Program& operator = (const Program& rhs)
method Program (line 4852) | Program& operator = (const cl_program& rhs)
method cl_int (line 4858) | cl_int build(
method cl_int (line 4882) | cl_int build(
method cl_int (line 4899) | cl_int compile(
method cl_int (line 4920) | cl_int getInfo(cl_program_info name, T* param) const
method getInfo (line 4927) | typename
method cl_int (line 4941) | cl_int getBuildInfo(
method getBuildInfo (line 4950) | typename
method cl_int (line 4963) | cl_int createKernels(VECTOR_CLASS<Kernel>* kernels)
class Device (line 258) | class Device
method Device (line 1912) | Device() : detail::Wrapper<cl_type>() { }
method Device (line 1918) | Device(const Device& device) : detail::Wrapper<cl_type>(device) { }
method Device (line 1924) | Device(const cl_device_id &device) : detail::Wrapper<cl_type>(device...
method Device (line 1936) | Device& operator = (const Device& rhs)
method Device (line 1948) | Device& operator = (const cl_device_id& rhs)
method cl_int (line 1956) | cl_int getInfo(cl_device_info name, T* param) const
method getInfo (line 1964) | typename
method cl_int (line 1982) | cl_int createSubDevices(
method cl_int (line 2008) | cl_int createSubDevices(
class Context (line 259) | class Context
method Context (line 2365) | Context(
method Context (line 2395) | Context(
method Context (line 2425) | Context(
method Context (line 2510) | static Context getDefault(cl_int * err = NULL)
method Context (line 2559) | Context() : detail::Wrapper<cl_type>() { }
method Context (line 2565) | Context(const Context& context) : detail::Wrapper<cl_type>(context) { }
method Context (line 2579) | Context& operator = (const Context& rhs)
method Context (line 2592) | Context& operator = (const cl_context& rhs)
method cl_int (line 2600) | cl_int getInfo(cl_context_info name, T* param) const
method getInfo (line 2608) | typename
method cl_int (line 2625) | cl_int getSupportedImageFormats(
class CommandQueue (line 260) | class CommandQueue
method CommandQueue (line 5097) | CommandQueue(
method CommandQueue (line 5126) | explicit CommandQueue(
method CommandQueue (line 5155) | CommandQueue(
method CommandQueue (line 5171) | static CommandQueue getDefault(cl_int * err = NULL)
method CommandQueue (line 5232) | CommandQueue() { }
method CommandQueue (line 5234) | CommandQueue(const CommandQueue& commandQueue) : detail::Wrapper<cl_...
method CommandQueue (line 5236) | CommandQueue(const cl_command_queue& commandQueue) : detail::Wrapper...
method CommandQueue (line 5238) | CommandQueue& operator = (const CommandQueue& rhs)
method CommandQueue (line 5246) | CommandQueue& operator = (const cl_command_queue& rhs)
method cl_int (line 5253) | cl_int getInfo(cl_command_queue_info name, T* param) const
method getInfo (line 5261) | typename
method cl_int (line 5274) | cl_int enqueueReadBuffer(
method cl_int (line 5299) | cl_int enqueueWriteBuffer(
method cl_int (line 5324) | cl_int enqueueCopyBuffer(
method cl_int (line 5348) | cl_int enqueueReadBufferRect(
method cl_int (line 5387) | cl_int enqueueWriteBufferRect(
method cl_int (line 5426) | cl_int enqueueCopyBufferRect(
method cl_int (line 5471) | cl_int enqueueFillBuffer(
method cl_int (line 5500) | cl_int enqueueReadImage(
method cl_int (line 5527) | cl_int enqueueWriteImage(
method cl_int (line 5554) | cl_int enqueueCopyImage(
method cl_int (line 5587) | cl_int enqueueFillImage(
method cl_int (line 5621) | cl_int enqueueFillImage(
method cl_int (line 5655) | cl_int enqueueFillImage(
method cl_int (line 5683) | cl_int enqueueCopyImageToBuffer(
method cl_int (line 5708) | cl_int enqueueCopyBufferToImage(
method cl_int (line 5787) | cl_int enqueueUnmapMemObject(
method cl_int (line 5820) | cl_int enqueueMarkerWithWaitList(
method cl_int (line 5850) | cl_int enqueueBarrierWithWaitList(
method cl_int (line 5873) | cl_int enqueueMigrateMemObjects(
method cl_int (line 5906) | cl_int enqueueNDRangeKernel(
method cl_int (line 5932) | cl_int enqueueTask(
method cl_int (line 5952) | cl_int enqueueNativeKernel(
method CL_EXT_PREFIX__VERSION_1_1_DEPRECATED (line 5992) | CL_EXT_PREFIX__VERSION_1_1_DEPRECATED
method CL_EXT_PREFIX__VERSION_1
Copy disabled (too large)
Download .json
Condensed preview — 1931 files, each showing path, character count, and a content snippet. Download the .json file for the full structured content (19,301K chars).
[
{
"path": ".gitattributes",
"chars": 31,
"preview": "*.ipynb linguist-documentation\n"
},
{
"path": ".github/CONTRIBUTING.md",
"chars": 0,
"preview": ""
},
{
"path": ".github/ISSUE_TEMPLATE.md",
"chars": 302,
"preview": "If this is a build issue, please fill out the template below.\n\n### System information\n\n* Operating system:\n* Compiler ve"
},
{
"path": ".github/PULL_REQUEST_TEMPLATE.md",
"chars": 0,
"preview": ""
},
{
"path": ".gitignore",
"chars": 1139,
"preview": "## General\n\n# Compiled Object files\n*.slo\n*.lo\n*.o\n*.cuo\n*.obj\n\n# Compiled Dynamic libraries\n*.so\n*.dylib\n*.dll\n\n# Compi"
},
{
"path": ".gitmodules",
"chars": 2576,
"preview": "[submodule \"third_party/pybind11\"]\n\tpath = third_party/pybind11\n\turl = https://github.com/pybind/pybind11.git\n[submodule"
},
{
"path": ".jenkins/README.md",
"chars": 690,
"preview": "# Jenkins\n\nThe scripts in this directory are the entrypoint for testing Caffe2.\n\nThe environment variable `BUILD_ENVIRON"
},
{
"path": ".jenkins/build.sh",
"chars": 5590,
"preview": "#!/bin/bash\n\nset -ex\n\nLOCAL_DIR=$(cd \"$(dirname \"${BASH_SOURCE[0]}\")\" && pwd)\nROOT_DIR=$(cd \"$LOCAL_DIR\"/.. && pwd)\n\n# S"
},
{
"path": ".jenkins/test.sh",
"chars": 3469,
"preview": "#!/bin/bash\n\nset -ex\n\n# Figure out which Python to use\nPYTHON=\"python\"\nif [ -n \"$BUILD_ENVIRONMENT\" ]; then\n if [[ \"$BU"
},
{
"path": ".travis/build.sh",
"chars": 1266,
"preview": "#!/bin/bash\nset -e\nset -x\n\nLOCAL_DIR=$( cd \"$( dirname \"${BASH_SOURCE[0]}\" )\" && pwd )\nROOT_DIR=$(dirname \"$LOCAL_DIR\")\n"
},
{
"path": ".travis/install.sh",
"chars": 7120,
"preview": "#!/bin/bash\nset -e\nset -x\n\nLOCAL_DIR=$( cd \"$( dirname \"${BASH_SOURCE[0]}\" )\" && pwd )\nROOT_DIR=$(dirname \"$LOCAL_DIR\")\n"
},
{
"path": ".travis/setup.sh",
"chars": 1660,
"preview": "#!/bin/bash\n# This script should be sourced, not executed\nset -e\n\nexport BUILD_ANDROID=false\nexport BUILD_CUDA=false\nexp"
},
{
"path": ".travis/test.sh",
"chars": 457,
"preview": "#!/bin/bash\nset -e\nset -x\n\nLOCAL_DIR=$( cd \"$( dirname \"${BASH_SOURCE[0]}\" )\" && pwd )\nROOT_DIR=$(dirname \"$LOCAL_DIR\")\n"
},
{
"path": ".travis.yml",
"chars": 783,
"preview": "os: linux\ndist: trusty\nsudo: required\nlanguage: cpp\ncompiler: gcc\n\nenv:\n global:\n - BUILD_CCACHE_DIR=~/build/ccache\n"
},
{
"path": "CMakeLists.txt",
"chars": 10290,
"preview": "cmake_minimum_required(VERSION 3.2 FATAL_ERROR)\n#cmake_policy(SET CMP0022 NEW)\n#cmake_policy(SET CMP0023 NEW)\n\n# ---[ Pr"
},
{
"path": "LICENSE",
"chars": 11357,
"preview": " Apache License\n Version 2.0, January 2004\n "
},
{
"path": "Makefile",
"chars": 527,
"preview": "# This makefile does nothing but delegating the actual building to cmake.\n\nall:\n\t@mkdir -p build && cd build && cmake .."
},
{
"path": "NOTICE",
"chars": 5572,
"preview": "Copyright (c) 2016-present, Facebook Inc. All rights reserved.\n\nAll contributions by Facebook:\nCopyright (c) 2016 Facebo"
},
{
"path": "README.md",
"chars": 1718,
"preview": "# Caffe2\n\n[](https://opensource.org/license"
},
{
"path": "VERSION_NUMBER",
"chars": 5,
"preview": "0.8.1"
},
{
"path": "appveyor.yml",
"chars": 1499,
"preview": "version: '{build}'\nclone_folder: c:\\projects\\caffe2\nenvironment:\n matrix:\n - USE_CUDA: OFF\n CMAKE_BUILD_TYPE: R"
},
{
"path": "binaries/CMakeLists.txt",
"chars": 1522,
"preview": "caffe2_binary_target(\"convert_caffe_image_db.cc\")\ncaffe2_binary_target(\"convert_db.cc\")\ncaffe2_binary_target(\"make_cifar"
},
{
"path": "binaries/caffe2_benchmark.cc",
"chars": 8435,
"preview": "#include <fstream>\n#include <iterator>\n#include <string>\n\n#include \"caffe2/core/blob_serialization.h\"\n#include \"caffe2/c"
},
{
"path": "binaries/convert_caffe_image_db.cc",
"chars": 3390,
"preview": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "binaries/convert_db.cc",
"chars": 1918,
"preview": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "binaries/convert_encoded_to_raw_leveldb.cc",
"chars": 5300,
"preview": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "binaries/core_overhead_benchmark.cc",
"chars": 6472,
"preview": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "binaries/db_throughput.cc",
"chars": 3356,
"preview": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "binaries/inspect_gpus.cc",
"chars": 1642,
"preview": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "binaries/make_cifar_db.cc",
"chars": 5150,
"preview": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "binaries/make_image_db.cc",
"chars": 8003,
"preview": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "binaries/make_mnist_db.cc",
"chars": 4974,
"preview": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "binaries/predictor_verifier.cc",
"chars": 1985,
"preview": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "binaries/print_core_object_sizes.cc",
"chars": 1427,
"preview": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "binaries/print_registered_core_operators.cc",
"chars": 2396,
"preview": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "binaries/run_plan.cc",
"chars": 1424,
"preview": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "binaries/run_plan_mpi.cc",
"chars": 1741,
"preview": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "binaries/speed_benchmark.cc",
"chars": 6092,
"preview": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "binaries/split_db.cc",
"chars": 2742,
"preview": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "binaries/tutorial_blob.cc",
"chars": 2554,
"preview": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "binaries/zmq_feeder.cc",
"chars": 2228,
"preview": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "caffe/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "caffe/proto/CMakeLists.txt",
"chars": 574,
"preview": "file(GLOB Caffe_PROTOBUF_FILES \"${CMAKE_CURRENT_SOURCE_DIR}/*.proto\")\n\ncaffe2_protobuf_generate_cpp_py(Caffe_PROTO_SRCS "
},
{
"path": "caffe/proto/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "caffe/proto/caffe.proto",
"chars": 57545,
"preview": "syntax = \"proto2\";\n\npackage caffe;\n\n// Specifies the shape (dimensions) of a Blob.\nmessage BlobShape {\n repeated int64 "
},
{
"path": "caffe2/.clang-format",
"chars": 2540,
"preview": "---\nAccessModifierOffset: -1\nAlignAfterOpenBracket: AlwaysBreak\nAlignConsecutiveAssignments: false\nAlignConsecutiveDecla"
},
{
"path": "caffe2/CMakeLists.txt",
"chars": 10642,
"preview": "# ---[ Declare source file lists\n\n# ---[ Add respective subdirectories\n# Note: the folders that are being commented out "
},
{
"path": "caffe2/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "caffe2/contrib/CMakeLists.txt",
"chars": 647,
"preview": "add_subdirectory(aten)\nadd_subdirectory(gloo)\nadd_subdirectory(nccl)\nadd_subdirectory(prof)\nadd_subdirectory(shm_mutex)\n"
},
{
"path": "caffe2/contrib/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "caffe2/contrib/aten/CMakeLists.txt",
"chars": 1124,
"preview": "if(USE_ATEN)\n if(NOT USE_CUDA)\n set(NO_CUDA ON)\n endif()\n set(TORCH_CUDA_ARCH_LIST \"3.5 5.2 6.0 6.1+PTX\")\n set(TO"
},
{
"path": "caffe2/contrib/aten/README.md",
"chars": 2537,
"preview": "# An ATen operator for Caffe2\n\n[ATen](https://github.com/zdevito/aten) is a simple tensor library thats exposes the Tens"
},
{
"path": "caffe2/contrib/aten/aten_op.cc",
"chars": 1053,
"preview": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "caffe2/contrib/aten/aten_op.h",
"chars": 52,
"preview": "#include \"caffe2/caffe2/contrib/aten/gen_aten_op.h\"\n"
},
{
"path": "caffe2/contrib/aten/aten_op_cuda.cc",
"chars": 1013,
"preview": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "caffe2/contrib/aten/aten_op_template.h",
"chars": 8106,
"preview": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "caffe2/contrib/aten/aten_test.py",
"chars": 2838,
"preview": "# Copyright (c) 2016-present, Facebook, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you m"
},
{
"path": "caffe2/contrib/aten/docs/pytorch_to_caffe2.md",
"chars": 5421,
"preview": "# Using ONNX and ATen to export models from PyTorch to Caffe2\n\nWhen using ONNX to export a model from PyTorch into Caffe"
},
{
"path": "caffe2/contrib/aten/docs/sample.py",
"chars": 1622,
"preview": "import numpy as np\n\nfrom torch import nn\nfrom torch.autograd import Variable, Function\nimport torch.onnx\n\nimport onnx\nim"
},
{
"path": "caffe2/contrib/aten/gen_op.py",
"chars": 10069,
"preview": "#!/bin/env python\n\n# Copyright (c) 2016-present, Facebook, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the "
},
{
"path": "caffe2/contrib/cuda-convnet2/LICENSE",
"chars": 11358,
"preview": "\n Apache License\n Version 2.0, January 2004\n "
},
{
"path": "caffe2/contrib/cuda-convnet2/README.md",
"chars": 233,
"preview": "# cuda-convnet2\nAutomatically exported from code.google.com/p/cuda-convnet2\n\nYou can read the documentation in two ways:"
},
{
"path": "caffe2/contrib/cuda-convnet2/build.sh",
"chars": 1916,
"preview": "#!/bin/sh\n# Copyright 2014 Google Inc. All rights reserved.\n# \n# Licensed under the Apache License, Version 2.0 (the \"Li"
},
{
"path": "caffe2/contrib/cuda-convnet2/convdata.py",
"chars": 14675,
"preview": "# Copyright 2014 Google Inc. All rights reserved.\n# \n# Licensed under the Apache License, Version 2.0 (the \"License\");\n#"
},
{
"path": "caffe2/contrib/cuda-convnet2/convnet.py",
"chars": 14400,
"preview": "# Copyright 2014 Google Inc. All rights reserved.\n# \n# Licensed under the Apache License, Version 2.0 (the \"License\");\n#"
},
{
"path": "caffe2/contrib/cuda-convnet2/cudaconv3/Makefile",
"chars": 3590,
"preview": "################################################################################\n#\n# Copyright 1993-2012 NVIDIA Corporat"
},
{
"path": "caffe2/contrib/cuda-convnet2/cudaconv3/include/conv_util.cuh",
"chars": 34710,
"preview": "/*\n * Copyright 2014 Google Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License"
},
{
"path": "caffe2/contrib/cuda-convnet2/cudaconv3/include/cudaconv2.cuh",
"chars": 4925,
"preview": "/*\n * Copyright 2014 Google Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License"
},
{
"path": "caffe2/contrib/cuda-convnet2/cudaconv3/src/conv_util.cu",
"chars": 160232,
"preview": "/*\n * Copyright 2014 Google Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License"
},
{
"path": "caffe2/contrib/cuda-convnet2/cudaconv3/src/filter_acts.cu",
"chars": 165557,
"preview": "/*\n * Copyright 2014 Google Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License"
},
{
"path": "caffe2/contrib/cuda-convnet2/cudaconv3/src/img_acts.cu",
"chars": 218326,
"preview": "/*\n * Copyright 2014 Google Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License"
},
{
"path": "caffe2/contrib/cuda-convnet2/cudaconv3/src/weight_acts.cu",
"chars": 174590,
"preview": "/*\n * Copyright 2014 Google Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License"
},
{
"path": "caffe2/contrib/cuda-convnet2/cudaconvnet/Makefile",
"chars": 3939,
"preview": "################################################################################\n#\n# Copyright 1993-2012 NVIDIA Corporat"
},
{
"path": "caffe2/contrib/cuda-convnet2/cudaconvnet/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "caffe2/contrib/cuda-convnet2/cudaconvnet/include/actbroadcaster.cuh",
"chars": 1805,
"preview": "/*\n * Copyright 2014 Google Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License"
},
{
"path": "caffe2/contrib/cuda-convnet2/cudaconvnet/include/convnet.cuh",
"chars": 5363,
"preview": "/*\n * Copyright 2014 Google Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License"
},
{
"path": "caffe2/contrib/cuda-convnet2/cudaconvnet/include/copypipeline.cuh",
"chars": 6838,
"preview": "/*\n * Copyright 2014 Google Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License"
},
{
"path": "caffe2/contrib/cuda-convnet2/cudaconvnet/include/cost.cuh",
"chars": 1456,
"preview": "/*\n * Copyright 2014 Google Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License"
},
{
"path": "caffe2/contrib/cuda-convnet2/cudaconvnet/include/data.cuh",
"chars": 2690,
"preview": "/*\n * Copyright 2014 Google Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License"
},
{
"path": "caffe2/contrib/cuda-convnet2/cudaconvnet/include/gradreducer.cuh",
"chars": 2461,
"preview": "/*\n * Copyright 2014 Google Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License"
},
{
"path": "caffe2/contrib/cuda-convnet2/cudaconvnet/include/jpeg.h",
"chars": 1829,
"preview": "/*\n * Copyright 2014 Google Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License"
},
{
"path": "caffe2/contrib/cuda-convnet2/cudaconvnet/include/layer.cuh",
"chars": 28469,
"preview": "/*\n * Copyright 2014 Google Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License"
},
{
"path": "caffe2/contrib/cuda-convnet2/cudaconvnet/include/layer_kernels.cuh",
"chars": 3487,
"preview": "/*\n * Copyright 2014 Google Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License"
},
{
"path": "caffe2/contrib/cuda-convnet2/cudaconvnet/include/lr.cuh",
"chars": 2043,
"preview": "/*\n * Copyright 2014 Google Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License"
},
{
"path": "caffe2/contrib/cuda-convnet2/cudaconvnet/include/memorysource.cuh",
"chars": 1951,
"preview": "/*\n * Copyright 2014 Google Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License"
},
{
"path": "caffe2/contrib/cuda-convnet2/cudaconvnet/include/messages.cuh",
"chars": 3130,
"preview": "/*\n * Copyright 2014 Google Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License"
},
{
"path": "caffe2/contrib/cuda-convnet2/cudaconvnet/include/neuron.cuh",
"chars": 14966,
"preview": "/*\n * Copyright 2014 Google Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License"
},
{
"path": "caffe2/contrib/cuda-convnet2/cudaconvnet/include/pipedispenser.cuh",
"chars": 4148,
"preview": "/*\n * Copyright 2014 Google Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License"
},
{
"path": "caffe2/contrib/cuda-convnet2/cudaconvnet/include/pyconvnet.cuh",
"chars": 1270,
"preview": "/*\n * Copyright 2014 Google Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License"
},
{
"path": "caffe2/contrib/cuda-convnet2/cudaconvnet/include/reducepipeline.cuh",
"chars": 5706,
"preview": "/*\n * Copyright 2014 Google Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License"
},
{
"path": "caffe2/contrib/cuda-convnet2/cudaconvnet/include/streambroadcast.cuh",
"chars": 1917,
"preview": "/*\n * Copyright 2014 Google Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License"
},
{
"path": "caffe2/contrib/cuda-convnet2/cudaconvnet/include/timer.cuh",
"chars": 1247,
"preview": "/*\n * Copyright 2014 Google Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License"
},
{
"path": "caffe2/contrib/cuda-convnet2/cudaconvnet/include/util.cuh",
"chars": 4307,
"preview": "/*\n * Copyright 2014 Google Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License"
},
{
"path": "caffe2/contrib/cuda-convnet2/cudaconvnet/include/weights.cuh",
"chars": 4981,
"preview": "/*\n * Copyright 2014 Google Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License"
},
{
"path": "caffe2/contrib/cuda-convnet2/cudaconvnet/include/worker.cuh",
"chars": 3009,
"preview": "/*\n * Copyright 2014 Google Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License"
},
{
"path": "caffe2/contrib/cuda-convnet2/cudaconvnet/src/actbroadcaster.cu",
"chars": 3070,
"preview": "/*\n * Copyright 2014 Google Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License"
},
{
"path": "caffe2/contrib/cuda-convnet2/cudaconvnet/src/convnet.cu",
"chars": 27069,
"preview": "/*\n * Copyright 2014 Google Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License"
},
{
"path": "caffe2/contrib/cuda-convnet2/cudaconvnet/src/copypipeline.cu",
"chars": 12840,
"preview": "/*\n * Copyright 2014 Google Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License"
},
{
"path": "caffe2/contrib/cuda-convnet2/cudaconvnet/src/cost.cu",
"chars": 3298,
"preview": "/*\n * Copyright 2014 Google Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License"
},
{
"path": "caffe2/contrib/cuda-convnet2/cudaconvnet/src/data.cu",
"chars": 2598,
"preview": "/*\n * Copyright 2014 Google Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License"
},
{
"path": "caffe2/contrib/cuda-convnet2/cudaconvnet/src/gradreducer.cu",
"chars": 6749,
"preview": "/*\n * Copyright 2014 Google Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License"
},
{
"path": "caffe2/contrib/cuda-convnet2/cudaconvnet/src/jpeg.cpp",
"chars": 5274,
"preview": "/*\n * Copyright 2014 Google Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License"
},
{
"path": "caffe2/contrib/cuda-convnet2/cudaconvnet/src/layer.cu",
"chars": 90354,
"preview": "/*\n * Copyright 2014 Google Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License"
},
{
"path": "caffe2/contrib/cuda-convnet2/cudaconvnet/src/layer_kernels.cu",
"chars": 21818,
"preview": "/*\n * Copyright 2014 Google Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License"
},
{
"path": "caffe2/contrib/cuda-convnet2/cudaconvnet/src/lr.cu",
"chars": 3592,
"preview": "/*\n * Copyright 2014 Google Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License"
},
{
"path": "caffe2/contrib/cuda-convnet2/cudaconvnet/src/memorysource.cu",
"chars": 4008,
"preview": "/*\n * Copyright 2014 Google Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License"
},
{
"path": "caffe2/contrib/cuda-convnet2/cudaconvnet/src/neuron.cu",
"chars": 2084,
"preview": "/*\n * Copyright 2014 Google Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License"
},
{
"path": "caffe2/contrib/cuda-convnet2/cudaconvnet/src/pyconvnet.cu",
"chars": 9190,
"preview": "/*\n * Copyright 2014 Google Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License"
},
{
"path": "caffe2/contrib/cuda-convnet2/cudaconvnet/src/reducepipeline.cu",
"chars": 13162,
"preview": "/*\n * Copyright 2014 Google Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License"
},
{
"path": "caffe2/contrib/cuda-convnet2/cudaconvnet/src/streambroadcast.cu",
"chars": 7319,
"preview": "/*\n * Copyright 2014 Google Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License"
},
{
"path": "caffe2/contrib/cuda-convnet2/cudaconvnet/src/util.cu",
"chars": 6262,
"preview": "/*\n * Copyright 2014 Google Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License"
},
{
"path": "caffe2/contrib/cuda-convnet2/cudaconvnet/src/weights.cu",
"chars": 13994,
"preview": "/*\n * Copyright 2014 Google Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License"
},
{
"path": "caffe2/contrib/cuda-convnet2/cudaconvnet/src/worker.cu",
"chars": 10571,
"preview": "/*\n * Copyright 2014 Google Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License"
},
{
"path": "caffe2/contrib/cuda-convnet2/initw.py",
"chars": 2020,
"preview": "# Copyright 2014 Google Inc. All rights reserved.\n# \n# Licensed under the Apache License, Version 2.0 (the \"License\");\n#"
},
{
"path": "caffe2/contrib/cuda-convnet2/layer.py",
"chars": 82481,
"preview": "# Copyright 2014 Google Inc. All rights reserved.\n# \n# Licensed under the Apache License, Version 2.0 (the \"License\");\n#"
},
{
"path": "caffe2/contrib/cuda-convnet2/layers/layer-params-cifar10-11pct.cfg",
"chars": 1266,
"preview": "# 11% error on CIFAR-10 - layer parameter file\n# Methodology:\n# 1. Train on batches 1-4, use batch 5 for validation.\n# 2"
},
{
"path": "caffe2/contrib/cuda-convnet2/layers/layer-params-imagenet-1gpu.cfg",
"chars": 1376,
"preview": "[conv1]\nmomW=0.9\nmomB=0.9\nwc=0.0005\nwball=0.00\nepsW=dexp[base=0.01;tgtFactor=250;numSteps=4]\nepsB=dexp[base=0.02;tgtFact"
},
{
"path": "caffe2/contrib/cuda-convnet2/layers/layer-params-imagenet-2gpu-data.cfg",
"chars": 1376,
"preview": "[conv1]\nmomW=0.9\nmomB=0.9\nwc=0.0005\nwball=0.00\nepsW=dexp[base=0.02;tgtFactor=250;numSteps=4]\nepsB=dexp[base=0.04;tgtFact"
},
{
"path": "caffe2/contrib/cuda-convnet2/layers/layer-params-imagenet-2gpu-model.cfg",
"chars": 2572,
"preview": "[conv1a]\nepsW=dexp[base=0.02;tgtFactor=250;numSteps=4]\nepsB=dexp[base=0.04;tgtFactor=25;numSteps=2]\nmomW=0.9\nmomB=0.9\nwc"
},
{
"path": "caffe2/contrib/cuda-convnet2/layers/layer-params-imagenet-4gpu-data-model.cfg",
"chars": 2448,
"preview": "[conv1]\nmomW=0.9\nmomB=0.9\nwc=0.0005\nwball=0.00\nepsW=dexp[base=0.04;tgtFactor=250;numSteps=4]\nepsB=dexp[base=0.08;tgtFact"
},
{
"path": "caffe2/contrib/cuda-convnet2/layers/layer-params-imagenet-4gpu-data.cfg",
"chars": 1376,
"preview": "[conv1]\nmomW=0.9\nmomB=0.9\nwc=0.0005\nwball=0.00\nepsW=dexp[base=0.04;tgtFactor=250;numSteps=4]\nepsB=dexp[base=0.08;tgtFact"
},
{
"path": "caffe2/contrib/cuda-convnet2/layers/layers-cifar10-11pct.cfg",
"chars": 990,
"preview": "[data]\ntype=data\ndataIdx=0\n\n[labels]\ntype=data\ndataIdx=1\n\n[conv1]\ntype=conv\ninputs=data\nchannels=3\nfilters=64\npadding=2\n"
},
{
"path": "caffe2/contrib/cuda-convnet2/layers/layers-imagenet-1gpu.cfg",
"chars": 1496,
"preview": "[data]\ntype=data\ndataIdx=0\n\n[labvec]\ntype=data\ndataIdx=1\n\n[conv1]\ntype=conv\ninputs=data\nchannels=3\nfilters=64\npadding=0\n"
},
{
"path": "caffe2/contrib/cuda-convnet2/layers/layers-imagenet-2gpu-data.cfg",
"chars": 1482,
"preview": "[data]\ntype=data\ndataIdx=0\n\n[labvec]\ntype=data\ndataIdx=1\n\n[conv1]\ntype=conv\ninputs=data\nchannels=3\nfilters=64\npadding=0\n"
},
{
"path": "caffe2/contrib/cuda-convnet2/layers/layers-imagenet-2gpu-model.cfg",
"chars": 3112,
"preview": "[data]\ntype=data\ndataIdx=0\n\n[labels]\ntype=data\ndataIdx=1\n\n[conv1a]\ntype=conv\ninputs=data\nchannels=3\nfilters=48\npadding=0"
},
{
"path": "caffe2/contrib/cuda-convnet2/layers/layers-imagenet-4gpu-data-model.cfg",
"chars": 2730,
"preview": "[data]\ntype=data\ndataIdx=0\n\n[labvec]\ntype=data\ndataIdx=1\n\n[conv1]\ntype=conv\ninputs=data\nchannels=3\nfilters=64\npadding=0\n"
},
{
"path": "caffe2/contrib/cuda-convnet2/layers/layers-imagenet-4gpu-data.cfg",
"chars": 1490,
"preview": "[data]\ntype=data\ndataIdx=0\n\n[labvec]\ntype=data\ndataIdx=1\n\n[conv1]\ntype=conv\ninputs=data\nchannels=3\nfilters=64\npadding=0\n"
},
{
"path": "caffe2/contrib/cuda-convnet2/make-data/make-data.py",
"chars": 7155,
"preview": "# Copyright 2014 Google Inc. All rights reserved.\n# \n# Licensed under the Apache License, Version 2.0 (the \"License\");\n#"
},
{
"path": "caffe2/contrib/cuda-convnet2/make-data/pyext/Makefile",
"chars": 1433,
"preview": "# Copyright 2014 Google Inc. All rights reserved.\n# \n# Licensed under the Apache License, Version 2.0 (the \"License\");\n#"
},
{
"path": "caffe2/contrib/cuda-convnet2/make-data/pyext/__init__.py",
"chars": 597,
"preview": "# Copyright 2014 Google Inc. All rights reserved.\n# \n# Licensed under the Apache License, Version 2.0 (the \"License\");\n#"
},
{
"path": "caffe2/contrib/cuda-convnet2/make-data/pyext/include/pyext.h",
"chars": 1555,
"preview": "/*\n * Copyright 2014 Google Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License"
},
{
"path": "caffe2/contrib/cuda-convnet2/make-data/pyext/src/pyext.cpp",
"chars": 4578,
"preview": "/*\n * Copyright 2014 Google Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License"
},
{
"path": "caffe2/contrib/cuda-convnet2/nvmatrix/Makefile",
"chars": 3564,
"preview": "################################################################################\n#\n# Copyright 1993-2012 NVIDIA Corporat"
},
{
"path": "caffe2/contrib/cuda-convnet2/nvmatrix/include/memory.cuh",
"chars": 11199,
"preview": "/*\n * Copyright 2014 Google Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License"
},
{
"path": "caffe2/contrib/cuda-convnet2/nvmatrix/include/nvmatrix.cuh",
"chars": 32013,
"preview": "/*\n * Copyright 2014 Google Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License"
},
{
"path": "caffe2/contrib/cuda-convnet2/nvmatrix/include/nvmatrix_kernels.cuh",
"chars": 27599,
"preview": "/*\n * Copyright 2014 Google Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License"
},
{
"path": "caffe2/contrib/cuda-convnet2/nvmatrix/include/nvmatrix_operators.cuh",
"chars": 12141,
"preview": "/*\n * Copyright 2014 Google Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License"
},
{
"path": "caffe2/contrib/cuda-convnet2/nvmatrix/src/memory.cu",
"chars": 2842,
"preview": "/*\n * Copyright 2014 Google Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License"
},
{
"path": "caffe2/contrib/cuda-convnet2/nvmatrix/src/nvmatrix.cu",
"chars": 60287,
"preview": "/*\n * Copyright 2014 Google Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License"
},
{
"path": "caffe2/contrib/cuda-convnet2/nvmatrix/src/nvmatrix_kernels.cu",
"chars": 2663,
"preview": "/*\n * Copyright 2014 Google Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License"
},
{
"path": "caffe2/contrib/cuda-convnet2/python_util/__init__.py",
"chars": 597,
"preview": "# Copyright 2014 Google Inc. All rights reserved.\n# \n# Licensed under the Apache License, Version 2.0 (the \"License\");\n#"
},
{
"path": "caffe2/contrib/cuda-convnet2/python_util/data.py",
"chars": 7803,
"preview": "# Copyright 2014 Google Inc. All rights reserved.\n# \n# Licensed under the Apache License, Version 2.0 (the \"License\");\n#"
},
{
"path": "caffe2/contrib/cuda-convnet2/python_util/gpumodel.py",
"chars": 14896,
"preview": "# Copyright 2014 Google Inc. All rights reserved.\n# \n# Licensed under the Apache License, Version 2.0 (the \"License\");\n#"
},
{
"path": "caffe2/contrib/cuda-convnet2/python_util/options.py",
"chars": 16577,
"preview": "# Copyright 2014 Google Inc. All rights reserved.\n# \n# Licensed under the Apache License, Version 2.0 (the \"License\");\n#"
},
{
"path": "caffe2/contrib/cuda-convnet2/python_util/util.py",
"chars": 2825,
"preview": "# Copyright 2014 Google Inc. All rights reserved.\n# \n# Licensed under the Apache License, Version 2.0 (the \"License\");\n#"
},
{
"path": "caffe2/contrib/cuda-convnet2/shownet.py",
"chars": 18206,
"preview": "# Copyright 2014 Google Inc. All rights reserved.\n# \n# Licensed under the Apache License, Version 2.0 (the \"License\");\n#"
},
{
"path": "caffe2/contrib/cuda-convnet2/util/Makefile",
"chars": 1539,
"preview": "# Copyright 2014 Google Inc. All rights reserved.\n# \n# Licensed under the Apache License, Version 2.0 (the \"License\");\n#"
},
{
"path": "caffe2/contrib/cuda-convnet2/util/include/matrix.h",
"chars": 9729,
"preview": "/*\n * Copyright 2014 Google Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License"
},
{
"path": "caffe2/contrib/cuda-convnet2/util/include/matrix_funcs.h",
"chars": 2393,
"preview": "/*\n * Copyright 2014 Google Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License"
},
{
"path": "caffe2/contrib/cuda-convnet2/util/include/queue.h",
"chars": 3044,
"preview": "/*\n * Copyright 2014 Google Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License"
},
{
"path": "caffe2/contrib/cuda-convnet2/util/include/sync.h",
"chars": 2054,
"preview": "/*\n * Copyright 2014 Google Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License"
},
{
"path": "caffe2/contrib/cuda-convnet2/util/include/thread.h",
"chars": 3121,
"preview": "/*\n * Copyright 2014 Google Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License"
},
{
"path": "caffe2/contrib/cuda-convnet2/util/src/matrix.cpp",
"chars": 25540,
"preview": "/*\n * Copyright 2014 Google Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License"
},
{
"path": "caffe2/contrib/docker-ubuntu-14.04/Dockerfile",
"chars": 3788,
"preview": "FROM ubuntu:14.04\nMAINTAINER caffe-dev <caffe-dev@googlegroups.com>\n\n# A docker container with CUDA and caffe2 installed"
},
{
"path": "caffe2/contrib/gloo/CMakeLists.txt",
"chars": 895,
"preview": "if(USE_GLOO)\n set(Caffe2_CONTRIB_GLOO_CPU_SRC\n \"${CMAKE_CURRENT_SOURCE_DIR}/allgather_ops.cc\"\n \"${CMAKE_CURRENT_S"
},
{
"path": "caffe2/contrib/gloo/allgather_ops.cc",
"chars": 1964,
"preview": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "caffe2/contrib/gloo/allgather_ops.h",
"chars": 3810,
"preview": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "caffe2/contrib/gloo/allreduce_ops.cc",
"chars": 2663,
"preview": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "caffe2/contrib/gloo/allreduce_ops.h",
"chars": 4234,
"preview": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "caffe2/contrib/gloo/allreduce_ops_gpu.cc",
"chars": 3803,
"preview": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "caffe2/contrib/gloo/barrier_ops.cc",
"chars": 819,
"preview": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "caffe2/contrib/gloo/barrier_ops.h",
"chars": 2319,
"preview": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "caffe2/contrib/gloo/broadcast_ops.cc",
"chars": 1799,
"preview": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "caffe2/contrib/gloo/broadcast_ops.h",
"chars": 3778,
"preview": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "caffe2/contrib/gloo/broadcast_ops_gpu.cc",
"chars": 1860,
"preview": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "caffe2/contrib/gloo/common.cc",
"chars": 1978,
"preview": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "caffe2/contrib/gloo/common.h",
"chars": 2278,
"preview": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "caffe2/contrib/gloo/common_world_ops.cc",
"chars": 1220,
"preview": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "caffe2/contrib/gloo/common_world_ops.h",
"chars": 7823,
"preview": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "caffe2/contrib/gloo/common_world_ops_gpu.cc",
"chars": 1402,
"preview": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "caffe2/contrib/gloo/context.cc",
"chars": 823,
"preview": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "caffe2/contrib/gloo/context.h",
"chars": 653,
"preview": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "caffe2/contrib/gloo/gloo_test.py",
"chars": 24766,
"preview": "# Copyright (c) 2016-present, Facebook, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you m"
},
{
"path": "caffe2/contrib/gloo/py_export.cc",
"chars": 294,
"preview": "#include <gloo/common/error.h>\n#include <pybind11/pybind11.h>\n\nnamespace gloo {\nnamespace python {\n\nnamespace py = pybin"
},
{
"path": "caffe2/contrib/gloo/reduce_scatter_ops.cc",
"chars": 1558,
"preview": "/**\n * Copyright (c) 2018-present, Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "caffe2/contrib/gloo/reduce_scatter_ops.h",
"chars": 3984,
"preview": "/**\n * Copyright (c) 2018-present, Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "caffe2/contrib/gloo/store_handler.cc",
"chars": 1226,
"preview": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "caffe2/contrib/gloo/store_handler.h",
"chars": 1434,
"preview": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "caffe2/contrib/nccl/CMakeLists.txt",
"chars": 427,
"preview": "if(USE_NCCL)\n message(STATUS \"Include NCCL operators\")\n set(Caffe2_CONTRIB_NCCL_GPU_SRC\n \"${CMAKE_CURRENT_S"
},
{
"path": "caffe2/contrib/nccl/cuda_nccl_gpu.cc",
"chars": 9519,
"preview": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "caffe2/contrib/nccl/cuda_nccl_gpu.h",
"chars": 2081,
"preview": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "caffe2/contrib/nccl/cuda_nccl_op_gpu.cc",
"chars": 6712,
"preview": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "caffe2/contrib/nccl/nccl_ops_test.py",
"chars": 8950,
"preview": "# Copyright (c) 2016-present, Facebook, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you m"
},
{
"path": "caffe2/contrib/nervana/CMakeLists.txt",
"chars": 455,
"preview": "if(USE_NERVANA_GPU)\n message(STATUS \"Include Nervana operators\")\n set(Caffe2_CONTRIB_NCCL_GPU_SRC\n \"${CMAKE_CURRENT"
},
{
"path": "caffe2/contrib/nervana/nervana.h",
"chars": 1320,
"preview": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "caffe2/contrib/nervana/nervana_c_api.cu",
"chars": 12620,
"preview": "/*\n * Copyright 2015 Baidu USA, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lic"
},
{
"path": "caffe2/contrib/nervana/nervana_c_api.h",
"chars": 5804,
"preview": "/*\n * Copyright 2015 Baidu USA, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lic"
},
{
"path": "caffe2/contrib/nervana/nervana_fc_op_gpu.cc",
"chars": 996,
"preview": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "caffe2/contrib/nervana/nervana_fc_op_gpu_test.cc",
"chars": 2594,
"preview": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "caffe2/contrib/nervana/nervana_init_gpu.cc",
"chars": 2385,
"preview": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "caffe2/contrib/nervana/nervana_math_gpu.cc",
"chars": 1815,
"preview": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "caffe2/contrib/nnpack/nnpack_ops.cc",
"chars": 13263,
"preview": "/**\n * Copyright (c) 2016-present, Facebook, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n"
},
{
"path": "caffe2/contrib/nnpack/nnpack_ops_test.py",
"chars": 8963,
"preview": "# Copyright (c) 2016-present, Facebook, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you m"
},
{
"path": "caffe2/contrib/playground/AnyExp.py",
"chars": 19514,
"preview": "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __futu"
},
{
"path": "caffe2/contrib/playground/AnyExpOnTerm.py",
"chars": 1046,
"preview": "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __futu"
},
{
"path": "caffe2/contrib/playground/ModuleRegister.py",
"chars": 4206,
"preview": "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __futu"
},
{
"path": "caffe2/contrib/playground/README.md",
"chars": 10704,
"preview": "# Playground for Caffe2 Models\n\nPlayground is created to allow modelers to reuse the components of their models. It is "
},
{
"path": "caffe2/contrib/playground/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "caffe2/contrib/playground/checkpoint.py",
"chars": 6984,
"preview": "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __futu"
},
{
"path": "caffe2/contrib/playground/compute_loss.py",
"chars": 1110,
"preview": "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __futu"
}
]
// ... and 1731 more files (download for full content)
About this extraction
This page contains the full source code of the Yangqing/caffe2 GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 1931 files (17.8 MB), approximately 4.8M tokens, and a symbol index with 9818 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.