Full Code of graphcore/poptorch for AI

sdk-release-3.4 c2a8b17762f1 cached
537 files
3.4 MB
926.8k tokens
3940 symbols
1 requests
Download .txt
Showing preview only (3,703K chars total). Download the full file or copy to clipboard to get everything.
Repository: graphcore/poptorch
Branch: sdk-release-3.4
Commit: c2a8b17762f1
Files: 537
Total size: 3.4 MB

Directory structure:
gitextract_ur1femal/

├── .ci/
│   └── view_component_trigger/
│       ├── Jenkinsfile
│       └── jobs.groovy
├── .clang-format
├── .clang-tidy
├── .github/
│   ├── CODEOWNERS
│   └── workflows/
│       └── apply_linters.yml
├── .gitignore
├── .pre-commit-config.yaml
├── .pylintrc
├── .style.yapf
├── CMakeLists.txt
├── License.txt
├── MANIFEST.in
├── README.md
├── config.buildenv.py
├── docs/
│   ├── common/
│   │   ├── _static/
│   │   │   └── css/
│   │   │       └── custom_rtd.css
│   │   ├── conf.py
│   │   └── custom_dic
│   ├── poptorch_geometric/
│   │   ├── common/
│   │   │   └── conf.py
│   │   └── user_guide/
│   │       ├── index.rst
│   │       ├── installation.rst
│   │       ├── intro.rst
│   │       ├── legal.rst
│   │       ├── performance.rst
│   │       ├── reference.rst
│   │       ├── supported_operations.rst
│   │       └── tutorials.rst
│   └── user_guide/
│       ├── CMakeLists.txt
│       ├── api.py
│       ├── batching.rst
│       ├── buffers.py
│       ├── debugging.py
│       ├── debugging.rst
│       ├── device_iterations.py
│       ├── error_handling.py
│       ├── example.rst
│       ├── experimental.rst
│       ├── hostio_optimisation.rst
│       ├── index.rst
│       ├── inferenceModel.py
│       ├── installation.rst
│       ├── intro.rst
│       ├── legal.rst
│       ├── mnist.py
│       ├── overview.rst
│       ├── phased_execution.py
│       ├── pipeline_simple.py
│       ├── poptorch.conf
│       ├── poptorch_training_simple.py
│       ├── precompilation.py
│       ├── pytorch_to_poptorch.rst
│       ├── reference.rst
│       ├── replica_grouped_weights.py
│       ├── sumAnchorReturnType.py
│       ├── supported_ops.rst
│       └── trainingModel.py
├── examples/
│   ├── CMakeLists.txt
│   ├── bert_ipu.py
│   ├── lstm.py
│   ├── mnist.py
│   └── simple_adder.py
├── popart_compiler/
│   ├── CMakeLists.txt
│   ├── include/
│   │   └── popart_compiler/
│   │       ├── CodeletsCompilation.hpp
│   │       ├── Compiler.hpp
│   │       ├── CompilerOperationMacros.inc.hpp
│   │       ├── ManuallyAddedOperations.inc.hpp
│   │       ├── SupportedOperations.inc.hpp
│   │       └── Utils.hpp
│   ├── source/
│   │   ├── CodeletsCompilation.cpp
│   │   ├── Compiler.cpp
│   │   ├── CompilerImpl.cpp
│   │   ├── SessionOptions.cpp
│   │   ├── Utils.cpp
│   │   ├── custom_operations/
│   │   │   ├── Embedding.cpp
│   │   │   ├── FastGatherLastDim.cpp
│   │   │   ├── FastGatherLastDim.hpp
│   │   │   ├── FastGatherLastDimBwdCodelets.inc.cpp
│   │   │   ├── FastGatherLastDimFwdCodelets.inc.cpp
│   │   │   ├── HostOp.cpp
│   │   │   ├── TorchSoftplus.cpp
│   │   │   ├── TorchSoftplus.hpp
│   │   │   ├── UpsampleBilinear2d.cpp
│   │   │   └── UpsampleBilinear2dCodelets.inc.cpp
│   │   └── include/
│   │       └── popart_compiler/
│   │           ├── CompilerImpl.hpp
│   │           ├── CompilerOptions.hpp
│   │           ├── CustomOps.hpp
│   │           ├── MultiConvBuilder.hpp
│   │           └── SessionOptionsImpl.hpp
│   └── types/
│       └── include/
│           └── popart_compiler/
│               ├── CompilerTypes.hpp
│               └── PopartEnums.hpp
├── poptorch/
│   ├── CMakeLists.txt
│   ├── include/
│   │   └── poptorch/
│   │       ├── DispatchTracer.hpp
│   │       ├── InplaceOps.hpp
│   │       ├── LowerToPopart.hpp
│   │       ├── LowerToPopartFactories.hpp
│   │       ├── PoplarExecutable.hpp
│   │       ├── SessionOptionsParser.hpp
│   │       └── Utils.hpp
│   └── source/
│       ├── AddDetachOperations.cpp
│       ├── AddSubgraphConnectionNodes.cpp
│       ├── AliasProcessing.cpp
│       ├── CPUOffloadingCleanUp.cpp
│       ├── CompilerOps.cpp.inc
│       ├── ErrorOnUnsupportedAten.cpp
│       ├── FixupSetAvailableMemory.cpp
│       ├── GNNOptimizations.cpp
│       ├── GatherWithExpandedIndicesOptimization.cpp
│       ├── ImplicitCasting.cpp
│       ├── InplaceOps.cpp
│       ├── LowerToPopart.cpp
│       ├── LowerToPopartFactories.cpp
│       ├── OpBuilder.cpp
│       ├── OverlappedIO.cpp
│       ├── PopartCanonicalization.cpp
│       ├── PopartLateCanonicalization.cpp
│       ├── PoplarExecutable.cpp
│       ├── PoptorchStaticInit.hpp
│       ├── PoptorchSymbols.cpp
│       ├── PoptorchSymbols.hpp
│       ├── RemoveSurplusIdentityLosses.cpp
│       ├── RequiresGrad.cpp
│       ├── SessionOptionsParser.cpp
│       ├── Utils.cpp
│       ├── dispatch_tracer/
│       │   ├── CMakeLists.txt
│       │   ├── CommonHelperFunctions.cpp
│       │   ├── CommonHelperFunctions.hpp
│       │   ├── InplaceAliasMapper.cpp
│       │   ├── InplaceAliasMapper.hpp
│       │   ├── README.md
│       │   ├── RegisterAtenOverloads.cpp
│       │   ├── RegisterMetaOps.cpp.inc
│       │   ├── RegisterOptionalAtenOps.cpp.inc
│       │   ├── Tensor.cpp
│       │   ├── Tensor.hpp
│       │   ├── TypeInferenceHandler.cpp
│       │   ├── TypeInferenceHandler.hpp
│       │   ├── ValueMapper.cpp
│       │   ├── ValueMapper.hpp
│       │   └── dispatchers/
│       │       ├── IDispatch.cpp
│       │       ├── IDispatch.hpp
│       │       ├── JitDispatch.cpp
│       │       └── JitDispatch.hpp
│       ├── include/
│       │   └── poptorch/
│       │       ├── AliasProcessing.hpp
│       │       ├── CompilerOps.inc.hpp
│       │       ├── ImplicitCasting.hpp
│       │       ├── InplaceOpsPyTorch.hpp_nolint
│       │       ├── OpBuilder.hpp
│       │       ├── OverlappedIO.hpp
│       │       ├── PopartCanonicalization.hpp
│       │       ├── RequiresGrad.hpp
│       │       └── TypeAndConstantCanonicalization.hpp
│       ├── popart_canonicalization/
│       │   ├── ActivationOps.cpp
│       │   ├── ArithmeticOps.cpp
│       │   ├── AtenHandlers.gen.cpp
│       │   ├── BilinearOps.cpp
│       │   ├── BitwiseOps.cpp
│       │   ├── BlasOps.cpp
│       │   ├── ConstantOps.cpp
│       │   ├── ConvolutionOps.cpp
│       │   ├── CustomOps.cpp
│       │   ├── DistanceOps.cpp
│       │   ├── DropoutOps.cpp
│       │   ├── EinsumOp.cpp
│       │   ├── EinsumOp.hpp
│       │   ├── EmbeddingOps.cpp
│       │   ├── IndexOps.cpp
│       │   ├── LossOps.cpp
│       │   ├── NormalizationOps.cpp
│       │   ├── OtherOps.cpp
│       │   ├── PoolingOps.cpp
│       │   ├── PopartCanonicalizationUtils.cpp
│       │   ├── PopartCanonicalizationUtils.hpp
│       │   ├── PoptorchHandlers.gen.cpp
│       │   ├── PyGTorchScatterOps.cpp
│       │   ├── PyGTorchSplineConvOps.cpp
│       │   ├── RNNOps.cpp
│       │   ├── RandomSamplingOps.cpp
│       │   ├── ReduceOps.cpp
│       │   ├── ReshapeOps.cpp
│       │   ├── ScatterReduction.cpp
│       │   ├── ScatterReduction.hpp
│       │   ├── SliceOps.cpp
│       │   ├── SoftmaxOps.cpp
│       │   ├── TensorOps.cpp
│       │   └── pyg_torch_cluster/
│       │       ├── FpsOp.cpp
│       │       ├── GridOp.cpp
│       │       └── NearestOp.cpp
│       └── type_and_constant_canonicalization/
│           ├── AddListNumElements.cpp
│           ├── CanonicaliseConstants.cpp
│           ├── CastUnsupportedInputs.cpp
│           ├── CheckAndChangeOutputTypes.cpp
│           ├── EvaluateConstexprs.cpp
│           └── MakeConstantIntParams.cpp
├── poptorch_compiler/
│   └── pytorch_bridge/
│       ├── CMakeLists.txt
│       ├── IpuSession.cpp
│       └── include/
│           └── pytorch_bridge/
│               ├── CompilerOptions.hpp
│               ├── CompilerTypes.hpp
│               ├── DebugInfo.hpp
│               └── IpuSession.hpp
├── poptorch_err/
│   ├── CMakeLists.txt
│   ├── exception_info/
│   │   └── poptorch_err/
│   │       └── ExceptionInfo.hpp
│   ├── include/
│   │   └── poptorch_err/
│   │       └── ExceptionHandling.hpp
│   └── source/
│       └── ExceptionHandling.cpp
├── poptorch_geometric/
│   ├── CMakeLists.txt
│   ├── License.txt
│   ├── MANIFEST.in
│   ├── README.md
│   ├── config.buildenv.py
│   ├── poptorch_geometric_third_party_licenses.txt
│   ├── pyproject.toml
│   ├── python/
│   │   ├── CMakeLists.txt
│   │   ├── __init__.py
│   │   ├── cluster_loader.py
│   │   ├── collate.py
│   │   ├── common.py
│   │   ├── dataloader.py
│   │   ├── fixed_size_options.py
│   │   ├── masker.py
│   │   ├── neighbor_loader.py
│   │   ├── ops/
│   │   │   ├── __init__.py
│   │   │   ├── aggregation_base.py
│   │   │   ├── cluster_gcn_conv.py
│   │   │   ├── hetero_linear.py
│   │   │   ├── instance_norm.py
│   │   │   ├── knn.py
│   │   │   ├── knn_graph.py
│   │   │   ├── knn_interpolate.py
│   │   │   ├── mf_conv.py
│   │   │   └── radius.py
│   │   ├── override.py
│   │   ├── py.typed
│   │   ├── pyg_cluster_loader.py
│   │   ├── pyg_collate.py
│   │   ├── pyg_dataloader.py
│   │   ├── stream_packing_sampler.py
│   │   ├── types.py
│   │   └── utils.py
│   ├── requirements.txt
│   ├── setup.cfg
│   └── setup.py
├── poptorch_logging/
│   ├── CMakeLists.txt
│   ├── include/
│   │   └── poptorch_logging/
│   │       ├── Error.hpp
│   │       ├── Logging.hpp
│   │       ├── LoggingLight.hpp
│   │       └── Tracepoint.hpp
│   └── source/
│       ├── Error.cpp
│       ├── Logging.cpp
│       └── Tracepoint.cpp
├── poptorch_third_party_licenses.txt
├── pyproject.toml
├── python/
│   ├── CMakeLists.txt
│   ├── __init__.py
│   ├── _args_parser.py
│   ├── _dataloader.py
│   ├── _impl.py
│   ├── _logging.py
│   ├── _optimizer_attributes.py
│   ├── _options_config.py
│   ├── _options_impl.py
│   ├── _poplar_executor.py
│   ├── _poptorch_data.py
│   ├── _printing.py
│   ├── _utils.py
│   ├── enums.py
│   ├── ops.py
│   ├── optim.py
│   ├── options.py
│   ├── poptorch.cpp
│   ├── profiling.py
│   ├── py.typed
│   └── testing.py
├── requirements.txt
├── scripts/
│   ├── PopAtenHandlers.py
│   ├── PopParse.py
│   ├── PopTorchHandlers.py
│   ├── __init__.py
│   ├── apply_linters.py
│   ├── check_spelling.py
│   ├── create_buildenv.py
│   ├── docs_build.py
│   ├── download_external_datasets.py
│   ├── enable.sh.in
│   ├── generate_poppyg_package.py
│   ├── generate_python_package.py
│   ├── popgen/
│   │   ├── __init__.py
│   │   ├── api.py
│   │   ├── generator.py
│   │   ├── helpers.py
│   │   ├── onnx.py
│   │   ├── operatorfactory.py
│   │   ├── poptorch.py
│   │   ├── registry.py
│   │   ├── transform.py
│   │   └── values.py
│   ├── set_version.py
│   └── utils/
│       └── _utils.py
├── setup.cfg
├── setup.py
├── tests/
│   ├── .gitignore
│   ├── CMakeLists.txt
│   ├── activations_test.py
│   ├── attach_detach_test.py
│   ├── attach_detach_wait_for_ipu_test.py
│   ├── batching_test.py
│   ├── bert_small_and_medium_test.py
│   ├── blas_test.py
│   ├── bool_support_test.py
│   ├── buffers_test.py
│   ├── conftest.py
│   ├── convs_test.py
│   ├── cpp/
│   │   ├── CMakeLists.txt
│   │   └── GNNOptimizationsTest.cpp
│   ├── cpu_op_test.py
│   ├── ctc_decoder_test.py
│   ├── custom_loss_test.py
│   ├── custom_ops/
│   │   ├── CMakeLists.txt
│   │   ├── custom_add_scalar_op.cpp
│   │   ├── custom_add_scalar_vec_op.cpp
│   │   ├── custom_add_vec_scalar_mul_op.cpp
│   │   ├── custom_cube_op.cpp
│   │   ├── custom_leaky_relu_op.cpp
│   │   ├── custom_many_attribute_op.cpp
│   │   ├── custom_reduce_op.cpp
│   │   └── custom_three_input_reduce_op.cpp
│   ├── custom_ops_attributes_test.py
│   ├── custom_ops_test.py
│   ├── dataloader_test.py
│   ├── debug_tensors_test.py
│   ├── distance_ops_test.py
│   ├── exception_test.py
│   ├── fine_tuning_test.py
│   ├── functional_test.py
│   ├── generate_test_file.py
│   ├── gnn/
│   │   ├── .gitignore
│   │   ├── benchgnn/
│   │   │   ├── README.md
│   │   │   ├── benchgnn.py
│   │   │   ├── datasets.py
│   │   │   ├── models.py
│   │   │   ├── requirements.txt
│   │   │   └── utils.py
│   │   ├── benchgnn_ops/
│   │   │   ├── README.md
│   │   │   ├── benchgnn_ops.py
│   │   │   ├── builder.py
│   │   │   ├── example_configs/
│   │   │   │   ├── common.yaml
│   │   │   │   ├── scatter_testcase1.yaml
│   │   │   │   └── scatter_testcase2.yaml
│   │   │   ├── metrics.py
│   │   │   ├── ops.py
│   │   │   └── requirements.txt
│   │   ├── conftest.py
│   │   ├── nn/
│   │   │   ├── aggr/
│   │   │   │   ├── aggr_utils.py
│   │   │   │   ├── conftest.py
│   │   │   │   ├── test_attention.py
│   │   │   │   ├── test_basic.py
│   │   │   │   ├── test_deep_sets.py
│   │   │   │   ├── test_equilibrium.py
│   │   │   │   ├── test_fused.py
│   │   │   │   ├── test_gmt.py
│   │   │   │   ├── test_gru.py
│   │   │   │   ├── test_lstm.py
│   │   │   │   ├── test_mlp_aggr.py
│   │   │   │   ├── test_multi.py
│   │   │   │   ├── test_quantile.py
│   │   │   │   ├── test_scaler.py
│   │   │   │   ├── test_set2set.py
│   │   │   │   ├── test_set_transformer.py
│   │   │   │   └── test_sort.py
│   │   │   ├── conftest.py
│   │   │   ├── conv/
│   │   │   │   ├── conv_utils.py
│   │   │   │   ├── test_agnn_conv.py
│   │   │   │   ├── test_antisymmetric_conv.py
│   │   │   │   ├── test_appnp.py
│   │   │   │   ├── test_arma_conv.py
│   │   │   │   ├── test_cg_conv.py
│   │   │   │   ├── test_cheb_conv.py
│   │   │   │   ├── test_cluster_gcn_conv.py
│   │   │   │   ├── test_dna_conv.py
│   │   │   │   ├── test_edge_conv.py
│   │   │   │   ├── test_eg_conv.py
│   │   │   │   ├── test_fa_conv.py
│   │   │   │   ├── test_feast_conv.py
│   │   │   │   ├── test_film_conv.py
│   │   │   │   ├── test_gat_conv.py
│   │   │   │   ├── test_gated_graph_conv.py
│   │   │   │   ├── test_gatv2_conv.py
│   │   │   │   ├── test_gcn2_conv.py
│   │   │   │   ├── test_gcn_conv.py
│   │   │   │   ├── test_gen_conv.py
│   │   │   │   ├── test_general_conv.py
│   │   │   │   ├── test_gin_conv.py
│   │   │   │   ├── test_gmm_conv.py
│   │   │   │   ├── test_gps_conv.py
│   │   │   │   ├── test_graph_conv.py
│   │   │   │   ├── test_gravnet_conv.py
│   │   │   │   ├── test_han_conv.py
│   │   │   │   ├── test_heat_conv.py
│   │   │   │   ├── test_hetero_conv.py
│   │   │   │   ├── test_hgt_conv.py
│   │   │   │   ├── test_hypergraph_conv.py
│   │   │   │   ├── test_le_conv.py
│   │   │   │   ├── test_lg_conv.py
│   │   │   │   ├── test_mf_conv.py
│   │   │   │   ├── test_nn_conv.py
│   │   │   │   ├── test_pan_conv.py
│   │   │   │   ├── test_pdn_conv.py
│   │   │   │   ├── test_pna_conv.py
│   │   │   │   ├── test_point_conv.py
│   │   │   │   ├── test_point_gnn_conv.py
│   │   │   │   ├── test_point_transformer_conv.py
│   │   │   │   ├── test_ppf_conv.py
│   │   │   │   ├── test_res_gated_graph_conv.py
│   │   │   │   ├── test_rgat_conv.py
│   │   │   │   ├── test_rgcn_conv.py
│   │   │   │   ├── test_sage_conv.py
│   │   │   │   ├── test_sg_conv.py
│   │   │   │   ├── test_signed_conv.py
│   │   │   │   ├── test_simple_conv.py
│   │   │   │   ├── test_spline_conv.py
│   │   │   │   ├── test_ssg_conv.py
│   │   │   │   ├── test_supergat_conv.py
│   │   │   │   ├── test_tag_conv.py
│   │   │   │   ├── test_transformer_conv.py
│   │   │   │   ├── test_wl_conv.py
│   │   │   │   ├── test_wl_conv_continuous.py
│   │   │   │   └── test_x_conv.py
│   │   │   ├── dense/
│   │   │   │   ├── dense_utils.py
│   │   │   │   └── test_convs.py
│   │   │   ├── functional/
│   │   │   │   ├── test_bro.py
│   │   │   │   └── test_gini.py
│   │   │   ├── kge/
│   │   │   │   ├── kge_utils.py
│   │   │   │   ├── test_complex.py
│   │   │   │   ├── test_distmult.py
│   │   │   │   ├── test_rotate.py
│   │   │   │   └── test_transe.py
│   │   │   ├── nn_utils.py
│   │   │   ├── norm/
│   │   │   │   ├── norm_utils.py
│   │   │   │   ├── test_batch_norm.py
│   │   │   │   ├── test_diff_group_norm.py
│   │   │   │   ├── test_graph_norm.py
│   │   │   │   ├── test_graph_size_norm.py
│   │   │   │   ├── test_instance_norm.py
│   │   │   │   ├── test_layer_norm.py
│   │   │   │   ├── test_mean_subtraction_norm.py
│   │   │   │   ├── test_msg_norm.py
│   │   │   │   └── test_pair_norm.py
│   │   │   ├── pool/
│   │   │   │   ├── pool_utils.py
│   │   │   │   ├── test_asap.py
│   │   │   │   ├── test_avg_pool.py
│   │   │   │   ├── test_consecutive.py
│   │   │   │   ├── test_decimation.py
│   │   │   │   ├── test_edge_pool.py
│   │   │   │   ├── test_fps.py
│   │   │   │   ├── test_glob.py
│   │   │   │   ├── test_graclus.py
│   │   │   │   ├── test_max_pool.py
│   │   │   │   ├── test_mem_pool.py
│   │   │   │   ├── test_pan_pool.py
│   │   │   │   ├── test_pool_knn.py
│   │   │   │   ├── test_radius.py
│   │   │   │   ├── test_sag_pool.py
│   │   │   │   ├── test_select_topk.py
│   │   │   │   ├── test_topk_pool.py
│   │   │   │   └── test_voxel_grid.py
│   │   │   ├── test_linear.py
│   │   │   ├── test_loss.py
│   │   │   ├── test_mish.py
│   │   │   ├── test_sequential.py
│   │   │   └── unpool/
│   │   │       └── test_interpolate.py
│   │   ├── ops/
│   │   │   ├── test_knn.py
│   │   │   ├── test_knn_graph.py
│   │   │   ├── test_knn_interpolate.py
│   │   │   ├── test_nearest.py
│   │   │   ├── test_radius_op.py
│   │   │   ├── test_spline_conv_ops.py
│   │   │   └── test_to_dense_batch.py
│   │   ├── test_basic_gnn.py
│   │   ├── test_cluster_loader.py
│   │   ├── test_collate.py
│   │   ├── test_dataloader.py
│   │   ├── test_encoding.py
│   │   ├── test_fixed_size_options.py
│   │   ├── test_masker.py
│   │   ├── test_model_args.py
│   │   ├── test_neighbor_loader.py
│   │   ├── test_register_custom_args.py
│   │   ├── test_stream_packing_sampler.py
│   │   └── utils.py
│   ├── grouping_scatters_gathers_test.py
│   ├── gru_test.py
│   ├── half_float_test.py
│   ├── half_test.py
│   ├── helpers.py
│   ├── hooks_test.py
│   ├── if_test.py
│   ├── index_ops_test.py
│   ├── inplace_test.py
│   ├── inputs_test.py
│   ├── io_performance_test.py
│   ├── ipu_print_tensor_test.py
│   ├── loop_test.py
│   ├── losses_test.py
│   ├── lstm_test.py
│   ├── math_ops_test.py
│   ├── misc_nn_layers_test.py
│   ├── misc_test.py
│   ├── multiconv_test.py
│   ├── non_contiguous_tensors_test.py
│   ├── norms_test.py
│   ├── ops_test.py
│   ├── optimizers_test.py
│   ├── options_test.py
│   ├── other_ops_test.py
│   ├── outputs_test.py
│   ├── overlapped_io_test.py
│   ├── phased_execution_test.py
│   ├── pipelining_test.py
│   ├── pooling_and_padding_test.py
│   ├── popdist_test.py
│   ├── poplar_executor_test.py
│   ├── precompilation_test.py
│   ├── pyg_torch_scatter_test.py
│   ├── random_sampling_test.py
│   ├── reduce_ops_test.py
│   ├── replicated_graph_test.py
│   ├── requires_grad_test.py
│   ├── rnn_test.py
│   ├── sharding_test.py
│   ├── slice_test.py
│   ├── tensor_ops_test.py
│   ├── test_doc_urls.py
│   ├── test_perf_counters.py
│   ├── timeout_handler.py
│   ├── torch_nn_test.py
│   ├── torchvision_inference_test.py
│   ├── type_support_test.py
│   └── weights_writing_test.py
└── version.json

================================================
FILE CONTENTS
================================================

================================================
FILE: .ci/view_component_trigger/Jenkinsfile
================================================
@Library('sw-jenkins-library@view-component-trigger') _

viewComponentTrigger(jobsFilepath: '.ci/view_component_trigger/jobs.groovy')


================================================
FILE: .ci/view_component_trigger/jobs.groovy
================================================
[
    [
         job: '/poptorch/poptorch_pr',
         parameters: [
             string(name: 'GCCI_BRANCH', value: 'mk2-main')
         ]
    ],
]


================================================
FILE: .clang-format
================================================
Language: Cpp
BasedOnStyle: llvm


================================================
FILE: .clang-tidy
================================================
Checks: '*, -abseil*, -altera*, -android*, -cppcoreguidelines*, -cert*, -modernize*, -boost*, -google*, -fuchsia*, -hicpp*, -objc*, -llvm*, -bugprone-exception-escape, -readability-uppercase-literal-suffix, -misc-non-private-member-variables-in-classes, -fuchsia-default-arguments-declarations, -fuchsia-default-arguments-calls, -readability-magic-numbers, -fuchsia-overloaded-operator, -performance-noexcept-move-constructor, -concurrency-mt-unsafe, -readability-function-cognitive-complexity, -misc-throw-by-value-catch-by-reference, -misc-no-recursion, -bugprone-narrowing-conversions, -bugprone-easily-swappable-parameters, -readability-make-member-function-const, -readability-use-anyofallof, -readability-identifier-length,-misc-confusable-identifiers,-bugprone-reserved-identifier,-misc-unused-using-decls'
WarningsAsErrors: '*'
HeaderFilterRegex: ''
AnalyzeTemporaryDtors: false
CheckOptions:
  - key:             readability-identifier-naming.NamespaceCase
    value:           lower_case
  - key:             readability-identifier-naming.ClassCase
    value:           CamelCase
  - key:             readability-identifier-naming.StructCase
    value:           CamelCase
  - key:             readability-identifier-naming.PrivateMemberPrefix
    value:           _
  - key:             readability-identifier-naming.ProtectedMemberPrefix
    value:           _
  - key:             readability-identifier-naming.MemberCase
    value:           lower_case
  - key:             readability-identifier-naming.StructCase
    value:           CamelCase
  - key:             readability-identifier-naming.MethodCase
    value:           camelBack
  - key:             readability-identifier-naming.FunctionCase
    value:           camelBack
  - key:             readability-identifier-naming.VariableCase
    value:           lower_case
  - key:             misc-throw-by-value-catch-by-reference.MaxSize
    value:           '8'


================================================
FILE: .github/CODEOWNERS
================================================
* @Software-GCAI/poptorch


================================================
FILE: .github/workflows/apply_linters.yml
================================================
name: apply_linters.py git trailer check

on:
  push:
    branches: [mk2-main]
  pull_request:
    branches: [mk2-main]

jobs:
  apply_linters:
    timeout-minutes: 10
    name: apply_linters.py git trailer check
    runs-on: [self-hosted, linux]
    steps:
    - uses: actions/checkout@v3
      with:
        # 0 indicates fetch history for all branches and tags.
        # By default the checkout action only checks out the PR
        # ref. However apply_linters.py needs run git commands
        # that reference origin/mk2-main.
        fetch-depth: 0
        # Checkout the head instead of the merge commit
        ref: ${{ github.event.pull_request.head.sha }}
    - name: Verify most recent commit's git trailer
      run: python scripts/apply_linters.py --check-trailer


================================================
FILE: .gitignore
================================================
build
__pycache__
.linters
.cache
.vscode
test_data


================================================
FILE: .pre-commit-config.yaml
================================================
repos:
-   repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v2.3.0
    hooks:
    -   id: check-yaml
    -   id: end-of-file-fixer
    -   id: check-merge-conflict
    -   id: trailing-whitespace
-   repo: local
    hooks:
    -   id: apply_linters
        name: apply_linters
        entry: scripts/apply_linters.py
        language: python
        args: [-a, --add-trailer-on-success, --debug, --git-strategy=pre-commit]
        additional_dependencies: [pyyaml==6.0.0, packaging==23.0.0, colorama==0.4.6]
        # For the git trailer to be correct apply_linters.py must be applied to all the files.


================================================
FILE: .pylintrc
================================================
[MASTER]
# Prevent pylint from incorrectly reporting 'has no member' for C modules
# by allowing them to be loaded (does not happen by default due to security
# concerns)
extension-pkg-whitelist=numpy,torch

# Specify a configuration file.
#rcfile=

# Python code to execute, usually for sys.path manipulation such as
# pygtk.require().
# This adds <root_dir>/tests to the path (Needed for tests in subfolders to find helpers.py)
init-hook="from pylint.config import find_pylintrc; import os, sys; sys.path.append(os.path.join(os.path.dirname(os.path.realpath(find_pylintrc())), 'tests'))"

# Profiled execution.
profile=no

# Add files or directories to the blacklist. They should be base names, not
# paths.
ignore=git

# Pickle collected data for later comparisons.
persistent=yes

# List of plugins (as comma separated values of python modules names) to load,
# usually to register additional checkers.
load-plugins=


[MESSAGES CONTROL]

# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
# multiple time. See also the "--disable" option for examples.
enable=indexing-exception,old-raise-syntax

# Disable the message, report, category or checker with the given id(s). You
# can either give multiple identifiers separated by comma (,) or put this
# option multiple times (only on the command line, not in the configuration
# file where it should appear only once).You can also use "--disable=all" to
# disable everything first and then reenable specific checks. For example, if
# you want to run only the similarities checker, you can use "--disable=all
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use"--disable=all --enable=classes
# --disable=W"
disable=global-statement,no-self-use,import-error,missing-docstring,invalid-name,redefined-builtin,too-few-public-methods,redefined-outer-name,no-name-in-module,not-callable,too-many-instance-attributes,too-many-branches,too-many-locals,too-many-arguments,too-many-statements

# not-callable leads to false positives due to PyTorch's tensor.py


# Set the cache size for astng objects.
cache-size=500


[REPORTS]

# Set the output format. Available formats are text, parseable, colorized, msvs
# (visual studio) and html. You can also give a reporter class, eg
# mypackage.mymodule.MyReporterClass.
output-format=text

# Put messages in a separate file for each module / package specified on the
# command line instead of printing them on stdout. Reports (if any) will be
# written in a file name "pylint_global.[txt|html]".
files-output=no

# Tells whether to display a full report or only the messages
reports=no

# Python expression which should return a note less than 10 (10 is the highest
# note). You have access to the variables errors warning, statement which
# respectively contain the number of errors / warnings messages and the total
# number of statements analyzed. This is used by the global evaluation report
# (RP0004).
evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)

# Add a comment according to your evaluation note. This is used by the global
# evaluation report (RP0004).
comment=no

# Template used to display messages. This is a python new-style format string
# used to format the message information. See doc for all details
#msg-template=


[TYPECHECK]

# Tells whether missing members accessed in mixin class should be ignored. A
# mixin class is detected if its name ends with "mixin" (case insensitive).
ignore-mixin-members=yes

# List of classes names for which member attributes should not be checked
# (useful for classes with attributes dynamically set).
# Workaround for pylint incorrectly reporting 'has no member' for torch
# https://github.com/pytorch/pytorch/issues/701
ignored-classes=SQLObject,torch
ignored-modules=torch

# When zope mode is activated, add a predefined set of Zope acquired attributes
# to generated-members.
zope=no

# List of members which are set dynamically and missed by pylint inference
# system, and so shouldn't trigger E0201 when accessed. Python regular
# expressions are accepted.
generated-members=REQUEST,acl_users,aq_parent

# List of decorators that create context managers from functions, such as
# contextlib.contextmanager.
contextmanager-decorators=contextlib.contextmanager,contextlib2.contextmanager


[VARIABLES]

# Tells whether we should check for unused import in __init__ files.
init-import=no

# A regular expression matching the beginning of the name of dummy variables
# (i.e. not used).
dummy-variables-rgx=^\*{0,2}(_$|unused_|dummy_)

# List of additional names supposed to be defined in builtins. Remember that
# you should avoid to define new builtins when possible.
additional-builtins=


[BASIC]

# Required attributes for module, separated by a comma
required-attributes=

# List of builtins function names that should not be used, separated by a comma
bad-functions=apply,input,reduce


# Disable the report(s) with the given id(s).
# All non-Google reports are disabled by default.
disable-report=R0001,R0002,R0003,R0004,R0101,R0102,R0201,R0202,R0220,R0401,R0402,R0701,R0801,R0901,R0902,R0903,R0904,R0911,R0912,R0913,R0914,R0915,R0921,R0922,R0923

# Regular expression which should only match correct module names
module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$

# Regular expression which should only match correct module level names
const-rgx=^(_?[A-Z][A-Z0-9_]*|__[a-z0-9_]+__|_?[a-z][a-z0-9_]*)$

# Regular expression which should only match correct class names
class-rgx=^_?[A-Z][a-zA-Z0-9]*$

# Regular expression which should only match correct function names
function-rgx=^(?:(?P<camel_case>_?[A-Z][a-zA-Z0-9]*)|(?P<snake_case>_?[a-z][a-z0-9_]*))$

# Regular expression which should only match correct method names
method-rgx=^(?:(?P<exempt>__[a-z0-9_]+__|next)|(?P<camel_case>_{0,2}[A-Z][a-zA-Z0-9]*)|(?P<snake_case>_{0,2}[a-z][a-z0-9_]*))$

# Regular expression which should only match correct instance attribute names
attr-rgx=^_{0,2}[a-z][a-z0-9_]*$

# Regular expression which should only match correct argument names
argument-rgx=^[a-z][a-z0-9_]*$

# Regular expression which should only match correct variable names
variable-rgx=^[a-z][a-z0-9_]*$

# Regular expression which should only match correct attribute names in class
# bodies
class-attribute-rgx=^(_?[A-Z][A-Z0-9_]*|__[a-z0-9_]+__|_?[a-z][a-z0-9_]*)$

# Regular expression which should only match correct list comprehension /
# generator expression variable names
inlinevar-rgx=^[a-z][a-z0-9_]*$

# Good variable names which should always be accepted, separated by a comma
good-names=main,_

# Bad variable names which should always be refused, separated by a comma
bad-names=

# Regular expression which should only match function or class names that do
# not require a docstring.
no-docstring-rgx=(__.*__|main)

# Minimum line length for functions/classes that require docstrings, shorter
# ones are exempt.
docstring-min-length=10


[FORMAT]

# Maximum number of characters on a single line.
max-line-length=80

# Regexp for a line that is allowed to be longer than the limit.
ignore-long-lines=(?x)
  (^\s*(import|from)\s
   |\$Id:\s\/\/depot\/.+#\d+\s\$
   |^[a-zA-Z_][a-zA-Z0-9_]*\s*=\s*("[^"]\S+"|'[^']\S+')
   |^\s*\#\ LINT\.ThenChange
   |^[^#]*\#\ type:\ [a-zA-Z_][a-zA-Z0-9_.,[\] ]*$
   |pylint
   |"""
   |\#
   |lambda
   |(https?|ftp):)

# Allow the body of an if to be on the same line as the test if there is no
# else.
single-line-if-stmt=y

# List of optional constructs for which whitespace checking is disabled
no-space-check=trailing-comma

# Maximum number of lines in a module
max-module-lines=99999

# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
# tab).
indent-string='    '


[SIMILARITIES]

# Minimum lines number of a similarity.
min-similarity-lines=4

# Ignore comments when computing similarities.
ignore-comments=yes

# Ignore docstrings when computing similarities.
ignore-docstrings=yes

# Ignore imports when computing similarities.
ignore-imports=no


[MISCELLANEOUS]

# List of note tags to take in consideration, separated by a comma.
notes=


[IMPORTS]

# Deprecated modules which should not be used, separated by a comma
deprecated-modules=regsub,TERMIOS,Bastion,rexec,sets

# Create a graph of every (i.e. internal and external) dependencies in the
# given file (report RP0402 must not be disabled)
import-graph=

# Create a graph of external dependencies in the given file (report RP0402 must
# not be disabled)
ext-import-graph=

# Create a graph of internal dependencies in the given file (report RP0402 must
# not be disabled)
int-import-graph=


[CLASSES]

# List of interface methods to ignore, separated by a comma. This is used for
# instance to not check methods defines in Zope's Interface base class.
ignore-iface-methods=isImplementedBy,deferred,extends,names,namesAndDescriptions,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,adaptWith,is_implemented_by

# List of method names used to declare (i.e. assign) instance attributes.
defining-attr-methods=__init__,__new__,setUp

# List of valid names for the first argument in a class method.
valid-classmethod-first-arg=cls,class_

# List of valid names for the first argument in a metaclass class method.
valid-metaclass-classmethod-first-arg=mcs


[DESIGN]

# Maximum number of arguments for function / method
max-args=5

# Argument names that match this expression will be ignored. Default to name
# with leading underscore
ignored-argument-names=_.*

# Maximum number of locals for function / method body
max-locals=15

# Maximum number of return / yield for function / method body
max-returns=6

# Maximum number of branch for function / method body
max-branches=12

# Maximum number of statements in function / method body
max-statements=50

# Maximum number of parents for a class (see R0901).
max-parents=7

# Maximum number of attributes for a class (see R0902).
max-attributes=7

# Minimum number of public methods for a class (see R0903).
min-public-methods=2

# Maximum number of public methods for a class (see R0904).
max-public-methods=20


[EXCEPTIONS]

# Exceptions that will emit a warning when being caught. Defaults to
# "Exception"
overgeneral-exceptions=Exception,StandardError,BaseException


[AST]

# Maximum line length for lambdas
short-func-length=1

# List of module members that should be marked as deprecated.
# All of the string functions are listed in 4.1.4 Deprecated string functions
# in the Python 2.4 docs.
deprecated-members=string.atof,string.atoi,string.atol,string.capitalize,string.expandtabs,string.find,string.rfind,string.index,string.rindex,string.count,string.lower,string.split,string.rsplit,string.splitfields,string.join,string.joinfields,string.lstrip,string.rstrip,string.strip,string.swapcase,string.translate,string.upper,string.ljust,string.rjust,string.center,string.zfill,string.replace,sys.exitfunc


[DOCSTRING]

# List of exceptions that do not need to be mentioned in the Raises section of
# a docstring.
ignore-exceptions=AssertionError,NotImplementedError,StopIteration,TypeError



[TOKENS]

# Number of spaces of indent required when the last token on the preceding line
# is an open (, [, or {.
indent-after-paren=4


[GOOGLE LINES]

# Regexp for a proper copyright notice.
copyright=Copyright \d{4} The TensorFlow Authors\. +All [Rr]ights [Rr]eserved\.


================================================
FILE: .style.yapf
================================================
[style]
# Align closing bracket with visual indentation.
align_closing_bracket_with_visual_indent=True

# Allow dictionary keys to exist on multiple lines. For example:
#
#   x = {
#       ('this is the first element of a tuple',
#        'this is the second element of a tuple'):
#            value,
#   }
allow_multiline_dictionary_keys=False

# Allow lambdas to be formatted on more than one line.
allow_multiline_lambdas=False

# Allow splits before the dictionary value.
allow_split_before_dict_value=True

# Number of blank lines surrounding top-level function and class
# definitions.
blank_lines_around_top_level_definition=2

# Insert a blank line before a class-level docstring.
blank_line_before_class_docstring=False

# Insert a blank line before a module docstring.
blank_line_before_module_docstring=False

# Insert a blank line before a 'def' or 'class' immediately nested
# within another 'def' or 'class'. For example:
#
#   class Foo:
#                      # <------ this blank line
#     def method():
#       ...
blank_line_before_nested_class_or_def=False

# Do not split consecutive brackets. Only relevant when
# dedent_closing_brackets is set. For example:
#
#    call_func_that_takes_a_dict(
#        {
#            'key1': 'value1',
#            'key2': 'value2',
#        }
#    )
#
# would reformat to:
#
#    call_func_that_takes_a_dict({
#        'key1': 'value1',
#        'key2': 'value2',
#    })
coalesce_brackets=False

# The column limit.
column_limit=79

# The style for continuation alignment. Possible values are:
#
# - SPACE: Use spaces for continuation alignment. This is default behavior.
# - FIXED: Use fixed number (CONTINUATION_INDENT_WIDTH) of columns
#   (ie: CONTINUATION_INDENT_WIDTH/INDENT_WIDTH tabs) for continuation
#   alignment.
# - LESS: Slightly left if cannot vertically align continuation lines with
#   indent characters.
# - VALIGN-RIGHT: Vertically align continuation lines with indent
#   characters. Slightly right (one more indent character) if cannot
#   vertically align continuation lines with indent characters.
#
# For options FIXED, and VALIGN-RIGHT are only available when USE_TABS is
# enabled.
continuation_align_style=SPACE

# Indent width used for line continuations.
continuation_indent_width=4

# Put closing brackets on a separate line, dedented, if the bracketed
# expression can't fit in a single line. Applies to all kinds of brackets,
# including function definitions and calls. For example:
#
#   config = {
#       'key1': 'value1',
#       'key2': 'value2',
#   }        # <--- this bracket is dedented and on a separate line
#
#   time_series = self.remote_client.query_entity_counters(
#       entity='dev3246.region1',
#       key='dns.query_latency_tcp',
#       transform=Transformation.AVERAGE(window=timedelta(seconds=60)),
#       start_ts=now()-timedelta(days=3),
#       end_ts=now(),
#   )        # <--- this bracket is dedented and on a separate line
dedent_closing_brackets=False

# Disable the heuristic which places each list element on a separate line
# if the list is comma-terminated.
disable_ending_comma_heuristic=False

# Place each dictionary entry onto its own line.
each_dict_entry_on_separate_line=True

# The regex for an i18n comment. The presence of this comment stops
# reformatting of that line, because the comments are required to be
# next to the string they translate.
i18n_comment=

# The i18n function call names. The presence of this function stops
# reformattting on that line, because the string it has cannot be moved
# away from the i18n comment.
i18n_function_call=

# Indent the dictionary value if it cannot fit on the same line as the
# dictionary key. For example:
#
#   config = {
#       'key1':
#           'value1',
#       'key2': value1 +
#               value2,
#   }
indent_dictionary_value=False

# The number of columns to use for indentation.
indent_width=4

# Join short lines into one line. E.g., single line 'if' statements.
join_multiple_lines=True

# Do not include spaces around selected binary operators. For example:
#
#   1 + 2 * 3 - 4 / 5
#
# will be formatted as follows when configured with *,/:
#
#   1 + 2*3 - 4/5
#
no_spaces_around_selected_binary_operators=set([])

# Use spaces around default or named assigns.
spaces_around_default_or_named_assign=False

# Use spaces around the power operator.
spaces_around_power_operator=False

# The number of spaces required before a trailing comment.
spaces_before_comment=2

# Insert a space between the ending comma and closing bracket of a list,
# etc.
space_between_ending_comma_and_closing_bracket=True

# Split before arguments
split_all_comma_separated_values=False

# Split before arguments if the argument list is terminated by a
# comma.
split_arguments_when_comma_terminated=False

# Set to True to prefer splitting before '&', '|' or '^' rather than
# after.
split_before_bitwise_operator=True

# Split before the closing bracket if a list or dict literal doesn't fit on
# a single line.
split_before_closing_bracket=True

# Split before a dictionary or set generator (comp_for). For example, note
# the split before the 'for':
#
#   foo = {
#       variable: 'Hello world, have a nice day!'
#       for variable in bar if variable != 42
#   }
split_before_dict_set_generator=True

# Split after the opening paren which surrounds an expression if it doesn't
# fit on a single line.
split_before_expression_after_opening_paren=False

# If an argument / parameter list is going to be split, then split before
# the first argument.
split_before_first_argument=False

# Set to True to prefer splitting before 'and' or 'or' rather than
# after.
split_before_logical_operator=True

# Split named assignments onto individual lines.
split_before_named_assigns=True

# Set to True to split list comprehensions and generators that have
# non-trivial expressions and multiple clauses before each of these
# clauses. For example:
#
#   result = [
#       a_long_var + 100 for a_long_var in xrange(1000)
#       if a_long_var % 10]
#
# would reformat to something like:
#
#   result = [
#       a_long_var + 100
#       for a_long_var in xrange(1000)
#       if a_long_var % 10]
split_complex_comprehension=False

# The penalty for splitting right after the opening bracket.
split_penalty_after_opening_bracket=30

# The penalty for splitting the line after a unary operator.
split_penalty_after_unary_operator=10000

# The penalty for splitting right before an if expression.
split_penalty_before_if_expr=0

# The penalty of splitting the line around the '&', '|', and '^'
# operators.
split_penalty_bitwise_operator=300

# The penalty for splitting a list comprehension or generator
# expression.
split_penalty_comprehension=80

# The penalty for characters over the column limit.
split_penalty_excess_character=4500

# The penalty incurred by adding a line split to the unwrapped line. The
# more line splits added the higher the penalty.
split_penalty_for_added_line_split=30

# The penalty of splitting a list of "import as" names. For example:
#
#   from a_very_long_or_indented_module_name_yada_yad import (long_argument_1,
#                                                             long_argument_2,
#                                                             long_argument_3)
#
# would reformat to something like:
#
#   from a_very_long_or_indented_module_name_yada_yad import (
#       long_argument_1, long_argument_2, long_argument_3)
split_penalty_import_names=0

# The penalty of splitting the line around the 'and' and 'or'
# operators.
split_penalty_logical_operator=300

# Use the Tab character for indentation.
use_tabs=False


================================================
FILE: CMakeLists.txt
================================================
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
project(poptorch)
include(GNUInstallDirs)

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
  set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install CACHE PATH "Default to local install prefix" FORCE)
endif()

set(USE_PYTORCH_PACKAGE_HEADERS ON CACHE BOOL "Use the Torch headers distributed with the pytorch package.")
set(POPLAR_DIR CACHE PATH "Path to a Poplar install")
set(POPART_DIR CACHE PATH "Path to a Popart install")
set(SNAPSHOT "" CACHE STRING "Snapshot ID to use for the documentation")
set(SDK_DIR CACHE PATH "Path to an extracted SDK archive or to a Poplar & Popart install directory (Will populate POPLAR_DIR and POPART_DIR)")
set(BUILD_DOCS OFF CACHE BOOL "Build PopTorch's documentation")
set(COPY_TESTS OFF CACHE BOOL "Copy tests files to the build folder (instead of running them from the sources folder)")
set(ENABLE_WERROR ON CACHE BOOL "Treat C++ warnings as errors")
set(EXTRA_PYTEST_ARGS "" CACHE STRING "Extra arguments to pass to pytest when generating the list of tests to run")

# Always use the gold linker to avoid segfaults with PopART / Poplar on some OSes.
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
  find_program(GOLD_EXECUTABLE ld.gold REQUIRED)
  set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold")
  set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fuse-ld=gold")
  set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -fuse-ld=gold")
endif()

# Note: The next line is also parsed by scripts/utils/_utils.py
set(TORCH_VERSION 2.0.1)

# Convert to cmake list
string(REPLACE "." ";" TORCH_VERSION_AS_LIST ${TORCH_VERSION})

# Get the minor component. (Versions are Major.Minor.Patch)
list(GET TORCH_VERSION_AS_LIST 1 TORCH_MINOR_VERSION)

set(CMAKE_CONFIGURATION_TYPES "Release" "Debug" "MinSizeRel" "RelWithDebInfo")
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${CMAKE_CONFIGURATION_TYPES})
if(NOT CMAKE_BUILD_TYPE)
  list(GET CMAKE_CONFIGURATION_TYPES 0 CMAKE_BUILD_TYPE)
  message(STATUS "Setting build type to '${CMAKE_BUILD_TYPE}' as none was specified")
endif()
if(NOT CMAKE_BUILD_TYPE IN_LIST CMAKE_CONFIGURATION_TYPES)
  message(FATAL_ERROR "CMAKE_BUILD_TYPE must be one of ${CMAKE_CONFIGURATION_TYPES}")
endif()

if(USE_PYTORCH_PACKAGE_HEADERS)
  execute_process(COMMAND python3 -c "import torch; from pathlib import Path; print(Path(torch.__file__).parent, end='')"
    OUTPUT_VARIABLE TORCH_PATH)
  list(APPEND CMAKE_PREFIX_PATH ${TORCH_PATH})
  if(NOT TORCH_PATH)
    message(FATAL_ERROR "python3 -c \"import torch\" failed: check that your virtual environment is active and torch is installed")
  endif()
  execute_process(COMMAND python3 -c "import torch; import sys; sys.exit(3 if torch.version.debug else 4)"
    RESULT_VARIABLE TORCH_DEBUG)
  if(TORCH_DEBUG LESS 3 OR TORCH_DEBUG GREATER 4)
    message(FATAL_ERROR "python3 -c \"import torch\" failed: check that your virtual environment is active and torch is installed")
  endif()
  if (TORCH_DEBUG EQUAL 4)
    # We include torch header files which respond to this flag, so we have to
    # set it correctly in order to get consistent torch behaviour.
    add_compile_definitions(NDEBUG)
  endif()
endif()

if(EXISTS ${SDK_DIR})
  execute_process(COMMAND find ${SDK_DIR} -maxdepth 1 -type d -name "popart*"
    OUTPUT_VARIABLE POPART_DIR OUTPUT_STRIP_TRAILING_WHITESPACE)
  execute_process(COMMAND find ${SDK_DIR} -maxdepth 1 -type d -name "poplar-*" -o -name "poplar"
    OUTPUT_VARIABLE POPLAR_DIR OUTPUT_STRIP_TRAILING_WHITESPACE)
  if(NOT IS_DIRECTORY "${POPLAR_DIR}")
    message(FATAL_ERROR "Couldn't find a \"poplar\" or \"poplar-*\" folder in '${SDK_DIR}'")
  endif()
  if(NOT IS_DIRECTORY "${POPART_DIR}")
    message(FATAL_ERROR "Couldn't find a \"popart*\" folder in '${SDK_DIR}'")
  endif()
endif()

if(EXISTS ${POPLAR_DIR})
  list(APPEND CMAKE_PREFIX_PATH ${POPLAR_DIR})
  set(ENABLE_POPLAR_CMD "source ${POPLAR_DIR}/enable.sh")
else()
  # Check the package is not already in the path
  find_package(poplar)
  if(NOT poplar_FOUND)
    message(FATAL_ERROR "You must provide a path to a Poplar install using -DPOPLAR_DIR=/path/to/popart/build/install")
  endif()
endif()

if( EXISTS ${POPART_DIR} )
  list(APPEND CMAKE_PREFIX_PATH ${POPART_DIR})
  set(ENABLE_POPART_CMD "source ${POPART_DIR}/enable.sh")
else()
  find_package(popart COMPONENTS popart-only)
  if(NOT popart_FOUND)
    message(FATAL_ERROR "You must provide a path to a Popart build using -DPOPART_DIR=/path/to/popart/build")
  endif()
endif()

if(NOT popart_FOUND)
  find_package(popart REQUIRED COMPONENTS popart-only)
endif()
if(NOT poplar_FOUND)
  find_package(poplar REQUIRED)
endif()

get_target_property(POPLAR_LIB poplar LOCATION)
get_filename_component(POPLAR_DIR ${POPLAR_LIB} DIRECTORY)
# Run an install command that requires PopTorch, PopArt and Poplar to be in the PATH.
function(run_poptorch_install_command cmd working_directory cmd_name)
  install(CODE
    "set(ENV{LD_LIBRARY_PATH} ${popart_LIB_DIR}:${POPLAR_DIR}:$ENV{LD_LIBRARY_PATH})
    set(ENV{POPTORCH_SMALL_IPU_MODEL} 1)
    execute_process( COMMAND ${cmd} WORKING_DIRECTORY ${working_directory} RESULT_VARIABLE RETVAL OUTPUT_VARIABLE OUTPUT ERROR_VARIABLE OUTPUT)
    if(RETVAL AND NOT RETVAL EQUAL 0)
      message(FATAL_ERROR \"${cmd_name} FAILED: \${OUTPUT}\")
    endif()")
endfunction()

function(remove_use_distributed_definition target)
  get_target_property(compile_options ${target} INTERFACE_COMPILE_DEFINITIONS)
  if(NOT compile_options)
    message(FATAL_ERROR "Could not get property INTERFACE_COMPILE_DEFINITIONS from target '${target}'.")
  endif()
  list(REMOVE_ITEM compile_options USE_DISTRIBUTED)
  list(REMOVE_ITEM compile_options USE_RPC)
  set_target_properties(${target} PROPERTIES INTERFACE_COMPILE_DEFINITIONS "${compile_options}")
endfunction()

file(WRITE ${CMAKE_BINARY_DIR}/tmp/test.sh "#!$ENV{SHELL}
  source ${CMAKE_BINARY_DIR}/enable.sh
  export POPTORCH_TEST_TIMEOUT=3600
  export TORCH_SHOW_CPP_STACKTRACES=1
  ctest --output-on-failure --timeout $POPTORCH_TEST_TIMEOUT $@
  ")
file(COPY ${CMAKE_BINARY_DIR}/tmp/test.sh
  DESTINATION ${CMAKE_BINARY_DIR}
  FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)

enable_testing()

add_compile_options(
  -Wall
  -pedantic
  -Wextra
  -Wdisabled-optimization
  -Wshadow
  -Wswitch
  -Wformat=2
  -Wimplicit-fallthrough
  -Winit-self
  -Wcomment
  -Wsequence-point
  -Wundef
  -Wuninitialized
  -DTORCH_MINOR_VERSION=${TORCH_MINOR_VERSION})

if(${ENABLE_WERROR})
  add_compile_options(-Werror)
endif()

set(CMAKE_CXX_STANDARD 17)

set(INSTALL_PYDIR ${CMAKE_INSTALL_PREFIX}/poptorch)

if(${CMAKE_SYSTEM_NAME} STREQUAL Darwin)
  set(CMAKE_INSTALL_RPATH "@loader_path")
  set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
else()
  # $ORIGIN/lib is needed by the standalone wheel: by default libraries expect
  # their dependencies to be in $ORIGIN/../lib therefore for Poplar
  # and Popart to work they need to be stored in a folder named "lib".
  # However the poptorch shared libraries which are loaded from python must be at
  # the root of the poptorch package, which is why we need to add $ORIGIN/lib
  # to the poptorch libraries.
  set(CMAKE_INSTALL_RPATH "$ORIGIN:$ORIGIN/lib")
endif()

find_package(Torch ${TORCH_VERSION} EXACT REQUIRED)

remove_use_distributed_definition(torch_cpu)

add_subdirectory(poptorch_err)
add_subdirectory(poptorch_logging)
add_subdirectory(poptorch_compiler/pytorch_bridge)

add_subdirectory(poptorch/source/dispatch_tracer)
add_subdirectory(popart_compiler)
add_subdirectory(poptorch)
add_subdirectory(python)
add_subdirectory(poptorch_geometric)

# Examples and tests
add_subdirectory(tests)
add_subdirectory(examples)
add_subdirectory(docs/user_guide)

add_custom_target(poptorch_standalone_wheel
  WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}
  COMMAND python3 ${PROJECT_SOURCE_DIR}/scripts/generate_python_package.py bdist_wheel --include-dir ${CMAKE_INSTALL_PREFIX}/include --lib-dir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR} --output-dir ${CMAKE_INSTALL_PREFIX}/dist --python-dir ${INSTALL_PYDIR} --standalone "${popart_LIB_DIR}:${POPLAR_DIR}"
  DEPENDS poptorch
)
add_custom_target(poptorch_standalone_sdist
  WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}
  COMMAND python3 ${PROJECT_SOURCE_DIR}/scripts/generate_python_package.py sdist --include-dir ${CMAKE_INSTALL_PREFIX}/include --lib-dir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR} --output-dir ${CMAKE_INSTALL_PREFIX}/dist --python-dir ${INSTALL_PYDIR} --standalone "${popart_LIB_DIR}:${POPLAR_DIR}"
  DEPENDS poptorch
)

add_custom_target(poptorch_wheel
  WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}
  COMMAND python3 ${PROJECT_SOURCE_DIR}/scripts/generate_python_package.py bdist_wheel --include-dir ${CMAKE_INSTALL_PREFIX}/include --lib-dir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR} --output-dir ${CMAKE_INSTALL_PREFIX}/dist --python-dir ${INSTALL_PYDIR}
  DEPENDS poptorch
)

add_custom_target(poptorch_sdist
  WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}
  COMMAND python3 ${PROJECT_SOURCE_DIR}/scripts/generate_python_package.py sdist --include-dir ${CMAKE_INSTALL_PREFIX}/include --lib-dir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR} --output-dir ${CMAKE_INSTALL_PREFIX}/dist --python-dir ${INSTALL_PYDIR}
  DEPENDS poptorch
)

install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/README.md
        DESTINATION .)

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/enable.sh.in
  ${PROJECT_BINARY_DIR}/enable.sh
  @ONLY)

install(FILES ${CMAKE_CURRENT_BINARY_DIR}/enable.sh
        DESTINATION .)

if(${CMAKE_VERSION} VERSION_GREATER "3.15.0")
  # Building poptorch without installing it doesn't make sense: the python
  # module cannot be used so always install after a build.
  add_custom_target(install_poptorch ALL
      COMMAND ${CMAKE_COMMAND} --install ${CMAKE_BINARY_DIR}
      DEPENDS poptorch custom_cube_op custom_leaky_relu_op custom_add_scalar_op custom_add_scalar_vec_op custom_add_vec_scalar_mul_op custom_reduce_op custom_three_input_reduce_op custom_many_attribute_op
  )
endif()


================================================
FILE: License.txt
================================================
The MIT License (MIT)

Copyright (c) 2020 Graphcore Limited

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


================================================
FILE: MANIFEST.in
================================================
recursive-include include *.hpp
include poptorch/lib/*
include poptorch/lib/poplar_rt/*
include poptorch/lib/graphcore/lib/*.a
include *.py
include *.toml
include License.txt
include poptorch_third_party_licenses.txt


================================================
FILE: README.md
================================================
# PopTorch and PopTorch Geometric.

## PopTorch - PyTorch integration for the Graphcore IPU

PopTorch is a set of extensions for PyTorch enabling models
to be trained, evaluated and used on the Graphcore IPU.

More information can be found in the [PopTorch User Guide](https://docs.graphcore.ai/projects/poptorch-user-guide/).

## PopTorch Geometric - PyTorch Geometric integration for the Graphcore IPU

PopTorch Geometric is a set of extensions for PyTorch Geometric, enabling Graph
Neural Network models to be trained, evaluated and used on the Graphcore IPU.
PopTorch Geometric depends on the functionality provided by PopTorch.

More information can be found in the [PopTorch Geometric User Guide](https://docs.graphcore.ai/projects/poptorch-geometric-user-guide).


## Prerequisites

These instructions assume you are building PopTorch and PopTorch Geometric on Ubuntu 20.04.

To install and run PopTorch and PopTorch Geometric you will need:

- Python 3.8
- pip3 >= 18.1
- The Poplar SDK

```sh
sudo apt install -y python3 python3-pip
```

To build PopTorch and PopTorch Geometric from sources you will need all of the above and:

- git
- curl
- g++

```sh
sudo apt install -y git curl g++
```

To build the documentation you will also need LaTeX:

```sh
sudo apt install -y texlive-full
```

## Install the Poplar SDK

The Poplar SDK can be downloaded from: https://www.graphcore.ai/downloads.

Set the following environment variable to point to the installed Poplar SDK:

```sh
export SDK_PATH=/path/to/poplar_sdk-ubuntu_20_04*
```

PopTorch must be built against a compatible version of the SDK. For example, the "sdk-release-3.2" branch of PopTorch must be built against Poplar SDK 3.2.

## Installation

Make sure `pip3` is up to date (You need `pip3 >= 18.1`):

```sh
pip3 install -U pip --user
```

Install the PopTorch wheel (Torch will automatically be installed in the
process):

```sh
pip3 install ${SDK_PATH}/poptorch-*.whl
```

Once the PopTorch wheel has been installed, PopTorch Geometric wheel can be
installed if needed (PyTorch Geometric will automatically be installed in
the process):

```sh
pip3 install ${SDK_PATH}/poptorch_geometric-*.whl
```

## Usage

The PopTorch wheel doesn't include the PopART and Poplar binaries, so you need to make sure they are in your path before loading PopTorch or PopTorch Geometric.
This is done by sourcing their respective `enable.sh` scripts:

```sh
. ${SDK_PATH}/poplar-ubuntu_20_04*/enable.sh
. ${SDK_PATH}/popart-ubuntu_20_04*/enable.sh
```

You can check everything is in order by running:

```sh
python3 -c "import poptorch;print(poptorch.__version__)"
```

And similarly for PopTorch Geometric:

```sh
python3 -c "import poptorch_geometric;print(poptorch_geometric.__version__)"
```

More information can be found in the [PopTorch User Guide](https://docs.graphcore.ai/projects/poptorch-user-guide/)

## Build instructions

We use [Mambaforge](https://github.com/conda-forge/miniforge#mambaforge) as build environment manager.

1. Clone the PopTorch repository

```sh
git clone https://github.com/graphcore/poptorch.git
```

2. Create a folder for your build

```sh
mkdir build
cd build
```

3. Create a build environment and install the dependencies.

```sh
../poptorch/scripts/create_buildenv.py
```

4. Activate the build environment

```sh
. activate_buildenv.sh
```

5. Configure the build

```sh
cmake ../poptorch -DSDK_DIR=${SDK_PATH} -GNinja
```

By default, PopTorch will be built in release mode. To build in debug mode add `-DCMAKE_BUILD_TYPE=Debug`.

To build the documentation, add `-DBUILD_DOCS=ON`. The HTML and PDF documentation will be generated in `docs/`.

6. Compile the PopTorch and PopTorch Geometric libraries

```sh
ninja install
```

If you're only going to use PopTorch or PopTorch Geometric for development purposes then you can stop here.
Source the enable script in the PopTorch build folder and you can start using PopTorch:

```sh
. enable.sh
python3 -c "import poptorch;print(poptorch.__version__)"
```

Similarly for PopTorch Geometric:
```sh
. enable.sh
python3 -c "import poptorch_geometric;print(poptorch_geometric.__version__)"
```

7. (Optional) Build the PopTorch wheel

```sh
ninja poptorch_wheel
```

The wheel will be created in `install/dist`.

8. (Optional) Build the PopTorch Geometric wheel

```sh
ninja poptorch_geometric_wheel
```

The wheel will be created in `install/dist`.

### Run the tests

To run the tests:

```sh
# Run all the tests, print the output only on failure, run 80 tests in parallel
./test.sh -j80
# PopTorch has 3 test labels: examples, short, long. To run all the tests except the long ones:
./test.sh -j80 -LE long
# To run only the short tests
./test.sh -j80 -L short
# Filter the tests by name using -R
./test.sh -j80 -R half_
# For more information:
./test.sh --help
```

Note: If you run the tests in parallel, make sure to tell PopTorch to wait for an IPU to become available if they are all in use:

```sh
export POPTORCH_WAIT_FOR_IPU=1
```

Tests can also be run individually using `pytest`:

```sh
. enable.sh
python3 -m pytest ../poptorch/tests/options_test.py
# add -s to get the whole output
# -k to filter the tests by name
python3 -m pytest ../poptorch/tests/options_test.py -s -k popart
```

Tests specific for Graph Neural Networks are located in `tests/gnn/` subdirectory:

```sh
. enable.sh
python3 -m pytest ../poptorch/tests/gnn/test_basic_gnn.py
# add -s to get the whole output
# -k to filter the tests by name
python3 -m pytest ../poptorch/tests/gnn/test_basic_gnn.py -s -k GraphSAGE
```

## Feedback / issues

Please create issues [here](https://github.com/graphcore/poptorch/issues)


================================================
FILE: config.buildenv.py
================================================
# Copyright (c) 2020 Graphcore Ltd. All rights reserved.

_llvm_version = "13.0.1"

config.setDefault(build_documentation=True)

installers.add(PipRequirements("requirements.txt"))

installers.add(PipRequirements("poptorch_geometric/requirements.txt"))

installers.add(
    CondaPackages(
        "boost-cpp=1.72.0",
        "ccache=4.3",
        "cmake=3.18.2",
        "libstdcxx-ng=11.2.0",
        "make=4.3",
        "ninja=1.10.2",
        "pybind11=2.6.1",
        "pyyaml=5.3.1",
        # Mamba overwrites that package, so it must explicitly
        # appear here with the correct version.
        "setuptools=58.0.4",
        "spdlog=1.8.0",
        # Mamba overwrites that package, so it must explicitly
        # appear here with the correct version.
        "typing-extensions=4.1.1",
        # Mamba overwrites that package, so it must explicitly
        # appear here with the correct version.
        "wheel=0.34.2",
        "zip=3.0"))

if config.build_documentation:
    installers.add(
        CondaPackages(
            "breathe=4.25.1",
            "docutils==0.16",
            "hunspell=1.7.0",
            # Indirect dependency of sphinx which
            # doesn't get automatically installed.
            "jinja2=3.0.3",
            "latexmk=4.55",
            "sphinx=3.3.1",
            "sphinx_rtd_theme=0.5.0",
        ))

if config.install_linters:
    installers.add(
        CondaPackages(
            "pre-commit=3.3.3",
            "clang-tools=" + _llvm_version,
            "pylint=2.7.2",
            "yapf=0.27.0",
            # To preserve the comments when updating the schemas
            "ruamel.yaml=0.17.21",
        ))


class DownloadExternalDatasets(Installer):
    def __init__(self, **kwargs):
        super().__init__(**kwargs)
        self.downloader_path = os.path.join(_utils.sources_dir(), 'scripts',
                                            'download_external_datasets.py')
        if not os.path.exists(self.downloader_path):
            raise RuntimeError(f'Path {self.downloader_path} not exists.')

    def hashString(self):
        with open(self.downloader_path, "r") as f:
            return f.read()

    def install(self, env):
        datasets_path = os.path.join(env.prefix, "external_datasets")
        env.run_commands(f"mkdir {datasets_path}",
                         f"python3 {self.downloader_path} {datasets_path}")


installers.add(DownloadExternalDatasets())


================================================
FILE: docs/common/_static/css/custom_rtd.css
================================================
/* Copyright (c) 2020 Graphcore Ltd. All rights reserved.
   Override the sphinx-readthedocs-theme settings */

/*  improve table layout, allowing cells to wrap */
.rst-content table.docutils col {
  width: auto;
}

.wy-table-responsive table td, .wy-table-responsive table th,
.rst-content .wy-table-responsive table td, .rst-content .wy-table-responsive table th {
  white-space: normal;
  word-wrap: normal;
  border: solid 2px #e1e4e5;
}

th.head p {
  margin-bottom: 0;
}

/* make inline code/literal text less ugly */
/*
.rst-content tt.literal, .rst-content tt.literal, .rst-content code.literal {
  color: #565656;
  font-size: 90%;
  padding: 0;
  background: #ffffff;
  border: none;
}
*/
/* make image captions a sensible size and format */

.rst-content .toctree-wrapper p.caption {
  font-size: 14px;
  font-weight: 700;
  font-family: "Graphik", "Lato", "Helvetica Neue", Arial, sans-serif;
  text-align: center;
  margin-top: 14px;
}

/* change background colour for code samples */

div.highlight,
.rst-content pre.literal-block,
.rst-content pre.literal-block div[class^='highlight'],
.rst-content div[class^='highlight'],
.rst-content div[class^='highlight'] pre,
.rst-content div[class^='highlight'] div[class^='highlight'],
.rst-content div[class^='highlight'] td.code {
  background-color: white ;
  color: #292c31;
}

/* remove ugly top border from definition lists */

.rst-content dl:not(.docutils) dt {
  border-top: none;
}

/* Style nav menu in Graphcore colours and fonts */

.wy-menu-vertical li.toctree-l1 span.toctree-expand,
.wy-menu-vertical li span.toctree-expand,
.wy-menu-vertical li.on a span.toctree-expand,
.wy-menu-vertical li a.current span.toctree-expand {
  color: white;
  visibility: visible;
  display: inline-block;
  mix-blend-mode: difference;
}

.fa-home:before, .icon-home:before {
  display: none;
}

a.icon,
a.icon:visited,
a.icon:hover,
a.icon-home,
a.icon-home:hover,
a.icon-home:visited {
  color: white;
  font-weight: bold;
}

.btn {
  font-family: "Graphik", "Lato", "proxima-nova", "Helvetica Neue", Arial, sans-serif;
}

input[type="button"], input[type="reset"], input[type="submit"],
input[type="text"], input[type="password"], input[type="email"], input[type="url"], input[type="date"], input[type="month"], input[type="time"], input[type="datetime"], input[type="datetime-local"], input[type="week"], input[type="number"], input[type="search"], input[type="tel"], input[type="color"] {
  font-family: "Graphik", "Lato", "proxima-nova", "Helvetica Neue", Arial, sans-serif;
}

textarea {
  font-family: "Graphik", "Lato", "proxima-nova", "Helvetica Neue", Arial, sans-serif;
}

a:link {
  color: #ff6f79;
}

a:visited {
  color: #ff6f79;
}

a:hover {
  color: #fbc3aa;
}

body {
  font-family: "Graphik", "Lato", "Helvetica Neue", Arial, sans-serif;
  color: #565656;
}

h1, h2, h3, h4, h5, h6, legend {
  font-family: "Graphik", "Lato", "Helvetica Neue", Arial, sans-serif;
  color: #292c31;
}

h1 {
  text-transform: uppercase;
  font-family: "GC Quantized", "Roboto Slab", "ff-tisa-web-pro", "Georgia", Arial, sans-serif;
}

.rst-content tt.literal, .rst-content tt.literal, .rst-content code.literal,
.rst-content pre.literal-block, .rst-content .linenodiv pre,
.rst-content div[class^='highlight'] pre,
code, .rst-content tt, .rst-content code,
.rst-content pre, .rst-content kbd, .rst-content samp,
footer span.commit code, footer span.commit .rst-content tt, .rst-content footer span.commit tt {
  font-family: Consolas, "Andale Mono WT", "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", Monaco, "Courier New", Courier, monospace;
  color: #292c31;
}

.wy-menu-vertical li.toctree-l1 >a,
.wy-menu-vertical li.toctree-l1 >a:visited {
    color: #e9e9e9 !important;
}

.wy-menu-vertical li.toctree-l1.current a,
.wy-menu-vertical li a {
    color: #292c31 !important;
}

.wy-menu-vertical a:hover {
  background: #ff6f79 !important;
  color: #fff  !important;
}

.wy-menu,
.wy-menu-vertical,
.wy-nav-side,
.wy-side-nav-search {
  background-color: #292c31;
}

.wy-side-nav-search>div.version {
  color: #fff;
  text-align: left;
  padding: 0 .75em;
}

.rst-content .sidebar .sidebar-title {
  font-family: "GC Quantized", "Roboto Slab", "ff-tisa-web-pro", "Georgia", Arial, sans-serif;
}

.rst-content .footnote-reference, .rst-content .citation-reference {
  vertical-align: super;
}

.rst-content table.docutils.citation, .rst-content table.docutils.footnote {
  color: #999;
}

.wy-breadcrumbs {
  display: none;
}

footer p {
  color: #565656;
  font-size: 15px;
}


================================================
FILE: docs/common/conf.py
================================================
# Copyright (c) 2020 Graphcore Ltd. All rights reserved.
# Configuration file for the Sphinx documentation builder.
#
# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import pathlib
import json
import sys
import datetime
sys.path.insert(0, os.path.abspath('.'))

# -- Project information -----------------------------------------------------

project = 'Project'
author = 'Graphcore Ltd'

# The full version, including alpha/beta/rc tags
# Looks like html uses 'version' and latex uses 'release'
version = 'v0.0.0'

# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
    'sphinx.ext.graphviz',
    'sphinx.ext.autodoc',
    'sphinx.ext.extlinks',
]


def get_current_release() -> str:
    format_str = "{major}.{minor}"
    version_file = pathlib.Path(__file__).parents[2].resolve() / "version.json"
    return format_str.format(**json.load(open(version_file)))


SDK_RELEASE = get_current_release()
extlinks = {
    'tutorials-repo':
    (f'https://github.com/graphcore/tutorials/tree/sdk-release-{SDK_RELEASE}/%s',
     None),
    'github-poptorch':
    (f'https://github.com/graphcore/poptorch/tree/sdk-release-{SDK_RELEASE}/%s',
     None),
}

# Add any paths that contain templates here, relative to this directory.
templates_path = []

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []

nitpick_ignore = [
    ('py:class', 'bool'),
    ('py:class', 'dict'),
    ('py:class', 'int'),
    ('py:class', 'iterable'),
    ('py:class', 'optional'),
    ('py:class', 'str'),
    ('py:class', 'T_co'),
    ('py:class', 'datetime.timedelta'),
    ('py:class', 'torch.Tensor'),
    ('py:class', 'torch.dtype'),
    ('py:class', 'torch.nn.Module'),
    ('py:class', 'torch.optim.Optimizer'),
    ('py:class', 'torch.optim.optimizer.Optimizer'),
    ('py:class', 'torch.utils.data.Dataset'),
    ('py:class', 'torch.utils.data.sampler.Sampler'),
    # Enums already described in functions that use them
    ('py:class', 'poptorch.OutputMode'),
    ('py:class', 'poptorch.ConnectionType'),
    ('py:class', 'poptorch.HalfFloatCastingBehavior'),
    ('py:class', 'poptorch.MatMulSerializationMode'),
    ('py:class', 'poptorch.OverlapMode'),
    ('py:class', 'poptorch.ReductionType'),
    ('py:class', 'poptorch.SyncPattern'),
    ('py:class', 'poptorch.MeanReductionStrategy'),
    # Type hints
    ('py:data', 'typing.Optional'),
    ('py:data', 'typing.Callable'),
    ('py:class', 'typing.ForwardRef'),
]

# Define abbreviations for IPU-PODn names with subscripts
# These use non-breaking hyphens & spaces, so be careful if editing or adding new definitions
pod_sizes = [2**i for i in range(2, 14)] + ["N"]
pod_definitions = [
    f".. |POD{i}| replace:: IPU‑POD\\ :subscript:`{i}`" for i in pod_sizes
]
bow_definitions = [
    f".. |BOW{i}| replace:: Bow Pod\\ :subscript:`{i}`" for i in pod_sizes
]

rst_epilog = ("\n".join(pod_definitions) + "\n" + "\n".join(bow_definitions) +
              r"""
.. role:: raw-html(raw)
    :format: html

.. |POD| replace:: IPU‑POD
.. |BOW| replace:: Bow Pod
.. |newpage| raw:: latex

  \newpage

.. |LEGAL:EULA| replace::
    This software is made available under the terms of the `Graphcore End User
    License Agreement (EULA) <https://docs.graphcore.ai/en/latest/eula.html>`__
    and the
    `Graphcore Container License Agreement <https://docs.graphcore.ai/projects/container-license/en/latest/>`__.
    Please ensure you have read and accept the terms of the corresponding
    license before using the software. The Graphcore EULA applies unless
    indicated otherwise.

.. |LEGAL:TRADEMARkS| replace::
    Graphcloud®, Graphcore®, Poplar® and PopVision® are registered trademarks
    of Graphcore Ltd.
    :raw-html:`<br></br>`
    Bow™,
    Bow-2000™,
    Bow Pod™,
    Colossus™,
    In-Processor-Memory™,
    IPU-Core™,
    IPU-Exchange™,
    IPU-Fabric™,
    IPU-Link™,
    IPU-M2000™,
    IPU-Machine™,
    IPU-POD™,
    IPU-Tile™,
    PopART™,
    PopDist™,
    PopLibs™,
    PopRun™,
    PopTorch™,
    Streaming Memory™
    and Virtual-IPU™
    are trademarks of Graphcore Ltd.
    :raw-html:`<br></br>`
    All other trademarks are the property of their respective owners.

""" + f".. |YEAR| replace:: {datetime.date.today().year}" + "\n" +
              f".. |SDK_RELEASE| replace:: {SDK_RELEASE}"
              "\n")

# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages.  See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'

html_theme_options = {'logo_only': False, 'navigation_depth': 4}

numfig = True

numfig_format = {
    'section': 'Section {number}, {name}',
    'figure': 'Fig. %s',
    'table': 'Table %s',
    'code-block': 'Listing %s'
}

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']

# CSS file to create the Graphcore style
html_css_files = [
    'css/custom_rtd.css',
]

# The name for this set of Sphinx documents.  If None, it defaults to
# "<project> v<release> documentation".
html_title = 'Document Title'

# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
html_logo = 'graphcorelogo-html.png'

# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
html_use_smartypants = True

# If true, links to the reST sources are added to the pages.
html_show_sourcelink = False

# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
html_show_sphinx = False

# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
html_show_copyright = False

# -- Options for LaTeX output ---------------------------------------------
# Don't know how much of this is necessary. It's a bit of a mess.

# pifont required for tick and cross characters
# use array stretch to get taller table rows. Also consider sing extrarowheight
# \\setlength{\\extrarowheight}{1pt}

ADDITIONAL_PREAMBLE = r"""
\setcounter{secnumdepth}{5}
\setcounter{tocdepth}{5}

\usepackage{threeparttable}
\usepackage{pifont}
\usepackage{array}
\usepackage{charter}
\usepackage[defaultsans]{lato}
\usepackage{inconsolata}
\usepackage{listings}
\usepackage{verbatim}
\usepackage{multicol}
\usepackage{float}
\usepackage{fancyhdr}
%% Obtain access to ssmall font size
\usepackage[10pt]{moresize}

%% adjustbox used to set max width and height for images
\usepackage[export]{adjustbox}

%% Define a right-justified table column type
\usepackage{ragged2e}
\newcolumntype{R}[1]{>{\RaggedLeft\arraybackslash}p{#1}}

\renewcommand{\arraystretch}{1.4}

\usepackage{booktabs}
\usepackage{graphicx}

%% Push footnotes to the bottom of the page
\usepackage[bottom]{footmisc}

\usepackage{pdfpages}

\usepackage{pdflscape}

\usepackage{transparent}
\usepackage[normalem]{ulem}

%% Watermark stuff
\usepackage{draftwatermark}
\SetWatermarkFontSize{2cm}
\SetWatermarkColor[gray]{0.96}
\SetWatermarkText{}
\SetWatermarkScale{2}
\SetWatermarkAngle{30}

%% Ensure API descriptions are all tt family
\let\fulllineitemsOld\fulllineitems
\let\endfulllineitemsOld\endfulllineitems
\renewenvironment{fulllineitems}{\ttfamily\small\fulllineitemsOld}{\endfulllineitemsOld}

%% Change the Sphinx verbatim to not put the box around it and to indent
\renewcommand{\Verbatim}[1][1]{%
  % list starts new par, but we don't want it to be set apart vertically
  \bgroup\parskip=0pt%
  \medskip
  % The list environment is needed to control perfectly the vertical
  % space.
  \list{}{%
  \setlength\parskip{0pt}%
  \setlength\itemsep{0ex}%
  \setlength\topsep{0ex}%
  \setlength\partopsep{0pt}%
  \setlength\leftmargin{0pt}%
  }%
  \OriginalVerbatim[#1,xleftmargin=0.5cm,formatcom=\normalsize]%
}
\renewcommand{\endVerbatim}{%
    \endOriginalVerbatim%
  \endlist%
  % close group to restore \parskip
  \egroup%
}

\newcommand{\VerbBorders}{%
  \renewcommand{\Verbatim}[1][1]{%
    % list starts new par, but we don't want it to be set apart vertically
    \bgroup\parskip=0pt%
    \smallskip%
    % The list environment is needed to control perfectly the vertical
    % space.
    \list{}{%
      \setlength\parskip{0pt}%
      \setlength\itemsep{0ex}%
      \setlength\topsep{0ex}%
      \setlength\partopsep{0pt}%
      \setlength\leftmargin{0pt}%
    }%
    \item\MakeFramed {\FrameRestore}%
    \small%
    \OriginalVerbatim[##1]%
  }
  \renewcommand{\endVerbatim}{%
    \endOriginalVerbatim%
    \endMakeFramed%
    \endlist%
    % close group to restore \parskip
    \egroup%
  }
  \definecolor{VerbatimColor}{rgb}{0.95,0.95,0.95}
  \definecolor{VerbatimBorderColor}{rgb}{1.0,1.0,1.0}
}

\makeatletter
\DeclareTextCommandDefault{\textleftarrow}{\mbox{$\m@th\leftarrow$}}
\makeatother
"""

ADDITIONAL_PREAMBLE += r"""
%% Redefine sphinxstylethead (used only for table headers) to bold font
\usepackage{letltxmacro}
\LetLtxMacro{\oldtextsf}{\sphinxstyletheadfamily}
\renewcommand{\sphinxstyletheadfamily}[0]{\oldtextsf \bf }
"""

ADDITIONAL_PREAMBLE += r"""
\makeatletter
  \fancypagestyle{normal}{
    \fancyhf{}
    \fancyfoot[RE,RO]{{\py@HeaderFamily\thepage}}
    \fancyfoot[LE,LO]{%(footer)s}
    \renewcommand{\headrulewidth}{0.4pt}
    \renewcommand{\footrulewidth}{0.4pt}
  }
  \fancypagestyle{plain}{
    \fancyhf{}
    \fancyfoot[RE,RO]{{\py@HeaderFamily\thepage}}
    \fancyfoot[LE,LO]{%(footer)s}
    \renewcommand{\headrulewidth}{0pt}
    \renewcommand{\footrulewidth}{0.4pt}
  }
\makeatother
""" % {
    'footer': ''
}

# From Sphinx 1.5 onwards, there are certain macros which are used which became
# deprecated (e.g. \code). These macros should be upgraded in the future so
# that we can move away from using the old macro names.
latex_keep_old_macro_names = True

latex_elements = {
    # Options to pass to packages
    'passoptionstopackages':
    r'\PassOptionsToPackage{dvipsnames, table, xcdraw}{xcolor}',

    # Set up margins for geometry
    'sphinxsetup': 'hmargin={0.75in, 0.75in}, vmargin={0.75in, 0.75in}',

    # The paper size ('letterpaper' or 'a4paper').
    'papersize': 'a4paper',

    # Single sided to save paper and improve display
    'extraclassoptions': 'openany,oneside',

    # The font size ('10pt', '11pt' or '12pt').
    'pointsize': '10pt',

    # Disable figure floating
    'figure_align': 'H',

    # Additional stuff for the LaTeX preamble.
    'preamble': ADDITIONAL_PREAMBLE,
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
#  author, documentclass [howto, manual, or own class]).
latex_class = 'manual'
if 'DOC_TITLE' in os.environ:
    latex_title = os.environ['DOC_TITLE']
else:
    latex_title = "Document title"
latex_documents = [
    ('index', 'doc.tex', latex_title, author, latex_class),
]

# The name of an image file (relative to this directory) to place at the top of
# the title page.
latex_logo = 'graphcorelogo-pdf.png'

# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
latex_use_parts = False

# If true, show page references after internal links.
latex_show_pagerefs = False

# If true, show URL addresses after external links.
# latex_show_urls = False

# Documents to append as an appendix to all manuals.
# latex_appendices = []

# If false, no module index is generated.
latex_domain_indices = False

# https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html
autodoc_default_options = {
    'undoc-members': True,
}
autodoc_inherit_docstrings = True

autodoc_typehints = 'description'


================================================
FILE: docs/common/custom_dic
================================================
accessor
AdamW
AMSGrad
AsyncRebatched
autograd
backend
booleans
bwd
checkpointed
checkpointing
codepaths
config
connectionist
const
constness
CTC
dict
EOF
float16
float32
FP16
InputChannels
ints
IO
ipu
IPU
IPUs
iterable
L2
libpvti
matmul
Mk1
Mk2
mpirun
Nesterov
num
OpenMPI
OutputChannels
PopART
PopART's
PopDist
PopLibs
PopRun
PopTorch
precompile
pvti
PyTorch
PyTorch's
rebatch
rebatched
rebatching
recomputation
ReducingDim
replan
RMSprop
RTS
serializable
SGD
sharded
sharding
stdout
str
submodules
TODO
tracepoint
tracepoints
tracepointsints
unrounded
unroundedPopRunsubmodules
bool


================================================
FILE: docs/poptorch_geometric/common/conf.py
================================================
# Copyright (c) 2023 Graphcore Ltd. All rights reserved.
# Configuration file for the Sphinx documentation builder.
#
# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import pathlib
import json
import sys
import datetime
sys.path.insert(0, os.path.abspath('.'))

# -- Project information -----------------------------------------------------

project = 'Project'
author = 'Graphcore Ltd'

# The full version, including alpha/beta/rc tags
# Looks like html uses 'version' and latex uses 'release'
version = 'v0.0.0'

# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
    'sphinx.ext.napoleon',
    'sphinx.ext.graphviz',
    'sphinx.ext.autodoc',
    'sphinx.ext.extlinks',
]


def get_current_release() -> str:
    format_str = "{major}.{minor}"
    version_file = pathlib.Path(__file__).parents[3].resolve() / "version.json"
    return format_str.format(**json.load(open(version_file)))


SDK_RELEASE = get_current_release()
extlinks = {
    'tutorials-repo':
    (f'https://github.com/graphcore/tutorials/tree/sdk-release-{SDK_RELEASE}/%s',
     None),
    'github-poptorch':
    (f'https://github.com/graphcore/poptorch/tree/sdk-release-{SDK_RELEASE}/%s',
     None),
}

# Add any paths that contain templates here, relative to this directory.
templates_path = []

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []

nitpick_ignore = [
    ('py:obj', 'num_nodes * (num_nodes - 1)'),
    ('py:obj', '0.0'),
    ('py:obj', '1'),
    ('py:obj', '2'),
    ('py:obj', 'graphs_mask'),
    ('py:obj', 'nodes_mask'),
    ('py:obj', 'edges_mask'),
    ('py:obj', 'True'),
    ('py:obj', 'False'),
    ('py:obj', 'num_nodes'),
    ('py:obj', 'num_edges'),
    ('py:obj', 'num_graphs'),
    ('py:obj', 'None'),
    ('py:obj', 'data_source'),
    ('py:obj', 'follow_batch'),
    ('py:obj', 'exclude_keys'),
    ('py:obj', 'batch_sampler'),
    ('py:obj', 'shuffle'),
    ('py:obj', 'Data'),
    ('py:class', 'bool'),
    ('py:class', 'dict'),
    ('py:class', 'int'),
    ('py:class', 'iterable'),
    ('py:class', 'optional'),
    ('py:class', 'str'),
    ('py:class', 'T_co'),
    ('py:class', 'Dataset'),
    ('py:class', 'ClusterData'),
    ('py:class', 'Sampler'),
    ('py:class', '..'),
    ('py:class', 'torch.Tensor'),
    ('py:class', 'torch.utils.data.dataset.Dataset'),
    ('py:class', 'torch.utils.data.sampler.Sampler'),
    ('py:class', 'torch_geometric.data.Batch'),
    ('py:class', 'torch_geometric.data.Data'),
    ('py:class', 'torch_geometric.data.Dataset'),
    ('py:class', 'torch_geometric.data.dataset.Dataset'),
    ('py:class', 'torch_geometric.data.HeteroData'),
    ('py:class', 'torch_geometric.loader.cluster.ClusterData'),
    ('py:class', 'torch_geometric.loader.ClusterData'),
    ('py:class', 'poptorch.AsynchronousDataAccessor'),
    # Enums already described in functions that use them
    ('py:class', 'poptorch.DataLoader'),
    ('py:class', 'poptorch.Dataset'),
    ('py:class', 'poptorch.Options'),
    ('py:class', 'bool'),
    ('py:class', 'dict'),
    ('py:class', 'int'),
    ('py:class', 'iterable'),
    ('py:class', 'optional'),
    ('py:class', 'str'),
    ('py:class', 'T_co'),
    ('py:class', 'torch.Tensor'),
    ('py:class', 'torch.dtype'),
    ('py:class', 'torch.nn.Module'),
    ('py:class', 'torch.optim.Optimizer'),
    ('py:class', 'torch.optim.optimizer.Optimizer'),
    ('py:class', 'torch.utils.data.Dataset'),
    ('py:class', 'torch.utils.data.sampler.Sampler'),
    # Enums already described in functions that use them
    ('py:class', 'poptorch.OutputMode'),
    ('py:class', 'poptorch.ConnectionType'),
    ('py:class', 'poptorch.HalfFloatCastingBehavior'),
    ('py:class', 'poptorch.MatMulSerializationMode'),
    ('py:class', 'poptorch.OverlapMode'),
    ('py:class', 'poptorch.ReductionType'),
    ('py:class', 'poptorch.SyncPattern'),
    ('py:class', 'poptorch.MeanReductionStrategy'),
    # Type hints
    ('py:data', 'typing.Optional'),
    ('py:data', 'typing.Callable'),
    ('py:class', 'typing.ForwardRef'),
]

# Define abbreviations for IPU-PODn names with subscripts
# These use non-breaking hyphens & spaces, so be careful if editing or adding new definitions
pod_sizes = [2**i for i in range(2, 14)] + ["N"]
pod_definitions = [
    f".. |POD{i}| replace:: IPU‑POD\\ :subscript:`{i}`" for i in pod_sizes
]
bow_definitions = [
    f".. |BOW{i}| replace:: Bow Pod\\ :subscript:`{i}`" for i in pod_sizes
]

rst_epilog = ("\n".join(pod_definitions) + "\n" + "\n".join(bow_definitions) +
              r"""
.. role:: raw-html(raw)
    :format: html

.. |POD| replace:: IPU‑POD
.. |BOW| replace:: Bow Pod
.. |newpage| raw:: latex

  \newpage

.. |LEGAL:EULA| replace::
    This software is made available under the terms of the `Graphcore End User
    License Agreement (EULA) <https://docs.graphcore.ai/en/latest/eula.html>`__
    and the
    `Graphcore Container License Agreement <https://docs.graphcore.ai/projects/container-license/en/latest/>`__.
    Please ensure you have read and accept the terms of the corresponding
    license before using the software. The Graphcore EULA applies unless
    indicated otherwise.

.. |LEGAL:TRADEMARkS| replace::
    Graphcloud®, Graphcore®, Poplar® and PopVision® are registered trademarks
    of Graphcore Ltd.
    :raw-html:`<br></br>`
    Bow™,
    Bow-2000™,
    Bow Pod™,
    Colossus™,
    In-Processor-Memory™,
    IPU-Core™,
    IPU-Exchange™,
    IPU-Fabric™,
    IPU-Link™,
    IPU-M2000™,
    IPU-Machine™,
    IPU-POD™,
    IPU-Tile™,
    PopART™,
    PopDist™,
    PopLibs™,
    PopRun™,
    PopTorch™,
    Streaming Memory™
    and Virtual-IPU™
    are trademarks of Graphcore Ltd.
    :raw-html:`<br></br>`
    All other trademarks are the property of their respective owners.

""" + f".. |YEAR| replace:: {datetime.date.today().year}" + "\n" +
              f".. |SDK_RELEASE| replace:: {SDK_RELEASE}"
              "\n")

# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages.  See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'

html_theme_options = {'logo_only': False, 'navigation_depth': 4}

numfig = True

numfig_format = {
    'section': 'Section {number}, {name}',
    'figure': 'Fig. %s',
    'table': 'Table %s',
    'code-block': 'Listing %s'
}

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['../../common/_static']

# CSS file to create the Graphcore style
html_css_files = [
    'css/custom_rtd.css',
]

# The name for this set of Sphinx documents.  If None, it defaults to
# "<project> v<release> documentation".
html_title = 'Document Title'

# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
html_logo = '../../common/graphcorelogo-html.png'

# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
html_use_smartypants = True

# If true, links to the reST sources are added to the pages.
html_show_sourcelink = False

# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
html_show_sphinx = False

# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
html_show_copyright = False

# -- Options for LaTeX output ---------------------------------------------
# Don't know how much of this is necessary. It's a bit of a mess.

# pifont required for tick and cross characters
# use array stretch to get taller table rows. Also consider sing extrarowheight
# \\setlength{\\extrarowheight}{1pt}

ADDITIONAL_PREAMBLE = r"""
\setcounter{secnumdepth}{5}
\setcounter{tocdepth}{5}

\usepackage{threeparttable}
\usepackage{pifont}
\usepackage{array}
\usepackage{charter}
\usepackage[defaultsans]{lato}
\usepackage{inconsolata}
\usepackage{listings}
\usepackage{verbatim}
\usepackage{multicol}
\usepackage{float}
\usepackage{fancyhdr}
%% Obtain access to ssmall font size
\usepackage[10pt]{moresize}

%% adjustbox used to set max width and height for images
\usepackage[export]{adjustbox}

%% Define a right-justified table column type
\usepackage{ragged2e}
\newcolumntype{R}[1]{>{\RaggedLeft\arraybackslash}p{#1}}

\renewcommand{\arraystretch}{1.4}

\usepackage{booktabs}
\usepackage{graphicx}

%% Push footnotes to the bottom of the page
\usepackage[bottom]{footmisc}

\usepackage{pdfpages}

\usepackage{pdflscape}

\usepackage{transparent}
\usepackage[normalem]{ulem}

%% Watermark stuff
\usepackage{draftwatermark}
\SetWatermarkFontSize{2cm}
\SetWatermarkColor[gray]{0.96}
\SetWatermarkText{}
\SetWatermarkScale{2}
\SetWatermarkAngle{30}

%% Ensure API descriptions are all tt family
\let\fulllineitemsOld\fulllineitems
\let\endfulllineitemsOld\endfulllineitems
\renewenvironment{fulllineitems}{\ttfamily\small\fulllineitemsOld}{\endfulllineitemsOld}

%% Change the Sphinx verbatim to not put the box around it and to indent
\renewcommand{\Verbatim}[1][1]{%
  % list starts new par, but we don't want it to be set apart vertically
  \bgroup\parskip=0pt%
  \medskip
  % The list environment is needed to control perfectly the vertical
  % space.
  \list{}{%
  \setlength\parskip{0pt}%
  \setlength\itemsep{0ex}%
  \setlength\topsep{0ex}%
  \setlength\partopsep{0pt}%
  \setlength\leftmargin{0pt}%
  }%
  \OriginalVerbatim[#1,xleftmargin=0.5cm,formatcom=\normalsize]%
}
\renewcommand{\endVerbatim}{%
    \endOriginalVerbatim%
  \endlist%
  % close group to restore \parskip
  \egroup%
}

\newcommand{\VerbBorders}{%
  \renewcommand{\Verbatim}[1][1]{%
    % list starts new par, but we don't want it to be set apart vertically
    \bgroup\parskip=0pt%
    \smallskip%
    % The list environment is needed to control perfectly the vertical
    % space.
    \list{}{%
      \setlength\parskip{0pt}%
      \setlength\itemsep{0ex}%
      \setlength\topsep{0ex}%
      \setlength\partopsep{0pt}%
      \setlength\leftmargin{0pt}%
    }%
    \item\MakeFramed {\FrameRestore}%
    \small%
    \OriginalVerbatim[##1]%
  }
  \renewcommand{\endVerbatim}{%
    \endOriginalVerbatim%
    \endMakeFramed%
    \endlist%
    % close group to restore \parskip
    \egroup%
  }
  \definecolor{VerbatimColor}{rgb}{0.95,0.95,0.95}
  \definecolor{VerbatimBorderColor}{rgb}{1.0,1.0,1.0}
}

\makeatletter
\DeclareTextCommandDefault{\textleftarrow}{\mbox{$\m@th\leftarrow$}}
\makeatother
"""

ADDITIONAL_PREAMBLE += r"""
%% Redefine sphinxstylethead (used only for table headers) to bold font
\usepackage{letltxmacro}
\LetLtxMacro{\oldtextsf}{\sphinxstyletheadfamily}
\renewcommand{\sphinxstyletheadfamily}[0]{\oldtextsf \bf }
"""

ADDITIONAL_PREAMBLE += r"""
\makeatletter
  \fancypagestyle{normal}{
    \fancyhf{}
    \fancyfoot[RE,RO]{{\py@HeaderFamily\thepage}}
    \fancyfoot[LE,LO]{%(footer)s}
    \renewcommand{\headrulewidth}{0.4pt}
    \renewcommand{\footrulewidth}{0.4pt}
  }
  \fancypagestyle{plain}{
    \fancyhf{}
    \fancyfoot[RE,RO]{{\py@HeaderFamily\thepage}}
    \fancyfoot[LE,LO]{%(footer)s}
    \renewcommand{\headrulewidth}{0pt}
    \renewcommand{\footrulewidth}{0.4pt}
  }
\makeatother
""" % {
    'footer': ''
}

# From Sphinx 1.5 onwards, there are certain macros which are used which became
# deprecated (e.g. \code). These macros should be upgraded in the future so
# that we can move away from using the old macro names.
latex_keep_old_macro_names = True

latex_elements = {
    # Options to pass to packages
    'passoptionstopackages':
    r'\PassOptionsToPackage{dvipsnames, table, xcdraw}{xcolor}',

    # Set up margins for geometry
    'sphinxsetup': 'hmargin={0.75in, 0.75in}, vmargin={0.75in, 0.75in}',

    # The paper size ('letterpaper' or 'a4paper').
    'papersize': 'a4paper',

    # Single sided to save paper and improve display
    'extraclassoptions': 'openany,oneside',

    # The font size ('10pt', '11pt' or '12pt').
    'pointsize': '10pt',

    # Disable figure floating
    'figure_align': 'H',

    # Additional stuff for the LaTeX preamble.
    'preamble': ADDITIONAL_PREAMBLE,
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
#  author, documentclass [howto, manual, or own class]).
latex_class = 'manual'
if 'DOC_TITLE' in os.environ:
    latex_title = os.environ['DOC_TITLE']
else:
    latex_title = "Document title"
latex_documents = [
    ('index', 'doc.tex', latex_title, author, latex_class),
]

# The name of an image file (relative to this directory) to place at the top of
# the title page.
latex_logo = '../../common/graphcorelogo-pdf.png'

# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
latex_use_parts = False

# If true, show page references after internal links.
latex_show_pagerefs = False

# If true, show URL addresses after external links.
# latex_show_urls = False

# Documents to append as an appendix to all manuals.
# latex_appendices = []

# If false, no module index is generated.
latex_domain_indices = False

# https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html
autodoc_default_options = {
    'undoc-members': True,
}
autodoc_inherit_docstrings = True

autodoc_typehints = 'description'


================================================
FILE: docs/poptorch_geometric/user_guide/index.rst
================================================
PyTorch Geometric for the IPU: User Guide
=========================================

.. toctree::
    :maxdepth: 4
    :numbered: 3

    intro
    installation
    performance
    tutorials
    supported_operations
    reference
    legal


================================================
FILE: docs/poptorch_geometric/user_guide/installation.rst
================================================
.. _installation:

============
Installation
============

PopTorch Geometric is included as part of the Poplar SDK (see the `Getting
Started guide
<https://docs.graphcore.ai/en/latest/getting-started.html#getting-started>`_ for
your system for how to install the Poplar SDK. ). PopTorch Geometric is packaged
as a Python wheel file that can be installed using ``pip``. PopTorch Geometric
requires the installation of PopTorch, which is also a part of the Poplar SDK.

To use PopTorch Geometric you must first install the PopTorch wheel
and then the PopTorch Geometric wheel. All the necessary
dependencies (including ``torch`` and ``pytorch_geometric``) will be installed
automatically.


.. important:: pip >= 18.1 is required for PopTorch dependencies to be
    installed properly.

To update `pip`:

.. code-block:: bash

    $ pip install -U pip


Version compatibility
~~~~~~~~~~~~~~~~~~~~~

PopTorch Geometric and PopTorch wheels should always come from the same Poplar
SDK version to guarantee version compatibility.

The following are the corresponding ``poptorch``, ``torch``, ``torchvision`` and ``torchaudio``
versions and supported Python versions.

+------------------------+-----------------------+-------------+-----------------+----------------+------------+
| ``poptorch_geometric`` | ``pytorch_geometric`` |  ``torch``  | ``torchvision`` | ``torchaudio`` | ``python`` |
+========================+=======================+=============+=================+================+============+
|          3.3           |   2.4.0.dev20230613   |    2.0.1    |      0.15.2     |      2.0.1     |   >= 3.8   |
+------------------------+-----------------------+-------------+-----------------+----------------+------------+
|          3.2           |   2.3.0.dev20230222   |    1.13.1   |      0.14.1     |      0.13.1    |   >= 3.7   |
+------------------------+-----------------------+-------------+-----------------+----------------+------------+

.. note:: To ensure version compatibility, ``torchvision`` and ``torchaudio`` are automatically installed with PopTorch in Poplar SDK 3.3 and later.

Installation using Python virtual environment
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

We recommend creating and activating a virtual environment to isolate your
PopTorch Geometric environment from the system Python environment. You can use
the Python ``virtualenv`` tool for this.

.. code-block:: bash

    $ virtualenv -p python3 poptorch_test
    $ source poptorch_test/bin/activate

After activating the virtual environment, you need to first install the PopTorch wheel.

.. code-block:: bash

    $ pip install <sdk_path>/poptorch-x.x.x.whl

where ``<sdk_path>`` is the location of the Poplar SDK on your system.

See the
`PopTorch installation guide <https://docs.graphcore.ai/projects/poptorch-user-guide/en/latest/installation.html>`_
for more information on installing the PopTorch wheel.

Then, install the PopTorch Geometric wheel:

.. code-block:: bash

    # Enable the Python environment containing PopTorch (if not already enabled)
    $ source poptorch_test/bin/activate
    $ pip install <sdk_path>/poptorch_geometric-x.x.x.whl

where ``<sdk_path>`` is the location of the Poplar SDK on your system.

Setting the environment variables
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The PopART and Poplar runtime libraries are required to use PopTorch Geometric,
so you will need to set the library search paths, using the scripts provided
in the SDK:

.. code-block:: bash

    # Enable the Python environment containing PopTorch (if not already enabled)
    $ source poptorch_test/bin/activate

    # Add the Poplar and PopART runtime libraries to the search path
    $ source <sdk_path>/poplar-ubuntu_<os_ver>-<poplar_ver>+<build>/enable.sh
    $ source <sdk_path>/popart-ubuntu_<os_ver>-<poplar_ver>+<build>/enable.sh

where ``<sdk_path>`` is the location of the Poplar SDK on your system, ``<os_ver>`` is the version of Ubuntu on your system, ``<poplar_ver>`` is the software version number of the Poplar SDK and ``<build>`` is the build information.


Validating the setup
~~~~~~~~~~~~~~~~~~~~

In order to validate that everything is installed correctly in your
environment, you can run the following commands and see if they execute without
an exception and the displayed version matches the packages that you installed:

.. code-block:: bash

    $ python -c "import poptorch;print(poptorch.__version__)"
    $ python -c "import poptorch_geometric;print(poptorch_geometric.__version__)"


================================================
FILE: docs/poptorch_geometric/user_guide/intro.rst
================================================
============
Introduction
============

.. admonition:: Experimental Release

    This is an experimental release of PopTorch Geometric. Not all features of PyTorch Geometric are supported, and some functions may not work as expected. The implementation may change without warning in future releases in ways that are not backwards compatible.

PopTorch Geometric is a set of extensions for PyTorch Geometric, enabling Graph
Neural Network models to be trained, evaluated and used on Graphcore IPU
hardware.

PopTorch Geometric has been designed to require as few changes as possible to
your models to run on the IPU.
However, it does have some differences from native PyTorch Geometric execution,
in order to get the most out of IPU hardware.

PopTorch Geometric depends on the functionality provided by PopTorch.

PopTorch and PopTorch Geometric are included in the `Poplar SDK <https://docs.graphcore.ai/projects/sdk-overview/>`__. See the `Getting Started guide <https://docs.graphcore.ai/en/latest/getting-started.html#getting-started>`_ for your system for how to
install the Poplar SDK. Refer to :numref:`installation` for how to install the PopTorch and PopTorch Geometric wheels.


================================================
FILE: docs/poptorch_geometric/user_guide/legal.rst
================================================
Legal notices
=============

|LEGAL:TRADEMARKS|

|LEGAL:EULA|

© Copyright 2023 Graphcore Ltd. All rights reserved.


================================================
FILE: docs/poptorch_geometric/user_guide/performance.rst
================================================
======================
Optimizing performance
======================

PopTorch Geometric is an extension of PyTorch Geometric allowing models to
fully utilize the IPU hardware and provide the best performance. To achieve
that, PopTorch Geometric uses PopTorch functionality. PopTorch Geometric is
designed in such a way that users can run PyTorch Geometric models with the
least amount of changes to the code and exploit the high performance of IPU
systems.

When working with the IPU, it is always recommended to use fixed-size tensors.
This allows for the static compilation of the Poplar programs and using the same
programs for all the iterations of training and/or inference. This constraint
is not always met when working with Graph Neural Networks because graphs
processed in subsequent iterations can have different numbers of nodes and/or
edges, which results in tensors of different shapes. PopTorch Geometric provides
ways to satisfy this constraint and reach the best performance.

Currently, there are two ways to ensure that all the tensors have fixed
shapes---using either the
`Pad <https://pytorch-geometric.readthedocs.io/en/latest/generated/torch_geometric.transforms.Pad.html#torch_geometric.transforms.Pad>`_
transformation with data loader or the fixed-size data loaders.

.. important:: When working with the IPU, it is required to always use the data
    loader from PopTorch Geometric, either
    :py:class:`poptorch_geometric.dataloader.DataLoader`
    or :py:class:`poptorch_geometric.dataloader.FixedSizeDataLoader`.

All the data loaders in PopTorch Geometric take the `options` argument.
It can be used to set
`PopTorch options <https://docs.graphcore.ai/projects/poptorch-user-guide/en/latest/reference.html#poptorch.Options>`_
to process data even more efficiently.

It is recommended to read the
`Efficient data batching <https://docs.graphcore.ai/projects/poptorch-user-guide/en/latest/batching.html>`_
chapter of the PopTorch documentation, to understand the possible settings of
the `options` argument.

Pad transformation
==================

`Pad <https://pytorch-geometric.readthedocs.io/en/latest/generated/torch_geometric.transforms.Pad.html#torch_geometric.transforms.Pad>`_
transformation is a graph transformation implemented in PyTorch Geometric. It
sets the fixed number of nodes and edges for all the graphs in the dataset and
pads the node- and edge-level feature tensors so their sizes match the number
of nodes and edges, respectively. Thanks to that, when the data loader creates
a batch of graphs, all the feature tensors of the batch have the same fixed
size and computations can be performed with high efficiency.

A dataset transformed using `Pad` must be used with the
:py:class:`poptorch_geometric.dataloader.DataLoader` data loader to guarantee
compatibility with the IPU.

.. note:: If the dataset you are working on already has a fixed-size feature
    tensors, then using `Pad` transformation is not necessary and it is enough
    to use the :py:class:`poptorch_geometric.dataloader.DataLoader` data
    loader.

Using `Pad` transformation with
:py:class:`poptorch_geometric.dataloader.DataLoader` is recommended when the
graphs in the dataset have a similar number of nodes and edges, so the number
of padding nodes and edges is small.

For examples of usage, refer to :numref:`examples_and_tutorials`.

Fixed-size data loaders
=======================

The alternative method is to use the
:py:class:`poptorch_geometric.dataloader.FixedSizeDataLoader` class with the
dataset without the `Pad` transformation. The data loader uses
:py:class:`poptorch_geometric.collate.FixedSizeCollater` underneath to
create mini-batches of graphs with a fixed number of nodes and edges from the
initial graphs that do not necessarily have the same number of nodes and edges.
The data loader combines graphs from the dataset and creates dummy graphs such
that the whole mini-batch has a fixed number of nodes, edges and graphs.

By default the `FixedSizeStrategy.PadToMax` strategy is used, which pads the
mini-batches to a fixed-size where the resulting mini-batches have a fixed
number of samples in each mini-batch and one padding graph at the end of the
mini-batch.

The data loader can also produce packed batches with a variable number of
graphs in each mini-batch. This can help reduce the amount of space in each
mini-batch assigned to padding. This is enabled by using
`FixedSizeStrategy.StreamPack` which changes the underlying sampler to
:py:class:`poptorch_geometric.stream_packing_sampler.StreamPackingSampler`.
In this case, each mini-batch contains a certain number of dummy graphs, so
that the total number of graphs in the mini-batch is constant.

Compared to `Pad` transformation, instead of padding each sample in the batch,
the data loader pads the entire batch, which is often more efficient and the
created batches are easier to manage since all the padding nodes and edges are
at the end.

For examples of usage, refer to :numref:`examples_and_tutorials`.


================================================
FILE: docs/poptorch_geometric/user_guide/reference.rst
================================================
.. _reference:

=============
API reference
=============

.. _api_options:

Data loaders
============

.. autoclass:: poptorch_geometric.dataloader.DataLoader

.. autoclass:: poptorch_geometric.dataloader.FixedSizeDataLoader

.. autoclass:: poptorch_geometric.pyg_dataloader.FixedSizeStrategy

.. autoclass:: poptorch_geometric.pyg_dataloader.OverSizeStrategy

Cluster data loaders
====================

.. autoclass:: poptorch_geometric.cluster_loader.FixedSizeClusterLoader

Collators
=========

.. autoclass:: poptorch_geometric.collate.FixedSizeCollater

Batch samplers
==============

.. autoclass:: poptorch_geometric.stream_packing_sampler.StreamPackingSampler

Fixed size options
==================

.. autoclass:: poptorch_geometric.fixed_size_options.FixedSizeOptions


================================================
FILE: docs/poptorch_geometric/user_guide/supported_operations.rst
================================================
.. _supported_operations:

====================
Supported operations
====================

This chapter contains a list of the PyTorch Geometric operations supported by the Poplar SDK.

.. table:: Supported operations
    :widths: 15, 25, 17, 43

    +-------------------------------+---------------------------+---------------+---------------------------------------------------+
    | Layers kind                   | Layer name                | Status        | Notes                                             |
    +===============================+===========================+===============+===================================================+
    | Basic blocks                  | Linear                    | Supported     |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | Sequential                | Supported     |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | HeteroLinear              | Supported     |                                                   |
    +-------------------------------+---------------------------+---------------+---------------------------------------------------+
    | Convolution Layers            | SimpleConv                | Supported     |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | ChebConv                  | Not supported |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | SAGEConv                  | Supported     |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | CuGraphSAGEConv           | Not supported |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | GraphConv                 | Supported     |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | GatedGraphConv            | Supported     |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | ResGatedGraphConv         | Supported     |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | CuGraphGATConv            | Not supported |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | FusedGATConv              | Not supported |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | TransformerConv           | Supported     |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | TAGConv                   | Supported     |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | GINConv                   | Supported     |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | GINEConv                  | Supported     |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | ARMAConv                  | Supported     |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | APPNP                     | Supported     |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | MFConv                    | Supported     |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | RGCNConv                  | Not supported |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | CuGraphRGCNConv           | Not supported |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | SplineConv                | Supported     | Only inference is supported.                      |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | NNConv                    | Supported     |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | CGConv                    | Supported     |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | EdgeConv                  | Supported     |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | DynamicEdgeConv           | Supported     |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | XConv                     | Supported     |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | HypergraphConv            | Supported     | ``num_edges`` is required.                        |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | LEConv                    | Supported     |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | PNAConv                   | Supported     |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | ClusterGCNConv            | Supported     |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | PANConv                   | Not supported |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | WLConv                    | Not supported |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | WLConvContinuous          | Supported     |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | SuperGATConv              | Not supported |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | GeneralConv               | Supported     |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | HGTConv                   | Supported     |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | HeteroConv                | Supported     |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | LGConv                    | Supported     |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | PointGNNConv              | Supported     |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | GPSConv                   | Not supported |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | RGATConv                  | Supported     | The ``attention_mechanism`` option                |
    |                               |                           |               | ``within-relation`` is not supported.             |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | FiLMConv                  | Supported     | ``num_relations`` cannot be greater than 1.       |
    |                               |                           |               |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | GCNConv                   | Supported     | ``add_self_loops`` must be set to False.          |
    |                               +---------------------------+               |                                                   |
    |                               | GravNetConv               |               |                                                   |
    |                               +---------------------------+               |                                                   |
    |                               | GATConv                   |               |                                                   |
    |                               +---------------------------+               |                                                   |
    |                               | GATv2Conv                 |               |                                                   |
    |                               +---------------------------+               |                                                   |
    |                               | AGNNConv                  |               |                                                   |
    |                               +---------------------------+               |                                                   |
    |                               | SGConv                    |               |                                                   |
    |                               +---------------------------+               |                                                   |
    |                               | SSGConv                   |               |                                                   |
    |                               +---------------------------+               |                                                   |
    |                               | FastRGCNConv              |               |                                                   |
    |                               +---------------------------+               |                                                   |
    |                               | SignedConv                |               |                                                   |
    |                               +---------------------------+               |                                                   |
    |                               | DNAConv                   |               |                                                   |
    |                               +---------------------------+               |                                                   |
    |                               | PointNetConv              |               |                                                   |
    |                               +---------------------------+               |                                                   |
    |                               | GMMConv                   |               |                                                   |
    |                               +---------------------------+               |                                                   |
    |                               | PPFConv                   |               |                                                   |
    |                               +---------------------------+               |                                                   |
    |                               | FeaStConv                 |               |                                                   |
    |                               +---------------------------+               |                                                   |
    |                               | PointTransformerConv      |               |                                                   |
    |                               +---------------------------+               |                                                   |
    |                               | GENConv                   |               |                                                   |
    |                               +---------------------------+               |                                                   |
    |                               | GCN2Conv                  |               |                                                   |
    |                               +---------------------------+               |                                                   |
    |                               | FAConv                    |               |                                                   |
    |                               +---------------------------+               |                                                   |
    |                               | EGConv                    |               |                                                   |
    |                               +---------------------------+               |                                                   |
    |                               | PDNConv                   |               |                                                   |
    |                               +---------------------------+               |                                                   |
    |                               | HEATConv                  |               |                                                   |
    |                               +---------------------------+               |                                                   |
    |                               | HANConv                   |               |                                                   |
    |                               +---------------------------+               |                                                   |
    |                               | AntiSymmetricConv         |               |                                                   |
    +-------------------------------+---------------------------+---------------+---------------------------------------------------+
    | Aggregation Layers            | MultiAggregation          | Supported     | ``dim_size`` is required.                         |
    |                               +---------------------------+               |                                                   |
    |                               | SumAggregation            |               |                                                   |
    |                               +---------------------------+               |                                                   |
    |                               | MeanAggregation           |               |                                                   |
    |                               +---------------------------+               |                                                   |
    |                               | MaxAggregation            |               |                                                   |
    |                               +---------------------------+               |                                                   |
    |                               | MinAggregation            |               |                                                   |
    |                               +---------------------------+               |                                                   |
    |                               | MulAggregation            |               |                                                   |
    |                               +---------------------------+               |                                                   |
    |                               | VarAggregation            |               |                                                   |
    |                               +---------------------------+               |                                                   |
    |                               | StdAggregation            |               |                                                   |
    |                               +---------------------------+               |                                                   |
    |                               | SoftmaxAggregation        |               |                                                   |
    |                               +---------------------------+               |                                                   |
    |                               | PowerMeanAggregation      |               |                                                   |
    |                               +---------------------------+               |                                                   |
    |                               | DeepSetsAggregation       |               |                                                   |
    |                               +---------------------------+               |                                                   |
    |                               | AttentionalAggregation    |               |                                                   |
    |                               +---------------------------+               |                                                   |
    |                               | Set2Set                   |               |                                                   |
    |                               +---------------------------+               |                                                   |
    |                               | DegreeScalerAggregation   |               |                                                   |
    |                               +---------------------------+               |                                                   |
    |                               | MedianAggregation         |               |                                                   |
    |                               +---------------------------+               |                                                   |
    |                               | QuantileAggregation       |               |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | SortAggregation           | Supported     | * ``dim_size`` is required.                       |
    |                               +---------------------------+               | * ``max_num_elements`` is required.               |
    |                               | LSTMAggregation           |               |                                                   |
    |                               +---------------------------+               |                                                   |
    |                               | MLPAggregation            |               |                                                   |
    |                               +---------------------------+               |                                                   |
    |                               | GRUAggregation            |               |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | SetTransformerAggregation | Not supported |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | GraphMultisetTransformer  | Not supported |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | EquilibriumAggregation    | Not supported |                                                   |
    +-------------------------------+---------------------------+---------------+---------------------------------------------------+
    | Normalization layers          | BatchNorm                 | Supported     |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | HeteroBatchNorm           | Not supported |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | HeteroLayerNorm           | Not supported |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | InstanceNorm              | Supported     | ``batch_size`` is required.                       |
    |                               +---------------------------+               |                                                   |
    |                               | GraphNorm                 |               |                                                   |
    |                               +---------------------------+               |                                                   |
    |                               | LayerNorm                 |               |                                                   |
    |                               +---------------------------+               |                                                   |
    |                               | GraphSizeNorm             |               |                                                   |
    |                               +---------------------------+               |                                                   |
    |                               | PairNorm                  |               |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | MeanSubtractionNorm       | Supported     | ``dim_size`` is required.                         |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | MessageNorm               | Supported     |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | DiffGroupNorm             | Supported     |                                                   |
    +-------------------------------+---------------------------+---------------+---------------------------------------------------+
    | Pooling layers                | Pooling                   | Supported     |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | global_add_pool           | Supported     | ``size`` is required.                             |
    |                               +---------------------------+               |                                                   |
    |                               | global_mean_pool          |               |                                                   |
    |                               +---------------------------+               |                                                   |
    |                               | global_max_pool           |               |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | TopKPooling               | Not supported |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | PANPooling                | Not supported |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | SAGPooling                | Not supported |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | EdgePooling               | Not supported |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | ASAPooling                | Not supported |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | MemPooling                | Supported     | * ``batch_size`` is required.                     |
    |                               |                           |               | * ``max_num_nodes`` is required.                  |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | max_pool                  | Not supported |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | avg_pool                  | Not supported |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | consecutive_cluster       | Not supported |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | max_pool_neighbor_x       | Not supported |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | avg_pool_neighbor_x       | Not supported |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | max_pool_x                | Supported     | * ``batch_size`` is required.                     |
    |                               +---------------------------+               | * ``size`` is required.                           |
    |                               | avg_pool_x                |               |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | graclus                   | Not supported |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | voxel_grid                | Supported     |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | fps                       | Supported     | * ``ptr`` is required.                            |
    |                               |                           |               | * ``batch`` has to be ``None``.                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | knn                       | Supported     |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | knn_graph                 | Supported     | ``loop`` must be set to True.                     |
    |                               |                           |               |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | radius                    | Supported     | ``batch_size`` is required.                       |
    |                               +---------------------------+               |                                                   |
    |                               | radius_graph              |               |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | nearest                   | Supported     | * ``torch_cluster.nearest`` has to be replaced    |
    |                               |                           |               |   with ``poptorch.nearest``.                      |
    |                               |                           |               | * ``poptorch.nearest`` supports  arguments        |
    |                               |                           |               |   ``batch_x`` and ``batch_y`` in the original     |
    |                               |                           |               |   form of ``torch.Tensor`` plus a regular list.   |
    |                               |                           |               | * Validation of batch indices is NOT performed if |
    |                               |                           |               |   ``batch_x`` and ``batch_y`` are passed as       |
    |                               |                           |               |   ``torch.Tensor``.                               |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | decimation_indices        | Not supported |                                                   |
    +-------------------------------+---------------------------+---------------+---------------------------------------------------+
    | Unspooling layers             | knn_interpolate           | Supported     |                                                   |
    +-------------------------------+---------------------------+---------------+---------------------------------------------------+
    | Functional                    | bro                       | Not supported |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | gini                      | Supported     |                                                   |
    +-------------------------------+---------------------------+---------------+---------------------------------------------------+
    | Dense convolutional layers    | DenseGCNConv              | Supported     |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | DenseGINConv              | Supported     |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | DenseGraphConv            | Supported     |                                                   |
    +                               +---------------------------+---------------+---------------------------------------------------+
    |                               | DenseSAGEConv             | Supported     |                                                   |
    +                               +---------------------------+---------------+---------------------------------------------------+
    |                               | DenseGATConv              | TBD           |                                                   |
    +-------------------------------+---------------------------+---------------+---------------------------------------------------+
    | Dense pooling layers          | dense_diff_pool           | Not supported |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | dense_mincut_pool         | Not supported |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | DMoNPooling               | Not supported |                                                   |
    +-------------------------------+---------------------------+---------------+---------------------------------------------------+
    | Encoding                      | PositionalEncoding        | Supported     |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | TemporalEncoding          | Supported     |                                                   |
    +-------------------------------+---------------------------+---------------+---------------------------------------------------+
    | KGE Models                    | TransE                    | Supported     |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | ComplEx                   | Supported     |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | DistMult                  | Supported     |                                                   |
    |                               +---------------------------+---------------+---------------------------------------------------+
    |                               | RotatE                    | Supported     |                                                   |
    +-------------------------------+---------------------------+---------------+---------------------------------------------------+


================================================
FILE: docs/poptorch_geometric/user_guide/tutorials.rst
================================================
.. _examples_and_tutorials:

======================
Examples and tutorials
======================

Examples demonstrating different use scenarios for PopTorch Geometric are
available in the
`Graphcore examples repository on GitHub <https://github.com/graphcore/examples>`_.

Tutorials in the form of Jupyter notebooks are available in the `PyTorch Geometric tutorials directory <https://github.com/graphcore/examples/tree/master/tutorials/tutorials/pytorch_geometric>`__. These tutorials show how to get the maximum benefit from IPU systems with PopTorch Geometric.


================================================
FILE: docs/user_guide/CMakeLists.txt
================================================
set(LONG_TESTS mnist inferenceModel)

function(add_poptorch_py_user_guide_example name path)
  message(STATUS "Adding python example '${name}'")
  set(extra_labels "")
  if("${name}" STREQUAL "pipeline_simple")
    set(extra_labels ";external_data")
  else()
    if("${name}" IN_LIST LONG_TESTS)
      set(extra_labels "")
    else()
      set(extra_labels ";short")
    endif()
  endif()

  add_test(NAME "${name}_user_guide_example"
           COMMAND python3 ${path}/${name}.py
           WORKING_DIRECTORY ${PROJECT_BINARY_DIR})
  set_tests_properties("${name}_user_guide_example" PROPERTIES LABELS "user_guide_examples${extra_labels}")
endfunction()

install(FILES "poptorch.conf" DESTINATION "${PROJECT_BINARY_DIR}/tmp")

file(GLOB EXAMPLES "${CMAKE_CURRENT_SOURCE_DIR}/*.py")
if(COPY_TESTS)
  install(FILES ${EXAMPLES} DESTINATION "${CMAKE_CURRENT_BINARY_DIR}")
  set(DOC_EXAMPLES_PATH "${CMAKE_CURRENT_BINARY_DIR}")
else()
  set(DOC_EXAMPLES_PATH "${CMAKE_CURRENT_SOURCE_DIR}")
endif()

foreach(EXAMPLE ${EXAMPLES})
  get_filename_component(NAME ${EXAMPLE} NAME_WE)
  add_poptorch_py_user_guide_example(${NAME} ${DOC_EXAMPLES_PATH})
endforeach()

if(BUILD_DOCS)
  run_poptorch_install_command(
    "python3 ${PROJECT_SOURCE_DIR}/scripts/docs_build.py --install-dir ${CMAKE_INSTALL_PREFIX} --add-to-sys-path ${CMAKE_INSTALL_PREFIX}"
    "${PROJECT_BINARY_DIR}"
    "docs_build.py")
endif()


================================================
FILE: docs/user_guide/api.py
================================================
# Copyright (c) 2020 Graphcore Ltd. All rights reserved.

import tempfile
import os
import torch
import poptorch


# ctc_beam_search_start
class Model(torch.nn.Module):
    def forward(self, log_probs, lengths):
        return poptorch.ctc_beam_search_decoder(log_probs, lengths)


# ctc_beam_search_end


# print_tensor_start
class ExampleModel(torch.nn.Module):
    def __init__(self):
        super().__init__()
        self.bias = torch.nn.Parameter(torch.zeros(()))

    def forward(self, x):
        x = x + 1

        # It is important to make sure the result of the print is used.
        x = poptorch.ipu_print_tensor(x)

        return x + self.bias


# print_tensor_end

model = poptorch.inferenceModel(ExampleModel())
model(torch.tensor([1.0, 2.0, 3.0]))


# identity_start
def custom_loss(output, target):
    # Mean squared error with a scale
    loss = output - target
    loss = loss * loss * 5
    return poptorch.identity_loss(loss, reduction="mean")


class ExampleModelWithCustomLoss(torch.nn.Module):
    def __init__(self):
        super().__init__()
        self.model = ExampleModel()

    def forward(self, input, target):
        out = self.model(input)
        return out, custom_loss(out, target)


# identity_end

model_with_loss = ExampleModelWithCustomLoss()
poptorch_model = poptorch.trainingModel(model_with_loss)

print(f"Bias before training: {model_with_loss.model.bias}")

for _ in range(100):
    out, loss = poptorch_model(input=torch.tensor([1.0, 2.0, 3.0]),
                               target=torch.tensor([3.0, 4.0, 5.0]))
    print(f"Out = {out}, loss = {float(loss):.2f}")

print(f"Bias after training: {model_with_loss.model.bias}")

torch.testing.assert_close(model_with_loss.model.bias,
                           torch.tensor(1.0, dtype=torch.float),
                           rtol=1e-4,
                           atol=1e-5)
poptorch_model.destroy()

model = ExampleModelWithCustomLoss()
input = torch.tensor([1.0, 2.0, 3.0])
target = torch.tensor([3.0, 4.0, 5.0])
options = poptorch.Options()
# optim_start
opt = poptorch.optim.SGD(model.parameters(),
                         lr=0.01,
                         loss_scaling=2.0,
                         use_combined_accum=False)
poptorch_model = poptorch.trainingModel(model, options, opt)
poptorch_model(input, target)
# Update optimizer attribute
opt.loss_scaling = 1.0
# Update param_group attribute
opt.param_groups[0]["loss_scaling"] = 1.0
# Set the new optimizer in the model
poptorch_model.setOptimizer(opt)
poptorch_model(input, target)
# optim_end
poptorch_model.destroy()

# optim_const_start
# lr, momentum and loss_scaling will be marked as variable.
opt = poptorch.optim.SGD(model.parameters(),
                         lr=0.01,
                         momentum=0.0,
                         use_combined_accum=False)
# momentum and loss_scaling  will be marked as constant.
opt = poptorch.optim.SGD(model.parameters(), lr=0.01, use_combined_accum=False)
# lr and momentum will be marked as variable.
# loss_scaling will be marked as constant.
opt = poptorch.optim.SGD(model.parameters(),
                         lr=0.01,
                         momentum=0.0,
                         loss_scaling=2.0,
                         use_combined_accum=False)
opt.variable_attrs.markAsConstant("loss_scaling")
# lr, momentum and loss_scaling will be marked as variable.
opt = poptorch.optim.SGD(model.parameters(),
                         lr=0.01,
                         loss_scaling=2.0,
                         use_combined_accum=False)
opt.variable_attrs.markAsVariable("momentum")
# optim_const_end

# torch_optim_const_start
# momentum will be marked as constant (It's not set)
opt = torch.optim.SGD(model.parameters(), lr=0.01)
# lr will be marked as variable.
# momentum will still be marked as constant (Because its default value is 0.0)
opt = torch.optim.SGD(model.parameters(), lr=0.01, momentum=0.0)
# lr and momentum will both be marked as variable.
opt = torch.optim.SGD(model.parameters(), lr=0.01, momentum=1.0)
# torch_optim_const_end

# conf_load_start
opts = poptorch.Options()
opts.loadFromFile("tmp/poptorch.conf")
# conf_load_end

with tempfile.TemporaryDirectory() as d:
    PATH = os.path.join(d, "checkpoint.pt")
    # optim_state_dict_start
    optimizer = poptorch.optim.Adam(model.parameters())
    poptorch_model = poptorch.trainingModel(model, optimizer=optimizer)
    poptorch_model(input, target)

    # Saving the optimizer state
    torch.save({'optimizer_state_dict': optimizer.state_dict()}, PATH)

    # Destroy original model to prevent an error when wrapping the model again
    poptorch_model.destroy()

    new_optimizer = poptorch.optim.Adam(model.parameters())
    # Loading the optimizer state back
    checkpoint = torch.load(PATH)
    new_optimizer.load_state_dict(checkpoint['optimizer_state_dict'])

    # The new training model will use the loaded optimizer state
    new_poptorch_model = poptorch.trainingModel(model, optimizer=optimizer)
    # optim_state_dict_end


================================================
FILE: docs/user_guide/batching.rst
================================================
.. _efficient_data_batching:

=======================
Efficient data batching
=======================

By default, PopTorch will process the ``batch_size`` which you provided to
the :py:class:`~poptorch.DataLoader`. This value is known as the micro-batch
size.

When using the other options below, the actual number of samples used per step
varies to allow the IPU(s) to process data more efficiently.

However, the effective batch size for operations which depend on it (for example the size of mini-batches, in PyTorch's terminology, when using Pytorch's `BatchNorm <https://pytorch.org/docs/stable/generated/torch.nn.BatchNorm2d.html>`__ layers) will not change. All that changes is how much data is
actually sent for a single step.

.. note:: Failure to use :py:class:`~poptorch.DataLoader` may result in
   accidentally changing the effective batch size for operations which depend on
   it, such as batch normalization.

:tutorials-repo:`PopTorch tutorial: Efficient data loading  <tutorials/pytorch/efficient_data_loading>`
is a detailed tutorial regarding efficient data loading, batching and tuning relevant hyperparameters in PopTorch.

poptorch.DataLoader
===================

PopTorch provides a thin wrapper around the traditional `torch.utils.data.DataLoader <https://pytorch.org/docs/1.10.0/data.html#torch.utils.data.DataLoader>`_
to abstract away some of the batch sizes calculations. If :py:class:`~poptorch.DataLoader`
is used in a distributed execution environment, it will ensure that each process uses
a different subset of the dataset.

If you set the :py:class:`~poptorch.DataLoader` ``batch_size`` to more than 1
then each operation in the model will process that number of elements at any
given time. Please see the usage example below.

poptorch.AsynchronousDataAccessor
=================================

To reduce host overhead you can offload the data loading process to a
separate thread by specifying :py:class:`mode=poptorch.DataLoaderMode.Async <poptorch.DataLoaderMode>` in the
:py:class:`~poptorch.DataLoader` constructor. Internally this uses an
:py:class:`~poptorch.AsynchronousDataAccessor`. Doing this allows you to reduce
the host/IPU communication overhead by using the time that the IPU is running
to load the next batch on the CPU. This means that when the IPU is finished
executing and returns to host the data will be ready for the IPU to pull in again.

.. literalinclude:: device_iterations.py
  :caption: Use of AsynchronousDataAccessor
  :start-after: data_accessor_start
  :end-before: data_accessor_end
  :emphasize-lines: 10
  :linenos:

.. warning:: Tensors being iterated over using an
  :py:class:`~poptorch.AsynchronousDataAccessor` use shared memory. You must clone
  tensors at each iteration if you wish to keep their references outside of each
  iteration.

  Consider the following example:

  .. code-block:: python
    :emphasize-lines: 5

    predictions, labels = [], []

    for data, label in dataloader:
        predictions += poptorch_model(data)
        labels += label

  The ``predictions`` list will be correct because it's producing a new tensor from the
  inputs. However, The list ``labels`` will contain identical references. This line
  would need to be replaced with the following:

  .. code-block:: python

    labels += label.detach().clone()

Rebatching iterable datasets
----------------------------

There are `two types of datasets in PyTorch <https://pytorch.org/docs/1.10.0/data.html#dataset-types>`_ : map-style datasets and iterable datasets.

As explained in the notes of PyTorch's `Data Loading Order and Sampler <https://pytorch.org/docs/1.10.0/data.html#data-loading-order-and-sampler>`_: for
`IterableDataset <https://pytorch.org/docs/1.10.0/data.html#torch.utils.data.IterableDataset>`_:
"When fetching from iterable-style datasets with multi-processing, the drop_last argument drops the
last non-full batch of each worker's dataset replica."

This means that if the number of elements is naively
divided among the number of workers (which is the default behaviour) then potentially a significant number of elements will be dropped.

For example:

.. code-block:: python

  num_tensors = 100
  num_workers = 7
  batch_size = 4

  per_worker_tensors = ceil(100 / num_workers) = 15
  last_worker_tensors = 100 - (num_workers - 1) * per_worker_tensors = 10

  num_tensors_used = batch_size * (floor(per_worker_tensors / batch_size) * (num_workers - 1) + floor(last_worker_tensors / batch_size))
                   = 80

This means in this particular case 20% of the dataset will never be used. But, in general the larger the number of workers and the batch size, the more data will end up being unused.

To work around this issue PopTorch has a :py:class:`mode=poptorch.DataLoaderMode.AsyncRebatched <poptorch.DataLoaderMode>`.
PopTorch will set the ``batch_size`` in the PyTorch Dataset and DataLoader to 1 and will instead create the batched tensors in its worker process.

The shape of the tensors returned by the DataLoader will be the same as before, but the number of used tensors from the dataset  will increase to
``floor(num_tensors / batch_size) * batch_size`` (which means all the tensors would be used in the example above).

.. note:: This flag is not enabled by default because the behaviour is different from the upstream DataLoader.

.. _device_iterations:

poptorch.Options.deviceIterations
=================================

When training, a device iteration corresponds to one iteration of the training
loop executed on the IPU, starting with data loading, followed by the forward
and backward passes, and ending with a weight update. If
:ref:`gradient accumulation <gradient_accumulation>` is not used then if you set
:py:meth:`~poptorch.Options.deviceIterations` to `n`, PopTorch will carry out
this loop `n` times (processing `n` micro-batches) on the IPU before returning
control to the host, which will improve processing efficiency. If gradient
accumulation is used then the number of micro-batches processed will be `n`
multiplied by the value set using
:py:meth:`~poptorch.options._TrainingOptions.gradientAccumulation`.

For inference, a device iteration corresponds to data loading and the forward pass.

Note that the returned output dimensions depend on
:py:meth:`~poptorch.Options.outputMode`. The default value for
:py:func:`~poptorch.trainingModel` is `Final`, since you will often not need to
receive all or any of the output tensors and it is more efficient not to
receive them. Therefore, only the last batch of data will be returned to the
host under this setting. You can change this behaviour by setting the value of
:py:meth:`~poptorch.Options.outputMode`. to `All`. This returns the result of
every batch to the host.

.. note:: When running an
  :py:class:`~poptorch.inferenceModel` with
  :py:class:`~poptorch.PipelinedExecution`, you must set
  :py:meth:`~poptorch.Options.deviceIterations` to at least the number of
  pipeline steps.


.. literalinclude:: device_iterations.py
  :caption: Use of device iterations and batch size
  :start-after: iterations_start
  :end-before: iterations_end
  :emphasize-lines: 51, 57, 63
  :linenos:

poptorch.Options.replicationFactor
==================================

:py:meth:`~poptorch.Options.replicationFactor` will replicate the model over
multiple IPUs to allow automatic data parallelism across many IPUs.

.. literalinclude:: device_iterations.py
  :caption: Use of replication factor
  :start-after: replication_start
  :end-before: replication_end
  :emphasize-lines: 13
  :linenos:

poptorch.Options.inputReplicaGrouping
=====================================

:py:meth:`~poptorch.Options.inputReplicaGrouping` allows the input batches to
be split between groups of replicas, in a similar way to what
:py:func:`~replicaGrouping` does for weight tensors. See
:numref:`grouping_tensor_weights`.

.. _gradient_accumulation:

poptorch.Options.Training.gradientAccumulation
==============================================

You can use
:py:meth:`~poptorch.options._TrainingOptions.gradientAccumulation`
to run a number of micro-batches before updating parameters (weights) during
training. The number of gradient accumulations is equal to the number of
micro-batches (batches whose size is specified as the ``batch_size`` value
provided to the :py:class:`~poptorch.DataLoader`) which are processed between
model updates. After accumulation, PopTorch updates the model using the
gradients accumulated from processing all the batches.

.. note:: When running an :py:class:`~poptorch.inferenceModel`,  you must set
  :py:meth:`~poptorch.options._TrainingOptions.gradientAccumulation` to 1.

As mentioned in :numref:`pipelined_execution`, you need to use gradient
accumulations when training with :py:class:`~poptorch.PipelinedExecution`
because the parameters can only be updated between pipeline runs.  You need to
set the number of accumulations to at least the number of pipeline stages.
However, with this value, the pipeline will switch into the "ramp-down"
period as soon as it has finished the "ramp-up" period. Using a larger number
of gradient accumulations means that the pipeline will run at full efficiency
for longer. However, the increase in batches between parameter updates may
reduce the overall training efficiency of your model. The optimal number of
gradient accumulations is a trade off between these two factors.

.. note:: :py:meth:`~poptorch.options._TrainingOptions.gradientAccumulation`
   is only needed by :py:class:`~poptorch.PipelinedExecution`. Other execution
   modes may benefit from it because the IPUs will spend less time updating
   parameters during training.


.. literalinclude:: device_iterations.py
  :caption: Use of gradient accumulation
  :start-after: gradient_acc_start
  :end-before: gradient_acc_end
  :emphasize-lines: 12
  :linenos:

In the code example below, :py:class:`~poptorch.Block` introduced in
:numref:`execution_strategies` is used to divide up
a different model into disjoint subsets of layers.
These blocks can be shared among multiple parallel execution strategies.

.. literalinclude:: mnist.py
  :language: python
  :linenos:
  :start-after: annotations_start
  :end-before: annotations_end
  :emphasize-lines: 12, 14, 16, 18, 34
  :caption: A training model making use of :py:class:`~poptorch.Block`

You can see the code examples of :py:class:`~poptorch.SerialPhasedExecution`,
:py:class:`~poptorch.PipelinedExecution`, and
:py:class:`~poptorch.ShardedExecution` below.

An instance of class :py:class:`~poptorch.PipelinedExecution` defines an
execution strategy that assigns layers to multiple IPUs as a pipeline. Gradient
accumulation is used to push multiple batches through the pipeline allowing
IPUs to run in parallel.

.. literalinclude:: mnist.py
  :caption: An example of different parallel execution strategies
  :language: python
  :linenos:
  :start-after: annotations_strategy_start
  :end-before: annotations_strategy_end
  :emphasize-lines: 6, 13, 19, 21


:numref:`figPipeline` shows the pipeline execution for multiple batches
on IPUs. There are 4 pipeline stages running on 4 IPUs respectively.
Gradient accumulation enables us to keep the same number of pipeline stages,
but with a wider pipeline.
This helps hide the latency, which is the total time for one item to go
through the whole system, as highlighted.

.. _figPipeline:
.. figure:: IPU-pipeline.jpg
   :width: 400

   Pipeline execution with gradient accumulation

.. _trainingOutputMode:

poptorch.Options.outputMode
==========================================

When you use a :py:func:`~poptorch.inferenceModel`, you will usually want to
receive all the output tensors. For this reason, PopTorch will return them
all to you by default. However, you can change this behaviour using
:py:func:`~poptorch.Options.outputMode`.

When you use a :py:func:`~poptorch.trainingModel`, you will often not need to
receive all or any of the output tensors and it is more efficient not to
receive them. For this reason, PopTorch only returns the last batch of tensors
by default. As in the the case of ``inferenceModel``, you can change this
behaviour using :py:func:`~poptorch.Options.outputMode`.

If you want to monitor training using a metric such as loss or accuracy, you
may wish to take into account all tensors. To do this with minimal or no
overhead, you can use ``poptorch.OutputMode.Sum``. For example:

 .. literalinclude:: sumAnchorReturnType.py
  :caption: A model which returns training accuracy as a tensor
  :language: python
  :linenos:
  :start-after: model_returning_accuracy_start
  :end-before: model_returning_accuracy_end

 .. literalinclude:: sumAnchorReturnType.py
  :caption: Efficient calculation of training accuracy across all batches
  :language: python
  :linenos:
  :start-after: sum_accuracy_start
  :end-before: sum_accuracy_end


================================================
FILE: docs/user_guide/buffers.py
================================================
# Copyright (c) 2021 Graphcore Ltd. All rights reserved.
import torch
import poptorch


# counter_model_wrong_start
class CounterModel(torch.nn.Module):
    def __init__(self):
        super().__init__()
        self.i = torch.tensor([0.], dtype=torch.float)

    def forward(self):
        self.i += 1
        return self.i


model = CounterModel()
poptorch_model = poptorch.inferenceModel(model)
print(poptorch_model())  # tensor([1.])
print(poptorch_model())  # tensor([1.])
# counter_model_wrong_end

torch.testing.assert_close(model.i, torch.tensor([1.], dtype=torch.float))


# pragma pylint: disable=function-redefined,no-member
# counter_model_correct_start
class CounterModel(torch.nn.Module):
    def __init__(self):
        super().__init__()
        self.register_buffer("i", torch.tensor([0.], dtype=torch.float))

    def forward(self):
        self.i += 1
        return self.i


model = CounterModel()
poptorch_model = poptorch.inferenceModel(model)

print(poptorch_model())  # tensor([1.])
print(poptorch_model())  # tensor([2.])
# counter_model_correct_end

# Because the model is running in inference mode, we will need to manually
# call copyWeightsToHost
poptorch_model.copyWeightsToHost()
torch.testing.assert_close(model.i, torch.tensor([2.], dtype=torch.float))


================================================
FILE: docs/user_guide/debugging.py
================================================
#!/usr/bin/env python3
# Copyright (c) 2021 Graphcore Ltd. All rights reserved.
import torch
import poptorch


class Model(torch.nn.Module):
    def __init__(self):
        super().__init__()
        self.fc1 = torch.nn.Linear(10, 10)
        self.relu = torch.nn.ReLU()
        self.fc2 = torch.nn.Linear(10, 10)
        self.loss = torch.nn.MSELoss(reduction="mean")

    def forward(self, x, labels=None):
        out = self.fc2(self.relu(self.fc1(x)))
        if self.training:
            return self.loss(out, labels)
        return out


# tensor_names_start
input = torch.rand(10, 10)
label = torch.rand(10, 10)

model = Model()
poptorch_model = poptorch.trainingModel(model)
poptorch_model(input, label)

tensor_names = poptorch_model.getTensorNames()
# tensor_names_end

# tensor_anchor_start
opts = poptorch.Options()
opts.anchorTensor('grad_bias', 'Gradient___fc2.bias')
opts.anchorTensor('update_weight', 'UpdatedVar___fc2.weight')
# tensor_anchor_end

poptorch_model.destroy()

# tensor_retrieve_start
poptorch_model = poptorch.trainingModel(model, opts)
poptorch_model(input, label)

grad = poptorch_model.getAnchoredTensor('grad_bias')
update = poptorch_model.getAnchoredTensor('update_weight')
# tensor_retrieve_end

poptorch_model.destroy()

# optim_state_dict_start
optim = poptorch.optim.SGD(model.parameters(), lr=0.01)
poptorch_model = poptorch.trainingModel(model, opts, optim)
poptorch_model(input, label)

state = optim.state_dict()
# optim_state_dict_end


================================================
FILE: docs/user_guide/debugging.rst
================================================
=====================
Debugging your model
=====================

Inspecting tensors
==================

PopTorch allows you to inspect arbitrary tensors in both inference and
training models. This is very useful for debugging conditions such as
overflows, underflows or vanishing gradients.

Numerous tensors are generated during model compilation. In order to inspect their values, you first have to find their names. You can
retrieve the complete list of tensor names in your model by calling
:py:func:`~poptorch.PoplarExecutor.getTensorNames`. Note that the model
must first be compiled.

.. literalinclude:: debugging.py
  :caption: Retrieving the list of tensor names
  :start-after: tensor_names_start
  :end-before: tensor_names_end
  :emphasize-lines: 8

Anchoring tensors
=================

Once you have chosen a few tensors of interest, the next step is to create anchors.
Anchoring enables a tensor to be observed by the application without it having to
be a model output.

You can create an anchor by calling :py:func:`~poptorch.Options.anchorTensor`.
It takes two mandatory string parameters: a convenient user-defined name for
the anchor and the name of the chosen tensor. Optionally, you may specify the
output mode as well as the output return period. In order for these option settings
to take effect, they must be set before model compilation.

In the example below, two anchors are created: one for a bias gradient tensor
and one for the updated weights of a linear layer.

.. literalinclude:: debugging.py
  :caption: Anchoring tensors
  :start-after: tensor_anchor_start
  :end-before: tensor_anchor_end
  :emphasize-lines: 2, 3

Retrieving tensors
==================

The anchored tensors will be updated after every model invocation. You can
retrieve their values using :py:func:`~poptorch.PoplarExecutor.getAnchoredTensor`.
The function takes a single parameter - the user-defined anchor name.

In the example below, we execute one training run and retrieve the values of
the two tensors we anchored previously.

.. literalinclude:: debugging.py
  :caption: Anchoring tensors
  :start-after: tensor_retrieve_start
  :end-before: tensor_retrieve_end
  :emphasize-lines: 4, 5

For a more practical understanding around observing tensors, the `Graphcore  GitHub examples repository <https://github.com/graphcore/examples>`__ contains a tutorial you can follow about observing tensors, using anchoring and generating a gradient histogram:
:tutorials-repo:`PopTorch tutorial: Observing tensors <tutorials/pytorch/observing_tensors>`.

Inspecting optimiser state
==========================

You can inspect the optimiser state without using anchoring. After you instantiate a
:py:func:`~poptorch.trainingModel`, the optimiser's `state_dict()` function will
return the internal optimiser's state. This state dictionary will be populated
when the training model is compiled, and is updated after each training step.

.. literalinclude:: debugging.py
  :caption: Inspecting optimiser state
  :start-after: optim_state_dict_start
  :end-before: optim_state_dict_end
  :emphasize-lines: 5

.. note:: The entries in PopTorch's optimiser `state_dict()` may differ from those in PyTorch in both name and structure.


================================================
FILE: docs/user_guide/device_iterations.py
================================================
# Copyright (c) 2020 Graphcore Ltd. All rights reserved.
import sys
import poptorch

if not poptorch.ipuHardwareIsAvailable():
    print("Replicated top level graphs are not supported on the IPU model")
    sys.exit(0)
# pylint: disable=unused-variable, wrong-import-position, reimported, ungrouped-imports, wrong-import-order
# iterations_start
from functools import reduce
from operator import mul

import torch
import poptorch


class ExampleModelWithLoss(torch.nn.Module):
    def __init__(self, data_shape, num_classes):
        super().__init__()

        self.fc = torch.nn.Linear(reduce(mul, data_shape), num_classes)
        self.loss = torch.nn.CrossEntropyLoss()

    def forward(self, x, target=None):
        reshaped = x.reshape([x.shape[0], -1])
        fc = self.fc(reshaped)

        if target is not None:
            return fc, self.loss(fc, target)
        return fc


class ExampleDataset(torch.utils.data.Dataset):
    def __init__(self, shape, length):
        super().__init__()
        self._shape = shape
        self._length = length

        self._all_data = []
        self._all_labels = []

        torch.manual_seed(0)
        for _ in range(length):
            label = 1 if torch.rand(()) > 0.5 else 0
            data = torch.rand(self._shape) + label
            data[0] = -data[0]
            self._all_data.append(data)
            self._all_labels.append(label)

    def __len__(self):
        return self._length

    def __getitem__(self, index):
        return self._all_data[index], self._all_labels[index]


def device_iterations_example():
    # Set the number of samples for which activations/gradients are computed
    # in parallel on a single IPU
    model_batch_size = 2

    # Create a poptorch.Options instance to override default options
    opts = poptorch.Options()

    # Run a 100 iteration loop on the IPU, fetching a new batch each time
    opts.deviceIterations(100)

    # Set up the DataLoader to load that much data at each iteration
    training_data = poptorch.DataLoader(opts,
                                        dataset=ExampleDataset(shape=[3, 2],
                                                               length=10000),
                                        batch_size=model_batch_size,
                                        shuffle=True,
                                        drop_last=True)

    model = ExampleModelWithLoss(data_shape=[3, 2], num_classes=2)
    # Wrap the model in a PopTorch training wrapper
    poptorch_model = poptorch.trainingModel(model, options=opts)

    # Run over the training data, 100 batches at a time (specified in
    # opts.deviceIterations())
    for batch_number, (data, labels) in enumerate(training_data):
        # Execute the device with a 100 iteration loop of batchsize 2.
        # "output" and "loss" will be the respective output and loss of the
        # final batch (the default OutputMode).

        output, loss = poptorch_model(data, labels)
        print(f"{labels[-1]}, {output}, {loss}")
    # iterations_end
    poptorch_model.destroy()  # release the IPUs


# replication_start
def replication_factor_example():
    # Set the number of samples for which activations/gradients are computed
    # in parallel on a single IPU
    model_batch_size = 2
    # replication_start
    # Create a poptorch.Options instance to override default options
    opts = poptorch.Options()

    # Run a 100 iteration loop on the IPU, fetching a new batch each time
    opts.deviceIterations(100)

    # Duplicate the model over 4 replicas.
    opts.replicationFactor(4)

    training_data = poptorch.DataLoader(opts,
                                        dataset=ExampleDataset(shape=[3, 2],
                                                               length=100000),
                                        batch_size=model_batch_size,
                                        shuffle=True,
                                        drop_last=True)

    model = ExampleModelWithLoss(data_shape=[3, 2], num_classes=2)
    # Wrap the model in a PopTorch training wrapper
    poptorch_model = poptorch.trainingModel(model, options=opts)

    # Run over the training data, 100 batches at a time (specified in
    # opts.deviceIterations())
    for batch_number, (data, labels) in enumerate(training_data):
        # Execute the device with a 100 iteration loop of model batchsize 2
        # across 4 IPUs (global batchsize = 2 * 4 = 8). "output" and "loss"
        # will be the respective output and loss of the final batch of each
        # replica (the default OutputMode).
        output, loss = poptorch_model(data, labels)
        print(f"{labels[-1]}, {output}, {loss}")
    # replication_end
    poptorch_model.destroy()  # release the IPUs


# gradient_acc_start
def gradient_accumulation_example():
    # Set the number of samples for which activations/gradients are computed
    # in parallel on a single IPU
    model_batch_size = 2
    # Create a poptorch.Options instance to override default options
    opts = poptorch.Options()

    # Run a 400 iteration loop on the IPU, fetching a new batch each time
    opts.deviceIterations(400)

    # Accumulate the gradient 8 times before applying it.
    opts.Training.gradientAccumulation(8)

    training_data = poptorch.DataLoader(opts,
                                        dataset=ExampleDataset(shape=[3, 2],
                                                               length=100000),
                                        batch_size=model_batch_size,
                                        shuffle=True,
                                        drop_last=True)

    # Wrap the model in a PopTorch training wrapper
    poptorch_model = poptorch.trainingModel(model, options=opts)

    # Run over the training data, 400 batches at a time (specified in
    # opts.deviceIterations())
    for batch_number, (data, labels) in enumerate(training_data):
        # Execute the device with a 100 iteration loop of model batchsize 2
        # with gradient updates every 8 iterations (global batchsize = 2 * 8 = 16).
        # "output" and "loss" will be the respective output and loss of the
        # final batch of each replica (the default OutputMode).
        output, loss = poptorch_model(data, labels)
        print(f"{labels[-1]}, {output}, {loss}")
    # gradient_acc_end
    poptorch_model.destroy()  # release the IPUs


def data_accessor_example():
    # Not displayed: just to keep the linter happy
    shape = [3, 2]
    num_tensors = 100
    batch_size = 1
    num_workers = 0
    device_iterations = 1
    replication_factor = 1
    # Example starts here:
    # data_accessor_start
    opts = poptorch.Options()
    opts.deviceIterations(device_iterations)
    opts.replicationFactor(replication_factor)

    loader = poptorch.DataLoader(opts,
                                 ExampleDataset(shape=shape,
                                                length=num_tensors),
                                 batch_size=batch_size,
                                 num_workers=num_workers,
                                 mode=poptorch.DataLoaderMode.Async)

    poptorch_model = poptorch.inferenceModel(model, opts)

    for it, (data, _) in enumerate(loader):
        out = poptorch_model(data)
    # data_accessor_end
    poptorch_model.destroy()  # release the IPUs


model = ExampleModelWithLoss(data_shape=[3, 2], num_classes=2)
model_batch_size = 2


# distributed_execution_start
def process(process_id=0, num_processes=1):
    # Create a poptorch.Options instance to override default options
    opts = poptorch.Options()

    # Run a 100 iteration loop on the IPU, fetching a new batch each time
    opts.deviceIterations(400)

    # Replicate the graph across 2 IPUs in each process.
    opts.replicationFactor(2)

    # Set the id of the current process and the total number of processes.
    opts.Distributed.configureProcessId(process_id, num_processes)

    # Accumulate the gradient 8 times before applying it.
    opts.Training.gradientAccumulation(8)

    # Optional: All the processes must use the same seed if shuffle=True is used for the DataLoader.
    opts.randomSeed(42)

    training_data = poptorch.DataLoader(opts,
                                        dataset=ExampleDataset(shape=[3, 2],
                                                               length=100000),
                                        batch_size=model_batch_size,
                                        shuffle=True,
                                        drop_last=True)

    # Wrap the model in a PopTorch training wrapper
    poptorch_model = poptorch.trainingModel(model, options=opts)

    # Run over the training data with "batch_size" 200 essentially.
    for batch_number, (data, labels) in enumerate(training_data):
        # Execute the device with a 100 iteration loop of batchsize 8 across
        # 4 IPUs (batch-size 2 per replica). "output" and "loss" will be the
        # respective output and loss of the final batch of each replica
        # (the default OutputMode).
        output, loss = poptorch_model(data, labels)
        print(f"{batch_number} {labels[-1]}, {output}, {loss}")

    # distributed_execution_end
    poptorch_model.destroy()  # release the IPUs


# AsynchronousDataAccessor must run in the main process
if __name__ == "__main__":
    device_iterations_example()
    replication_factor_example()
    gradient_accumulation_example()
    data_accessor_example()
    process()


================================================
FILE: docs/user_guide/error_handling.py
================================================
# Copyright (c) 2021 Graphcore Ltd. All rights reserved.
import torch
import poptorch
from poptorch.poptorch_core import TestErrorType


# pragma pylint: disable=broad-except
# This is a fake model which actually throws an exception
class PytorchModel(torch.nn.Module):
    def __init__(self, error):
        super().__init__()
        if error is not None:
            poptorch.poptorch_core._throwTestError(error)

    def forward(self, x, y):
        return x + y


def run_example(model_param=None):

    rebooted = False
    shutdown = False

    def reboot_server():
        nonlocal rebooted
        rebooted = True

    def shutdown_system():
        nonlocal shutdown
        shutdown = True

    # error_handling_start
    try:
        m = PytorchModel(model_param)
        inference_model = poptorch.inferenceModel(m)
        t1 = torch.tensor([1.])
        t2 = torch.tensor([2.])
        assert inference_model(t1, t2) == 3.0
    except poptorch.RecoverableError as e:
        print(e)
        if e.recovery_action == "FULL_RESET":
            reboot_server()
        elif e.recovery_action == "IPU_RESET":
            print("Need to reset the IPU")
        elif e.recovery_action == "PARITION_RESET":
            print("Need to reset the partition")
    except poptorch.UnrecoverableError as e:
        print(f"Unrecoverable error: machine needs to be taken offline: {e}")
        shutdown_system()
    except poptorch.Error as e:
        print(f"Received {e.message} from component {e.type}, "
              f"location: {e.location}")
        # Or you could just print all the information at once:
        print(e)
    except Exception as e:
        print(e)
    # error_handling_end
    if model_param == TestErrorType.PoplarRecoverableFullReset:
        assert rebooted
    elif model_param == TestErrorType.PoplarUnrecoverable:
        assert shutdown
    else:
        assert not rebooted
        assert not shutdown


if __name__ == "__main__":
    # Check the example is valid
    run_example()
    for t in TestErrorType.__members__.values():
        run_example(t)


================================================
FILE: docs/user_guide/example.rst
================================================
Examples
========

You can find PyTorch examples and tutorials in the Graphcore GitHub `examples repository <https://github.com/graphcore/examples>`__.
This contains:

* Examples of popular machine learning models for training and inference
* :tutorials-repo:`Tutorials <tutorials/pytorch>`
* :tutorials-repo:`Examples of PopTorch and IPU features <feature_examples/pytorch>`
* :tutorials-repo:`Examples of simple models <simple_applications/pytorch>`
* Source code from videos, blogs and other documents

MNIST example
_____________

The example in :numref:`mnist-example-code` shows how an MNIST model can be run on the IPU. The highlighted lines show the PopTorch-specific code required to run the example on multiple IPUs.

You can download the full source code from GitHub: :github-poptorch:`mnist.py <examples/mnist.py>`.

To run this example you will need to install the Poplar SDK (see the `Getting Started Guide <https://docs.graphcore.ai/en/latest/getting-started.html>`_ for your IPU system) and the appropriate version of ``torchvision``:

.. code-block:: console

    $ python3 -m pip install torchvision==0.11.1

.. literalinclude:: ../../examples/mnist.py
  :caption: MNIST example
  :name: mnist-example-code
  :start-after: mnist_start
  :end-before: mnist_end
  :emphasize-lines: 12, 15, 17, 20, 35, 96, 99
  :language: python
  :dedent: 3
  :linenos:
  :lineno-match:


================================================
FILE: docs/user_guide/experimental.rst
================================================
=====================
Experimental features
=====================

Distributed execution without PopRun
====================================

PopTorch supports distributed execution on a Pod using the IPU over Fabric
(IPUoF).

If you run a program using your own distributed processing tool instead of PopRun, the only change you need to make to your code is to set the ID of the current process and
the total number of processes the execution is distributed across, using
:py:meth:`~poptorch.options._DistributedOptions.configureProcessId`.

Note that :py:meth:`~poptorch.Options.replicationFactor` should
be used to set the number of local replicas (per host) not the total (global)
number of replicas.

.. literalinclude:: device_iterations.py
  :caption: Changes required for distributed execution
  :start-after: distributed_execution_start
  :end-before: distributed_execution_end
  :emphasize-lines: 9, 12, 18
  :linenos:

.. note:: ``DataLoader`` will automatically select a different subset of the
  dataset based on the process ID.

.. warning:: All the processes must use the same seed if ``shuffle=True`` is used
  for the ``DataLoader``.

torch.nn.CTCLoss
================

The CTCLoss operator is supported, with some limitations:

#. The ``reduction`` parameter must be set to either ``sum`` or ``mean``
#. The ``targets`` tensor must be 2D, corresponding to stacked, padded layout


================================================
FILE: docs/user_guide/hostio_optimisation.rst
================================================
=====================
Efficient IPU I/O
=====================

When developing applications for the IPU, maximising I/O performance is
important. If an application is still I/O-bound after optimising host data
loading, then you can explore further optimisations of the movement of data
into the IPU. This chapter will cover two specific optimisations that can
improve I/O performance:

* prefetch and multibuffering
* overlapping compute and I/O

Prefetch and multibuffering
===========================

Poplar supports prefetching and multibuffering to improve I/O performance.
For more details, see `Optimising host data transfers <https://docs.graphcore.ai/projects/poplar-user-guide/en/latest/poplar_programs.html#optimising-host-data-transfers>`__ in the Poplar and PopLibs User Guide.

Prefetch is enabled by default in Poplar. The default buffer depth is 1. You
can increase the value for the buffer depth to improve I/O performance:

.. code-block:: python

    opts = poptorch.Options()
    opts._Popart.set("defaultPrefetchBufferingDepth", 3)

Using multibuffering is especially useful when you see large ``StreamCopyBegin``
or ``StreamCopyEnd`` phases in your application's profile.

For example, :numref:`figNoBuffering` shows a profile of a simple program
without using buffering. The program consists of a loop where the IPU gets data
from the host, processes it and sends the result back. The ``StreamCopy``,
in light orange represents the data transfer. The first one is the host to IPU
transfer, the second one is the IPU to host transfer. They are split into a
``Begin``, a ``Mid``, and an ``End`` phase. In the ``Begin`` and ``End`` phases,
the IPU waits for the host to become ready. In the ``Mid`` phase the IPU
performs the transfer. Between the ``StreamCopy`` operations are the compute
steps, shown in red. In this profile, you can see the IPU is waiting for data
from the host for a significant amount of time.

.. figure:: no-buffering-profile.png
  :name: figNoBuffering
  :width: 100%

  Profile with multibuffering disabled

:numref:`figWithBuffering` shows the profile of the same program with
buffering. You can see that the IPU no longer waits for the host: the ``Begin``
and ``End`` section of the ``StreamCopy`` are gone.

.. figure:: with-buffering-profile.png
  :name: figWithBuffering
  :width: 100%

  Profile with multibuffering enabled and related improvements

Overlapping compute and I/O
===========================

To optimise I/O further, you can choose to dedicate a specified number of tiles
to communication and leave the rest of the tiles for compute. Computation
time will be adversely affected by having access to fewer tiles, so there is a
trade-off between optimising I/O and optimising compute here.

To overlap compute and I/O:

#. In PopTorch's ``Options``, you must specify the number of I/O tiles and
   select one of ``ShardedExecution``, ``ParallelPhasedExecution`` or
   ``SerialPhasedExecution`` as the ``ExecutionStrategy``:

    .. code-block:: python

        opts.TensorLocations.numIOTiles(64)
        opts.setExecutionStrategy(poptorch.ShardedExecution())

#. In the forward method of the model, you must set the ``OverlapMode``
   for the inputs and outputs of the model to ``OverlapDeviceIterationLoop``, as
   follows:

    .. code-block:: python

        def forward(self, x):
          x = poptorch.set_overlap_for_input(x, poptorch.OverlapMode.OverlapDeviceIterationLoop)
          x = some_compute(x)
          x = poptorch.set_overlap_for_output(x, poptorch.OverlapMode.OverlapDeviceIterationLoop)
          return x

:numref:`figWithBufferingOverlap` shows the profile of our simple program with
both compute I/O overlap and multibuffering enabled. The compute (in red) and
the I/O (in orange) are stacked on top of each other since they both happen at
the same time.

.. _figWithBufferingOverlap:
.. figure:: with-buffering-overlap-profile.png

  Profile with both multibuffering and I/O compute overlap enabled and related improvements


================================================
FILE: docs/user_guide/index.rst
================================================
PyTorch for the IPU: User Guide
===============================

.. toctree::
    :maxdepth: 4
    :numbered: 3

    intro
    installation
    pytorch_to_poptorch
    overview
    batching
    supported_ops
    debugging
    hostio_optimisation
    example
    experimental
    reference
    legal


================================================
FILE: docs/user_guide/inferenceModel.py
================================================
# Copyright (c) 2020 Graphcore Ltd. All rights reserved.
import os
import poptorch
# If running on the model then make sure to run on the full size model to
# avoid running out of memory.
if not poptorch.ipuHardwareIsAvailable():
    os.environ["POPTORCH_IPU_MODEL"] = "1"

# pylint: disable=reimported
# pylint: disable=ungrouped-imports
# pylint: disable=wrong-import-order
# pylint: disable=wrong-import-position

# inference_model_start
import torch
import torchvision
import poptorch

# Some dummy imagenet sized input.
picture_of_a_cat_here = torch.randn([1, 3, 224, 224])

# The model, in this case a MobileNet model with pretrained weights that comes
# canned with PyTorch.
model = torchvision.models.mobilenet_v2(pretrained=True)
model.train(False)

# Wrap in the PopTorch inference wrapper
inference_model = poptorch.inferenceModel(model)

# Execute on IPU.
out_tensor = inference_model(picture_of_a_cat_here)

# Get the top 5 ImageNet classes.
top_five_classes = torch.topk(torch.softmax(out_tensor, 1), 5)
print(top_five_classes)

# Try the same on native PyTorch
native_out = model(picture_of_a_cat_here)

native_top_five_classes = torch.topk(torch.softmax(native_out, 1), 5)

# Models should be very close to native output although some operations are
# numerically different and floating point differences can accumulate.
assert any(top_five_classes[1][0] == native_top_five_classes[1][0])
# inference_half_start
model = torch.nn.Linear(1, 10)

# Cast the parameters (weights) to half.
model.half()

t1 = torch.tensor([1.]).half()

opts = poptorch.Options()

inference_model = poptorch.inferenceModel(model, opts)
out = inference_model(t1)

assert out.dtype == torch.half
# inference_half_end


================================================
FILE: docs/user_guide/installation.rst
================================================
.. _installation:

============
Installation
============

.. contents::
  :local:

PopTorch is included with the Poplar SDK (see the `Getting Started guide <https://docs.graphcore.ai/en/latest/getting-started.html>`_ for your system for how to install the Poplar SDK.).  PopTorch is packaged as a Python wheel
file that can be installed using ``pip``.

.. important:: pip >= 18.1 is required for PopTorch dependencies to be installed properly.

To update ``pip``:

.. code-block:: bash

    $ pip install -U pip


Version compatibility
=====================

The following are the corresponding ``torch``, ``torchvision``, ``torchaudio`` and
``torch_scatter`` versions and supported Python versions.

+--------------+-----------+-----------------+----------------+------------------------------+------------+
| ``poptorch`` | ``torch`` | ``torchvision`` | ``torchaudio`` |       ``torch_scatter``      | ``python`` |
+==============+===========+=================+================+==============================+============+
|     3.3      |   2.0.1   |      0.15.2     |      2.0.1     |   >=2.0.9 and <=2.1.1        |    >=3.8   |
+--------------+-----------+-----------------+----------------+------------------------------+------------+
|     3.2      |   1.13.1  |      0.14.1     |      0.13.1    |   >=2.0.9 and <=2.1.0        |    >=3.7   |
+--------------+-----------+-----------------+----------------+------------------------------+------------+
|     3.1      |   1.13.0  |      0.14.0     |      0.13.0    |   >=2.0.9 and <=2.1.0        |    >=3.7   |
+--------------+-----------+-----------------+----------------+------------------------------+------------+
|     3.0      |   1.10.0  |      0.11.1     |      0.10.0    |             N/A              |    >=3.6   |
+--------------+-----------+-----------------+----------------+------------------------------+------------+
|     2.6      |   1.10.0  |      0.11.1     |      0.10.0    |             N/A              |    >=3.6   |
+--------------+-----------+-----------------+----------------+------------------------------+------------+
|     2.5      |   1.10.0  |      0.11.1     |      0.10.0    |             N/A              |    >=3.6   |
+--------------+-----------+-----------------+----------------+------------------------------+------------+
|     2.4      |   1.10.0  |      0.11.1     |      0.10.0    |             N/A              |    >=3.6   |
+--------------+-----------+-----------------+----------------+------------------------------+------------+
|     2.3      |   1.9.0   |      0.10.0     |      0.9.0     |             N/A              |    >=3.6   |
+--------------+-----------+-----------------+----------------+------------------------------+------------+
|     2.2      |   1.9.0   |      0.10.0     |      0.9.0     |             N/A              |    >=3.6   |
+--------------+-----------+-----------------+----------------+------------------------------+------------+
|     2.1      |   1.7.1   |      0.8.2      |      0.7.1     |             N/A              |    >=3.6   |
+--------------+-----------+-----------------+----------------+------------------------------+------------+
|     2.0      |   1.7.1   |      0.8.2      |      0.7.1     |             N/A              |    >=3.6   |
+--------------+-----------+-----------------+----------------+------------------------------+------------+
|     1.4      |   1.6.0   |      0.7.0      |      0.6.0     |             N/A              |    >=3.6   |
+--------------+-----------+-----------------+----------------+------------------------------+------------+

Based on https://github.com/pytorch/vision/blob/master/README.md

.. note:: To ensure version compatibility, ``torchvision`` and ``torchaudio`` are automatically installed with PopTorch in Poplar SDK 3.3 and later.


Using a Python virtual environment
==================================

We recommend creating and activating a virtual environment to isolate your PopTorch environment
from the system Python environment. You can use the Python tool ``virtualenv``
for this. You can create a virtual environment and install PopTorch as shown below:

.. code-block:: bash

    $ virtualenv -p python3 poptorch_test
    $ source poptorch_test/bin/activate
    $ pip install -U pip
    $ pip install <sdk_path>/poptorch_x.x.x.whl


.. _setting_env:

Setting the environment variables
=================================

The PopART and Poplar runtime libraries are required to use PopTorch, so you
will need to set the library search paths, using the scripts provided in the SDK:

.. code-block:: bash

    # Enable the Python environment containing PopTorch (if not already enabled)
    $ source poptorch_test/bin/activate

    # Add the Poplar and PopART runtime libraries to the search path
    $ source <sdk_path>/poplar-ubuntu_<os_ver>-<poplar_ver>+<build>/enable.sh
    $ source <sdk_path>/popart-ubuntu_<os_ver>-<poplar_ver>+<build>/enable.sh

where ``<sdk_path>`` is the location of the Poplar SDK on your system. ``<os_ver>`` is the version of Ubuntu on your system, ``<poplar_ver>`` is the software version number of the Poplar SDK and ``<build>`` is the build information.


Validating the setup
====================

You can run this simple example to verify that the system is working as
expected. This example can be found in the Poplar SDK ``examples`` directory.

.. literalinclude:: ../../examples/simple_adder.py
  :caption: Simple adder example
  :language: python
  :linenos:


================================================
FILE: docs/user_guide/intro.rst
================================================
============
Introduction
============

PopTorch is a set of extensions for PyTorch to enable PyTorch models to run directly
on the Graphcore IPU. PopTorch has been designed to require as few changes as
possible to your models in order to run on the IPU. However, it does have some
differences from native PyTorch execution, to get the most out of IPU hardware.
The `IPU Programmer's Guide <https://docs.graphcore.ai/projects/ipu-programmers-guide/>`__ provides an introduction to the IPU architecture, programming model and tools available.

PopTorch is included with the `Poplar SDK <https://docs.graphcore.ai/projects/sdk-overview/>`__.
See the `Getting Started guide <https://docs.graphcore.ai/en/latest/getting-started.html>`_ for your system for how to
install the Poplar SDK. Refer to :numref:`installation` for how to install the PopTorch wheel.

In the Graphcore software stack, PyTorch sits at the highest level of
abstraction. Poplar and PopLibs provide a software interface to operations
running on the IPU. PopTorch compiles PyTorch models into Poplar executables and
also provides IPU-specific functions.

.. figure:: pytorch-software-stack.png
    :align: center
    :width: 100%

    PyTorch, PopTorch and the Poplar software stack

PopTorch supports executing native PyTorch models for both inference and training.
To run a PyTorch model on the IPU, you must wrap your model with either:

* :py:func:`~poptorch.inferenceModel`
* :py:func:`~poptorch.trainingModel`

Both of these functions accept a PyTorch model (`torch.nn.Module <https://pytorch.org/docs/1.10.0/generated/torch.nn.Module.html#torch.nn.Module>`_) and create a
representation of the model that can be executed on the IPU hardware.

In training mode, PopTorch uses its own automatic differentiation engine
(autograd) that differs from native PyTorch.  The input model (`torch.nn.Module <https://pytorch.org/docs/1.10.0/generated/torch.nn.Module.html#torch.nn.Module>`_)
is required to have at least one loss built into the forward pass.  PopTorch
backpropagates the gradients from the loss value(s) to update the model
parameters. This is all taken care of automatically so your training loop does not
need to call ``.backward()`` on the loss value(s) or ``.step()`` on the optimiser.

The following example shows a typical native PyTorch training loop.  The model
incorporates a loss criterion within the ``.forward()`` method, and returns the loss
value as a second output (along with the prediction).  This native PyTorch training
loop manually invokes the ``.backward()`` method to backpropagate the gradients.
The loop also manually updates the optimiser by calling the ``.step()`` method.

.. literalinclude:: poptorch_training_simple.py
  :caption: A simple example of training using PyTorch on the CPU
  :linenos:
  :start-after: simple_cpu_start
  :end-before: simple_cpu_end


Data batching
=============

An equivalent training loop executing the model on the IPU with PopTorch is shown
below. The :py:class:`~poptorch.DataLoader` class is used to efficiently load data batches
on the IPU.  PopTorch follows the data batching semantics of `PopART <https://docs.graphcore.ai/projects/popart-user-guide/>`__. By default,
this means you will just pass in data of the normal batch size. However, there are a
number of options provided in PopTorch which will enable more efficient data
loading. See :numref:`efficient_data_batching` for more information.

Notice that the `torch.optim.AdamW <https://pytorch.org/docs/1.10.0/optim.html#torch.optim.AdamW>`_ optimiser is passed as an input argument to the
:py:func:`~poptorch.trainingModel` wrapper which applies the optimiser algorithm
during training on the IPU.  The optimiser state is automatically managed by the
PopART framework so there is no need to call the ``.step()`` method.  Another
significant change from the native training loop is there is no ``loss.backward()``.
As mentioned above, PopTorch uses its own automatic differentiation engine and will
detect the loss value to backpropagate the gradients from.

.. literalinclude:: poptorch_training_simple.py
  :caption: Equivalent code using PopTorch to train on the IPU
  :linenos:
  :start-after: simple_ipu_start
  :end-before: simple_ipu_end


Parallel and Distributed execution
==================================

To scale your models, you can enable :ref:`execution_strategies` using the
PopTorch :ref:`annotation_tools` to label or wrap individual parts of your
model and assign parts of the model to an individual IPU or execution phase.
You can also use PopTorch's :ref:`available_execution_strategies` to determine how the
model executes the phases.

Having assigned the model to run on one or more IPUs, you can add additional
parallelism with replication. Each replica represents an additional copy of the
entire model. These copies run in parallel.

PopTorch can also run across multiple hosts. This is necessary for using more
than 64 IPUs across IPU Pod systems and may be beneficial when using a smaller number
of IPUs, for example with models that involve intensive pre-processing on the CPU. We
recommend using the PopRun command-line tool and and PopDist configuration
library, which can automatically set up PopTorch to run across multiple IPU-POD
hosts. Refer to the `PopDist and PopRun User Guide
<https://docs.graphcore.ai/projects/poprun-user-guide/>`__ for more information,
including details about the installation of Horovod if you are using the MPI
communication protocol.

.. _constraints:

Constraints
===========

The following constraints apply when using PopTorch:

* All tensor data types and shapes must be constant for the entire dataset.

* As PopTorch compiles to a static graph, it cannot handle control flow
  variations within the model. This means that the inputs passed at run-time
  cannot vary the control flow of the model or the shapes or sizes of results.
  If this is attempted, the graph will be frozen to whichever control flow path
  was activated as a result of the first inputs given to the wrapped model.

* Not all PyTorch operations are implemented within the PopTorch compiler.  See
  :numref:`supported_ops` for a list of operators that are supported on the IPU.
  Please also report any unsupported operators to support@graphcore.ai so that these
  ops may be incorporated into a future release.

* Whilst any argument type can be used in the forward method, only tensor
  arguments may change between model invocations, as other types will be
  statically compiled inside the executable.


Other resources
===============

`Switching from GPUs to IPUs for Machine Learning Models <https://docs.graphcore.ai/projects/differences-ipu-gpu/>`__ provides a high-level overview of the programming changes required when switching from GPUs to IPUs and `Memory and Performance Optimisation on the IPU <https://docs.graphcore.ai/projects/memory-performance-optimisation/>`__ presents guidelines to help you develop high-performance machine learning models running on the IPU.

The Graphcore `Examples GitHub repository <https://github.com/graphcore/examples>`_ contains PopTorch applications, :tutorials-repo:`feature examples <feature_examples/pytorch>`,
:tutorials-repo:`tutorials <tutorials/pytorch>` and :tutorials-repo:`simple applications <simple_applications/pytorch>`.
Further developer resources can be found on `Graphcore's developer portal <https://www.graphcore.ai/developer>`_.


================================================
FILE: docs/user_guide/legal.rst
================================================
Trademarks & copyright
======================

|LEGAL:TRADEMARKS|

|LEGAL:EULA|

Copyright © 2020-|YEAR| Graphcore Ltd. All rights reserved.


================================================
FILE: docs/user_guide/mnist.py
================================================
#!/usr/bin/env python3
# Copyright (c) 2020 Graphcore Ltd. All rights reserved.
import argparse
import sys
import torch
import torch.nn as nn
import torch.optim as optim
import torchvision
from tqdm import tqdm
import poptorch


def get_mnist_data(opts):
    options = poptorch.Options()
    training_data = poptorch.DataLoader(
        options,
        torchvision.datasets.MNIST('mnist_data/',
                                   train=True,
                                   download=True,
                                   transform=torchvision.transforms.Compose([
                                       torchvision.transforms.ToTensor(),
                                       torchvision.transforms.Normalize(
                                           (0.1307, ), (0.3081, ))
                                   ])),
        batch_size=opts.batch_size * opts.batches_per_step,
        shuffle=True,
        drop_last=True)

    validation_data = poptorch.DataLoader(
        options,
        torchvision.datasets.MNIST('mnist_data/',
                                   train=False,
                                   download=True,
                                   transform=torchvision.transforms.Compose([
                                       torchvision.transforms.ToTensor(),
                                       torchvision.transforms.Normalize(
                                           (0.1307, ), (0.3081, ))
                                   ])),
        batch_size=opts.test_batch_size,
        shuffle=True,
        drop_last=True)
    return training_data, validation_data


#annotations_start
class Network(nn.Module):
    def __init__(self):
        super(Network, self).__init__()
        self.layer1 = nn.Linear(784, 784)
        self.layer2 = nn.Linear(784, 784)
        self.layer3 = nn.Linear(784, 128)
        self.layer4 = nn.Linear(128, 10)
        self.softmax = nn.Softmax(1)

    def forward(self, x):
        x = x.view(-1, 784)
        with poptorch.Block("B1"):
            x = self.layer1(x)
        with poptorch.Block("B2"):
            x = self.layer2(x)
        with poptorch.Block("B3"):
            x = self.layer3(x)
        with poptorch.Block("B4"):
            x = self.layer4(x)
            x = self.softmax(x)
        return x


class TrainingModelWithLoss(torch.nn.Module):
    def __init__(self, model):
        super().__init__()
        self.model = model
        self.loss = torch.nn.CrossEntropyLoss()

    def forward(self, args, loss_inputs=None):
        output = self.model(args)
        if loss_inputs is None:
            return output
        with poptorch.Block("B4"):
            loss = self.loss(output, loss_inputs)
        return output, loss


#annotations_end


def accuracy(predictions, labels):
    _, ind = torch.max(predictions, 1)
    # provide labels only for samples, where prediction is available (during the training, not every samples prediction is returned for efficiency reasons)
    labels = labels[-predictions.size()[0]:]
    accuracy = torch.sum(torch.eq(ind, labels)).item() / \
        labels.size()[0] * 100.0
    return accuracy


def train(training_model, training_data, opts):
    nr_batches = len(training_data)
    for epoch in range(1, opts.epochs + 1):
        print("Epoch {0}/{1}".format(epoch, opts.epochs))
        bar = tqdm(training_data, total=nr_batches)
        for data, labels in bar:
            preds, losses = training_model(data, labels)
            with torch.no_grad():
                mean_loss = torch.mean(losses).item()
                acc = accuracy(preds, labels)
            bar.set_description("Loss:{:0.4f} | Accuracy:{:0.2f}%".format(
                mean_loss, acc))
            if opts.profile:
                return


def test(inference_model, test_data):
    nr_batches = len(test_data)
    sum_acc = 0.0
    with torch.no_grad():
        for data, labels in tqdm(test_data, total=nr_batches):
            output = inference_model(data)
            sum_acc += accuracy(output, labels)
    print("Accuracy on test set: {:0.2f}%".format(sum_acc / len(test_data)))


if __name__ == '__main__':
    parser = argparse.ArgumentParser(description='MNIST training in PopTorch')
    parser.add_argument('--batch-size',
                        type=int,
                        default=4,
                        help='batch size for training (default: 4)')
    parser.add_argument('--batches-per-step',
                        type=int,
                        default=8,
                        help='device iteration (default:8)')
    parser.add_argument('--test-batch-size',
                        type=int,
                        default=2,
                        help='batch size for testing (default: 4)')
    parser.add_argument('--epochs',
                        type=int,
                        default=1,
                        help='number of epochs to train (default: 1)')
    parser.add_argument('--lr',
                        type=float,
                        default=1e-4,
                        help='learning rate (default: 1e-4)')
    parser.add_argument(
        '--profile',
        type=str,
        help=
        "do a single iteration of training for profiling and place in a folder"
    )
    parser.add_argument('--strategy',
                        choices=['plain', 'pipelined', 'phased'],
                        default='plain',
                        help='execution strategy')
    parser.add_argument('--offload-opt',
                        type=bool,
                        help="offload optimizer state")
    opts = parser.parse_args()

    poptorch.setLogLevel("DEBUG")  # Force debug logging

    #annotations_strategy_start
    training_data, test_data = get_mnist_data(opts)
    model = Network()
    model_with_loss = TrainingModelWithLoss(model)
    model_opts = poptorch.Options().deviceIterations(1)
    if opts.strategy == "phased":
        strategy = poptorch.SerialPhasedExecution("B1", "B2", "B3", "B4")
        strategy.stage("B1").ipu(0)
        strategy.stage("B2").ipu(0)
        strategy.stage("B3").ipu(0)
        strategy.stage("B4").ipu(0)
        model_opts.setExecutionStrategy(strategy)
    elif opts.strategy == "pipelined":
        strategy = poptorch.PipelinedExecution("B1", "B2", "B3", "B4")
        strategy.stage("B1").ipu(0)
        strategy.stage("B2").ipu(1)
        strategy.stage("B3").ipu(2)
        strategy.stage("B4").ipu(3)
        model_opts.setExecutionStrategy(strategy)
        model_opts.Training.gradientAccumulation(opts.batches_per_step)
    else:
        strategy = poptorch.ShardedExecution("B1", "B2", "B3", "B4")
        strategy.stage("B1").ipu(0)
        strategy.stage("B2").ipu(0)
        strategy.stage("B3").ipu(0)
        strategy.stage("B4").ipu(0)
        model_opts.setExecutionStrategy(strategy)

    if opts.offload_opt:
        model_opts.TensorLocations.setActivationLocation(
            poptorch.TensorLocationSettings().useOnChipStorage(True))
        model_opts.TensorLocations.setWeightLocation(
            poptorch.TensorLocationSettings().useOnChipStorage(True))
        model_opts.TensorLocations.setAccumulatorLocation(
            poptorch.TensorLocationSettings().useOnChipStorage(True))
        model_opts.TensorLocations.setOptimizerLocation(
            poptorch.TensorLocationSettings().useOnChipStorage(False))

    training_model = poptorch.trainingModel(
        model_with_loss,
        model_opts,
        optimizer=optim.AdamW(model.parameters(), lr=opts.lr))

    # run training, on IPU
    train(training_model, training_data, opts)
    #annotations_strategy_end

    if opts.profile:
        sys.exit(1)

    # Update the weights in model by copying from the training IPU. This updates (model.parameters())
    training_model.copyWeightsToHost()

    # Check validation loss on IPU once trained. Because PopTorch will be compiled on first call the
    # weights in model.parameters() will be copied implicitly. Subsequent calls will need to call
    # inference_model.copyWeightsToDevice()
    inf_opts = poptorch.Options().deviceIterations(opts.test_batch_size)
    strategy = poptorch.ShardedExecution("B1", "B2", "B3", "B4")
    strategy.stage("B1").ipu(0)
    strategy.stage("B2").ipu(0)
    strategy.stage("B3").ipu(0)
    strategy.stage("B4").ipu(0)
    inf_opts.setE
Download .txt
gitextract_ur1femal/

├── .ci/
│   └── view_component_trigger/
│       ├── Jenkinsfile
│       └── jobs.groovy
├── .clang-format
├── .clang-tidy
├── .github/
│   ├── CODEOWNERS
│   └── workflows/
│       └── apply_linters.yml
├── .gitignore
├── .pre-commit-config.yaml
├── .pylintrc
├── .style.yapf
├── CMakeLists.txt
├── License.txt
├── MANIFEST.in
├── README.md
├── config.buildenv.py
├── docs/
│   ├── common/
│   │   ├── _static/
│   │   │   └── css/
│   │   │       └── custom_rtd.css
│   │   ├── conf.py
│   │   └── custom_dic
│   ├── poptorch_geometric/
│   │   ├── common/
│   │   │   └── conf.py
│   │   └── user_guide/
│   │       ├── index.rst
│   │       ├── installation.rst
│   │       ├── intro.rst
│   │       ├── legal.rst
│   │       ├── performance.rst
│   │       ├── reference.rst
│   │       ├── supported_operations.rst
│   │       └── tutorials.rst
│   └── user_guide/
│       ├── CMakeLists.txt
│       ├── api.py
│       ├── batching.rst
│       ├── buffers.py
│       ├── debugging.py
│       ├── debugging.rst
│       ├── device_iterations.py
│       ├── error_handling.py
│       ├── example.rst
│       ├── experimental.rst
│       ├── hostio_optimisation.rst
│       ├── index.rst
│       ├── inferenceModel.py
│       ├── installation.rst
│       ├── intro.rst
│       ├── legal.rst
│       ├── mnist.py
│       ├── overview.rst
│       ├── phased_execution.py
│       ├── pipeline_simple.py
│       ├── poptorch.conf
│       ├── poptorch_training_simple.py
│       ├── precompilation.py
│       ├── pytorch_to_poptorch.rst
│       ├── reference.rst
│       ├── replica_grouped_weights.py
│       ├── sumAnchorReturnType.py
│       ├── supported_ops.rst
│       └── trainingModel.py
├── examples/
│   ├── CMakeLists.txt
│   ├── bert_ipu.py
│   ├── lstm.py
│   ├── mnist.py
│   └── simple_adder.py
├── popart_compiler/
│   ├── CMakeLists.txt
│   ├── include/
│   │   └── popart_compiler/
│   │       ├── CodeletsCompilation.hpp
│   │       ├── Compiler.hpp
│   │       ├── CompilerOperationMacros.inc.hpp
│   │       ├── ManuallyAddedOperations.inc.hpp
│   │       ├── SupportedOperations.inc.hpp
│   │       └── Utils.hpp
│   ├── source/
│   │   ├── CodeletsCompilation.cpp
│   │   ├── Compiler.cpp
│   │   ├── CompilerImpl.cpp
│   │   ├── SessionOptions.cpp
│   │   ├── Utils.cpp
│   │   ├── custom_operations/
│   │   │   ├── Embedding.cpp
│   │   │   ├── FastGatherLastDim.cpp
│   │   │   ├── FastGatherLastDim.hpp
│   │   │   ├── FastGatherLastDimBwdCodelets.inc.cpp
│   │   │   ├── FastGatherLastDimFwdCodelets.inc.cpp
│   │   │   ├── HostOp.cpp
│   │   │   ├── TorchSoftplus.cpp
│   │   │   ├── TorchSoftplus.hpp
│   │   │   ├── UpsampleBilinear2d.cpp
│   │   │   └── UpsampleBilinear2dCodelets.inc.cpp
│   │   └── include/
│   │       └── popart_compiler/
│   │           ├── CompilerImpl.hpp
│   │           ├── CompilerOptions.hpp
│   │           ├── CustomOps.hpp
│   │           ├── MultiConvBuilder.hpp
│   │           └── SessionOptionsImpl.hpp
│   └── types/
│       └── include/
│           └── popart_compiler/
│               ├── CompilerTypes.hpp
│               └── PopartEnums.hpp
├── poptorch/
│   ├── CMakeLists.txt
│   ├── include/
│   │   └── poptorch/
│   │       ├── DispatchTracer.hpp
│   │       ├── InplaceOps.hpp
│   │       ├── LowerToPopart.hpp
│   │       ├── LowerToPopartFactories.hpp
│   │       ├── PoplarExecutable.hpp
│   │       ├── SessionOptionsParser.hpp
│   │       └── Utils.hpp
│   └── source/
│       ├── AddDetachOperations.cpp
│       ├── AddSubgraphConnectionNodes.cpp
│       ├── AliasProcessing.cpp
│       ├── CPUOffloadingCleanUp.cpp
│       ├── CompilerOps.cpp.inc
│       ├── ErrorOnUnsupportedAten.cpp
│       ├── FixupSetAvailableMemory.cpp
│       ├── GNNOptimizations.cpp
│       ├── GatherWithExpandedIndicesOptimization.cpp
│       ├── ImplicitCasting.cpp
│       ├── InplaceOps.cpp
│       ├── LowerToPopart.cpp
│       ├── LowerToPopartFactories.cpp
│       ├── OpBuilder.cpp
│       ├── OverlappedIO.cpp
│       ├── PopartCanonicalization.cpp
│       ├── PopartLateCanonicalization.cpp
│       ├── PoplarExecutable.cpp
│       ├── PoptorchStaticInit.hpp
│       ├── PoptorchSymbols.cpp
│       ├── PoptorchSymbols.hpp
│       ├── RemoveSurplusIdentityLosses.cpp
│       ├── RequiresGrad.cpp
│       ├── SessionOptionsParser.cpp
│       ├── Utils.cpp
│       ├── dispatch_tracer/
│       │   ├── CMakeLists.txt
│       │   ├── CommonHelperFunctions.cpp
│       │   ├── CommonHelperFunctions.hpp
│       │   ├── InplaceAliasMapper.cpp
│       │   ├── InplaceAliasMapper.hpp
│       │   ├── README.md
│       │   ├── RegisterAtenOverloads.cpp
│       │   ├── RegisterMetaOps.cpp.inc
│       │   ├── RegisterOptionalAtenOps.cpp.inc
│       │   ├── Tensor.cpp
│       │   ├── Tensor.hpp
│       │   ├── TypeInferenceHandler.cpp
│       │   ├── TypeInferenceHandler.hpp
│       │   ├── ValueMapper.cpp
│       │   ├── ValueMapper.hpp
│       │   └── dispatchers/
│       │       ├── IDispatch.cpp
│       │       ├── IDispatch.hpp
│       │       ├── JitDispatch.cpp
│       │       └── JitDispatch.hpp
│       ├── include/
│       │   └── poptorch/
│       │       ├── AliasProcessing.hpp
│       │       ├── CompilerOps.inc.hpp
│       │       ├── ImplicitCasting.hpp
│       │       ├── InplaceOpsPyTorch.hpp_nolint
│       │       ├── OpBuilder.hpp
│       │       ├── OverlappedIO.hpp
│       │       ├── PopartCanonicalization.hpp
│       │       ├── RequiresGrad.hpp
│       │       └── TypeAndConstantCanonicalization.hpp
│       ├── popart_canonicalization/
│       │   ├── ActivationOps.cpp
│       │   ├── ArithmeticOps.cpp
│       │   ├── AtenHandlers.gen.cpp
│       │   ├── BilinearOps.cpp
│       │   ├── BitwiseOps.cpp
│       │   ├── BlasOps.cpp
│       │   ├── ConstantOps.cpp
│       │   ├── ConvolutionOps.cpp
│       │   ├── CustomOps.cpp
│       │   ├── DistanceOps.cpp
│       │   ├── DropoutOps.cpp
│       │   ├── EinsumOp.cpp
│       │   ├── EinsumOp.hpp
│       │   ├── EmbeddingOps.cpp
│       │   ├── IndexOps.cpp
│       │   ├── LossOps.cpp
│       │   ├── NormalizationOps.cpp
│       │   ├── OtherOps.cpp
│       │   ├── PoolingOps.cpp
│       │   ├── PopartCanonicalizationUtils.cpp
│       │   ├── PopartCanonicalizationUtils.hpp
│       │   ├── PoptorchHandlers.gen.cpp
│       │   ├── PyGTorchScatterOps.cpp
│       │   ├── PyGTorchSplineConvOps.cpp
│       │   ├── RNNOps.cpp
│       │   ├── RandomSamplingOps.cpp
│       │   ├── ReduceOps.cpp
│       │   ├── ReshapeOps.cpp
│       │   ├── ScatterReduction.cpp
│       │   ├── ScatterReduction.hpp
│       │   ├── SliceOps.cpp
│       │   ├── SoftmaxOps.cpp
│       │   ├── TensorOps.cpp
│       │   └── pyg_torch_cluster/
│       │       ├── FpsOp.cpp
│       │       ├── GridOp.cpp
│       │       └── NearestOp.cpp
│       └── type_and_constant_canonicalization/
│           ├── AddListNumElements.cpp
│           ├── CanonicaliseConstants.cpp
│           ├── CastUnsupportedInputs.cpp
│           ├── CheckAndChangeOutputTypes.cpp
│           ├── EvaluateConstexprs.cpp
│           └── MakeConstantIntParams.cpp
├── poptorch_compiler/
│   └── pytorch_bridge/
│       ├── CMakeLists.txt
│       ├── IpuSession.cpp
│       └── include/
│           └── pytorch_bridge/
│               ├── CompilerOptions.hpp
│               ├── CompilerTypes.hpp
│               ├── DebugInfo.hpp
│               └── IpuSession.hpp
├── poptorch_err/
│   ├── CMakeLists.txt
│   ├── exception_info/
│   │   └── poptorch_err/
│   │       └── ExceptionInfo.hpp
│   ├── include/
│   │   └── poptorch_err/
│   │       └── ExceptionHandling.hpp
│   └── source/
│       └── ExceptionHandling.cpp
├── poptorch_geometric/
│   ├── CMakeLists.txt
│   ├── License.txt
│   ├── MANIFEST.in
│   ├── README.md
│   ├── config.buildenv.py
│   ├── poptorch_geometric_third_party_licenses.txt
│   ├── pyproject.toml
│   ├── python/
│   │   ├── CMakeLists.txt
│   │   ├── __init__.py
│   │   ├── cluster_loader.py
│   │   ├── collate.py
│   │   ├── common.py
│   │   ├── dataloader.py
│   │   ├── fixed_size_options.py
│   │   ├── masker.py
│   │   ├── neighbor_loader.py
│   │   ├── ops/
│   │   │   ├── __init__.py
│   │   │   ├── aggregation_base.py
│   │   │   ├── cluster_gcn_conv.py
│   │   │   ├── hetero_linear.py
│   │   │   ├── instance_norm.py
│   │   │   ├── knn.py
│   │   │   ├── knn_graph.py
│   │   │   ├── knn_interpolate.py
│   │   │   ├── mf_conv.py
│   │   │   └── radius.py
│   │   ├── override.py
│   │   ├── py.typed
│   │   ├── pyg_cluster_loader.py
│   │   ├── pyg_collate.py
│   │   ├── pyg_dataloader.py
│   │   ├── stream_packing_sampler.py
│   │   ├── types.py
│   │   └── utils.py
│   ├── requirements.txt
│   ├── setup.cfg
│   └── setup.py
├── poptorch_logging/
│   ├── CMakeLists.txt
│   ├── include/
│   │   └── poptorch_logging/
│   │       ├── Error.hpp
│   │       ├── Logging.hpp
│   │       ├── LoggingLight.hpp
│   │       └── Tracepoint.hpp
│   └── source/
│       ├── Error.cpp
│       ├── Logging.cpp
│       └── Tracepoint.cpp
├── poptorch_third_party_licenses.txt
├── pyproject.toml
├── python/
│   ├── CMakeLists.txt
│   ├── __init__.py
│   ├── _args_parser.py
│   ├── _dataloader.py
│   ├── _impl.py
│   ├── _logging.py
│   ├── _optimizer_attributes.py
│   ├── _options_config.py
│   ├── _options_impl.py
│   ├── _poplar_executor.py
│   ├── _poptorch_data.py
│   ├── _printing.py
│   ├── _utils.py
│   ├── enums.py
│   ├── ops.py
│   ├── optim.py
│   ├── options.py
│   ├── poptorch.cpp
│   ├── profiling.py
│   ├── py.typed
│   └── testing.py
├── requirements.txt
├── scripts/
│   ├── PopAtenHandlers.py
│   ├── PopParse.py
│   ├── PopTorchHandlers.py
│   ├── __init__.py
│   ├── apply_linters.py
│   ├── check_spelling.py
│   ├── create_buildenv.py
│   ├── docs_build.py
│   ├── download_external_datasets.py
│   ├── enable.sh.in
│   ├── generate_poppyg_package.py
│   ├── generate_python_package.py
│   ├── popgen/
│   │   ├── __init__.py
│   │   ├── api.py
│   │   ├── generator.py
│   │   ├── helpers.py
│   │   ├── onnx.py
│   │   ├── operatorfactory.py
│   │   ├── poptorch.py
│   │   ├── registry.py
│   │   ├── transform.py
│   │   └── values.py
│   ├── set_version.py
│   └── utils/
│       └── _utils.py
├── setup.cfg
├── setup.py
├── tests/
│   ├── .gitignore
│   ├── CMakeLists.txt
│   ├── activations_test.py
│   ├── attach_detach_test.py
│   ├── attach_detach_wait_for_ipu_test.py
│   ├── batching_test.py
│   ├── bert_small_and_medium_test.py
│   ├── blas_test.py
│   ├── bool_support_test.py
│   ├── buffers_test.py
│   ├── conftest.py
│   ├── convs_test.py
│   ├── cpp/
│   │   ├── CMakeLists.txt
│   │   └── GNNOptimizationsTest.cpp
│   ├── cpu_op_test.py
│   ├── ctc_decoder_test.py
│   ├── custom_loss_test.py
│   ├── custom_ops/
│   │   ├── CMakeLists.txt
│   │   ├── custom_add_scalar_op.cpp
│   │   ├── custom_add_scalar_vec_op.cpp
│   │   ├── custom_add_vec_scalar_mul_op.cpp
│   │   ├── custom_cube_op.cpp
│   │   ├── custom_leaky_relu_op.cpp
│   │   ├── custom_many_attribute_op.cpp
│   │   ├── custom_reduce_op.cpp
│   │   └── custom_three_input_reduce_op.cpp
│   ├── custom_ops_attributes_test.py
│   ├── custom_ops_test.py
│   ├── dataloader_test.py
│   ├── debug_tensors_test.py
│   ├── distance_ops_test.py
│   ├── exception_test.py
│   ├── fine_tuning_test.py
│   ├── functional_test.py
│   ├── generate_test_file.py
│   ├── gnn/
│   │   ├── .gitignore
│   │   ├── benchgnn/
│   │   │   ├── README.md
│   │   │   ├── benchgnn.py
│   │   │   ├── datasets.py
│   │   │   ├── models.py
│   │   │   ├── requirements.txt
│   │   │   └── utils.py
│   │   ├── benchgnn_ops/
│   │   │   ├── README.md
│   │   │   ├── benchgnn_ops.py
│   │   │   ├── builder.py
│   │   │   ├── example_configs/
│   │   │   │   ├── common.yaml
│   │   │   │   ├── scatter_testcase1.yaml
│   │   │   │   └── scatter_testcase2.yaml
│   │   │   ├── metrics.py
│   │   │   ├── ops.py
│   │   │   └── requirements.txt
│   │   ├── conftest.py
│   │   ├── nn/
│   │   │   ├── aggr/
│   │   │   │   ├── aggr_utils.py
│   │   │   │   ├── conftest.py
│   │   │   │   ├── test_attention.py
│   │   │   │   ├── test_basic.py
│   │   │   │   ├── test_deep_sets.py
│   │   │   │   ├── test_equilibrium.py
│   │   │   │   ├── test_fused.py
│   │   │   │   ├── test_gmt.py
│   │   │   │   ├── test_gru.py
│   │   │   │   ├── test_lstm.py
│   │   │   │   ├── test_mlp_aggr.py
│   │   │   │   ├── test_multi.py
│   │   │   │   ├── test_quantile.py
│   │   │   │   ├── test_scaler.py
│   │   │   │   ├── test_set2set.py
│   │   │   │   ├── test_set_transformer.py
│   │   │   │   └── test_sort.py
│   │   │   ├── conftest.py
│   │   │   ├── conv/
│   │   │   │   ├── conv_utils.py
│   │   │   │   ├── test_agnn_conv.py
│   │   │   │   ├── test_antisymmetric_conv.py
│   │   │   │   ├── test_appnp.py
│   │   │   │   ├── test_arma_conv.py
│   │   │   │   ├── test_cg_conv.py
│   │   │   │   ├── test_cheb_conv.py
│   │   │   │   ├── test_cluster_gcn_conv.py
│   │   │   │   ├── test_dna_conv.py
│   │   │   │   ├── test_edge_conv.py
│   │   │   │   ├── test_eg_conv.py
│   │   │   │   ├── test_fa_conv.py
│   │   │   │   ├── test_feast_conv.py
│   │   │   │   ├── test_film_conv.py
│   │   │   │   ├── test_gat_conv.py
│   │   │   │   ├── test_gated_graph_conv.py
│   │   │   │   ├── test_gatv2_conv.py
│   │   │   │   ├── test_gcn2_conv.py
│   │   │   │   ├── test_gcn_conv.py
│   │   │   │   ├── test_gen_conv.py
│   │   │   │   ├── test_general_conv.py
│   │   │   │   ├── test_gin_conv.py
│   │   │   │   ├── test_gmm_conv.py
│   │   │   │   ├── test_gps_conv.py
│   │   │   │   ├── test_graph_conv.py
│   │   │   │   ├── test_gravnet_conv.py
│   │   │   │   ├── test_han_conv.py
│   │   │   │   ├── test_heat_conv.py
│   │   │   │   ├── test_hetero_conv.py
│   │   │   │   ├── test_hgt_conv.py
│   │   │   │   ├── test_hypergraph_conv.py
│   │   │   │   ├── test_le_conv.py
│   │   │   │   ├── test_lg_conv.py
│   │   │   │   ├── test_mf_conv.py
│   │   │   │   ├── test_nn_conv.py
│   │   │   │   ├── test_pan_conv.py
│   │   │   │   ├── test_pdn_conv.py
│   │   │   │   ├── test_pna_conv.py
│   │   │   │   ├── test_point_conv.py
│   │   │   │   ├── test_point_gnn_conv.py
│   │   │   │   ├── test_point_transformer_conv.py
│   │   │   │   ├── test_ppf_conv.py
│   │   │   │   ├── test_res_gated_graph_conv.py
│   │   │   │   ├── test_rgat_conv.py
│   │   │   │   ├── test_rgcn_conv.py
│   │   │   │   ├── test_sage_conv.py
│   │   │   │   ├── test_sg_conv.py
│   │   │   │   ├── test_signed_conv.py
│   │   │   │   ├── test_simple_conv.py
│   │   │   │   ├── test_spline_conv.py
│   │   │   │   ├── test_ssg_conv.py
│   │   │   │   ├── test_supergat_conv.py
│   │   │   │   ├── test_tag_conv.py
│   │   │   │   ├── test_transformer_conv.py
│   │   │   │   ├── test_wl_conv.py
│   │   │   │   ├── test_wl_conv_continuous.py
│   │   │   │   └── test_x_conv.py
│   │   │   ├── dense/
│   │   │   │   ├── dense_utils.py
│   │   │   │   └── test_convs.py
│   │   │   ├── functional/
│   │   │   │   ├── test_bro.py
│   │   │   │   └── test_gini.py
│   │   │   ├── kge/
│   │   │   │   ├── kge_utils.py
│   │   │   │   ├── test_complex.py
│   │   │   │   ├── test_distmult.py
│   │   │   │   ├── test_rotate.py
│   │   │   │   └── test_transe.py
│   │   │   ├── nn_utils.py
│   │   │   ├── norm/
│   │   │   │   ├── norm_utils.py
│   │   │   │   ├── test_batch_norm.py
│   │   │   │   ├── test_diff_group_norm.py
│   │   │   │   ├── test_graph_norm.py
│   │   │   │   ├── test_graph_size_norm.py
│   │   │   │   ├── test_instance_norm.py
│   │   │   │   ├── test_layer_norm.py
│   │   │   │   ├── test_mean_subtraction_norm.py
│   │   │   │   ├── test_msg_norm.py
│   │   │   │   └── test_pair_norm.py
│   │   │   ├── pool/
│   │   │   │   ├── pool_utils.py
│   │   │   │   ├── test_asap.py
│   │   │   │   ├── test_avg_pool.py
│   │   │   │   ├── test_consecutive.py
│   │   │   │   ├── test_decimation.py
│   │   │   │   ├── test_edge_pool.py
│   │   │   │   ├── test_fps.py
│   │   │   │   ├── test_glob.py
│   │   │   │   ├── test_graclus.py
│   │   │   │   ├── test_max_pool.py
│   │   │   │   ├── test_mem_pool.py
│   │   │   │   ├── test_pan_pool.py
│   │   │   │   ├── test_pool_knn.py
│   │   │   │   ├── test_radius.py
│   │   │   │   ├── test_sag_pool.py
│   │   │   │   ├── test_select_topk.py
│   │   │   │   ├── test_topk_pool.py
│   │   │   │   └── test_voxel_grid.py
│   │   │   ├── test_linear.py
│   │   │   ├── test_loss.py
│   │   │   ├── test_mish.py
│   │   │   ├── test_sequential.py
│   │   │   └── unpool/
│   │   │       └── test_interpolate.py
│   │   ├── ops/
│   │   │   ├── test_knn.py
│   │   │   ├── test_knn_graph.py
│   │   │   ├── test_knn_interpolate.py
│   │   │   ├── test_nearest.py
│   │   │   ├── test_radius_op.py
│   │   │   ├── test_spline_conv_ops.py
│   │   │   └── test_to_dense_batch.py
│   │   ├── test_basic_gnn.py
│   │   ├── test_cluster_loader.py
│   │   ├── test_collate.py
│   │   ├── test_dataloader.py
│   │   ├── test_encoding.py
│   │   ├── test_fixed_size_options.py
│   │   ├── test_masker.py
│   │   ├── test_model_args.py
│   │   ├── test_neighbor_loader.py
│   │   ├── test_register_custom_args.py
│   │   ├── test_stream_packing_sampler.py
│   │   └── utils.py
│   ├── grouping_scatters_gathers_test.py
│   ├── gru_test.py
│   ├── half_float_test.py
│   ├── half_test.py
│   ├── helpers.py
│   ├── hooks_test.py
│   ├── if_test.py
│   ├── index_ops_test.py
│   ├── inplace_test.py
│   ├── inputs_test.py
│   ├── io_performance_test.py
│   ├── ipu_print_tensor_test.py
│   ├── loop_test.py
│   ├── losses_test.py
│   ├── lstm_test.py
│   ├── math_ops_test.py
│   ├── misc_nn_layers_test.py
│   ├── misc_test.py
│   ├── multiconv_test.py
│   ├── non_contiguous_tensors_test.py
│   ├── norms_test.py
│   ├── ops_test.py
│   ├── optimizers_test.py
│   ├── options_test.py
│   ├── other_ops_test.py
│   ├── outputs_test.py
│   ├── overlapped_io_test.py
│   ├── phased_execution_test.py
│   ├── pipelining_test.py
│   ├── pooling_and_padding_test.py
│   ├── popdist_test.py
│   ├── poplar_executor_test.py
│   ├── precompilation_test.py
│   ├── pyg_torch_scatter_test.py
│   ├── random_sampling_test.py
│   ├── reduce_ops_test.py
│   ├── replicated_graph_test.py
│   ├── requires_grad_test.py
│   ├── rnn_test.py
│   ├── sharding_test.py
│   ├── slice_test.py
│   ├── tensor_ops_test.py
│   ├── test_doc_urls.py
│   ├── test_perf_counters.py
│   ├── timeout_handler.py
│   ├── torch_nn_test.py
│   ├── torchvision_inference_test.py
│   ├── type_support_test.py
│   └── weights_writing_test.py
└── version.json
Download .txt
Showing preview only (348K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (3940 symbols across 441 files)

FILE: config.buildenv.py
  class DownloadExternalDatasets (line 59) | class DownloadExternalDatasets(Installer):
    method __init__ (line 60) | def __init__(self, **kwargs):
    method hashString (line 67) | def hashString(self):
    method install (line 71) | def install(self, env):

FILE: docs/common/conf.py
  function get_current_release (line 38) | def get_current_release() -> str:

FILE: docs/poptorch_geometric/common/conf.py
  function get_current_release (line 39) | def get_current_release() -> str:

FILE: docs/user_guide/api.py
  class Model (line 10) | class Model(torch.nn.Module):
    method forward (line 11) | def forward(self, log_probs, lengths):
  class ExampleModel (line 19) | class ExampleModel(torch.nn.Module):
    method __init__ (line 20) | def __init__(self):
    method forward (line 24) | def forward(self, x):
  function custom_loss (line 40) | def custom_loss(output, target):
  class ExampleModelWithCustomLoss (line 47) | class ExampleModelWithCustomLoss(torch.nn.Module):
    method __init__ (line 48) | def __init__(self):
    method forward (line 52) | def forward(self, input, target):

FILE: docs/user_guide/buffers.py
  class CounterModel (line 7) | class CounterModel(torch.nn.Module):
    method __init__ (line 8) | def __init__(self):
    method forward (line 12) | def forward(self):
    method __init__ (line 29) | def __init__(self):
    method forward (line 33) | def forward(self):
  class CounterModel (line 28) | class CounterModel(torch.nn.Module):
    method __init__ (line 8) | def __init__(self):
    method forward (line 12) | def forward(self):
    method __init__ (line 29) | def __init__(self):
    method forward (line 33) | def forward(self):

FILE: docs/user_guide/debugging.py
  class Model (line 7) | class Model(torch.nn.Module):
    method __init__ (line 8) | def __init__(self):
    method forward (line 15) | def forward(self, x, labels=None):

FILE: docs/user_guide/device_iterations.py
  class ExampleModelWithLoss (line 17) | class ExampleModelWithLoss(torch.nn.Module):
    method __init__ (line 18) | def __init__(self, data_shape, num_classes):
    method forward (line 24) | def forward(self, x, target=None):
  class ExampleDataset (line 33) | class ExampleDataset(torch.utils.data.Dataset):
    method __init__ (line 34) | def __init__(self, shape, length):
    method __len__ (line 50) | def __len__(self):
    method __getitem__ (line 53) | def __getitem__(self, index):
  function device_iterations_example (line 57) | def device_iterations_example():
  function replication_factor_example (line 94) | def replication_factor_example():
  function gradient_accumulation_example (line 133) | def gradient_accumulation_example():
  function data_accessor_example (line 169) | def data_accessor_example():
  function process (line 203) | def process(process_id=0, num_processes=1):

FILE: docs/user_guide/error_handling.py
  class PytorchModel (line 9) | class PytorchModel(torch.nn.Module):
    method __init__ (line 10) | def __init__(self, error):
    method forward (line 15) | def forward(self, x, y):
  function run_example (line 19) | def run_example(model_param=None):

FILE: docs/user_guide/mnist.py
  function get_mnist_data (line 13) | def get_mnist_data(opts):
  class Network (line 46) | class Network(nn.Module):
    method __init__ (line 47) | def __init__(self):
    method forward (line 55) | def forward(self, x):
  class TrainingModelWithLoss (line 69) | class TrainingModelWithLoss(torch.nn.Module):
    method __init__ (line 70) | def __init__(self, model):
    method forward (line 75) | def forward(self, args, loss_inputs=None):
  function accuracy (line 87) | def accuracy(predictions, labels):
  function train (line 96) | def train(training_model, training_data, opts):
  function test (line 112) | def test(inference_model, test_data):

FILE: docs/user_guide/phased_execution.py
  class Model (line 14) | class Model(torch.nn.Module):
    method __init__ (line 15) | def __init__(self):
    method forward (line 22) | def forward(self, in0, target=None):
    method forward (line 69) | def forward(self, x, y):
    method forward (line 96) | def forward(self, x, y):
    method forward (line 134) | def forward(self, x, y):
  class Model (line 68) | class Model(torch.nn.Module):
    method __init__ (line 15) | def __init__(self):
    method forward (line 22) | def forward(self, in0, target=None):
    method forward (line 69) | def forward(self, x, y):
    method forward (line 96) | def forward(self, x, y):
    method forward (line 134) | def forward(self, x, y):
  class Model (line 95) | class Model(torch.nn.Module):
    method __init__ (line 15) | def __init__(self):
    method forward (line 22) | def forward(self, in0, target=None):
    method forward (line 69) | def forward(self, x, y):
    method forward (line 96) | def forward(self, x, y):
    method forward (line 134) | def forward(self, x, y):
  class Model (line 133) | class Model(torch.nn.Module):
    method __init__ (line 15) | def __init__(self):
    method forward (line 22) | def forward(self, in0, target=None):
    method forward (line 69) | def forward(self, x, y):
    method forward (line 96) | def forward(self, x, y):
    method forward (line 134) | def forward(self, x, y):

FILE: docs/user_guide/pipeline_simple.py
  class WrappedModel (line 13) | class WrappedModel(torch.nn.Module):
    method __init__ (line 14) | def __init__(self):
    method forward (line 19) | def forward(self, input_ids, attention_mask, token_type_ids):
    method __getattr__ (line 25) | def __getattr__(self, attr):
  class Network (line 104) | class Network(torch.nn.Module):
    method __init__ (line 105) | def __init__(self):
    method forward (line 115) | def forward(self, x):
    method __init__ (line 146) | def __init__(self):
    method forward (line 156) | def forward(self, x):
    method block_one (line 164) | def block_one(self, x):
    method block_two (line 170) | def block_two(self, x):
    method final_activation (line 176) | def final_activation(self, x):
  class Network (line 145) | class Network(torch.nn.Module):
    method __init__ (line 105) | def __init__(self):
    method forward (line 115) | def forward(self, x):
    method __init__ (line 146) | def __init__(self):
    method forward (line 156) | def forward(self, x):
    method block_one (line 164) | def block_one(self, x):
    method block_two (line 170) | def block_two(self, x):
    method final_activation (line 176) | def final_activation(self, x):

FILE: docs/user_guide/poptorch_training_simple.py
  class ExampleModel (line 6) | class ExampleModel(torch.nn.Module):
    method __init__ (line 7) | def __init__(self):
    method forward (line 11) | def forward(self, x):
  class ExampleModelWithLoss (line 20) | class ExampleModelWithLoss(torch.nn.Module):
    method __init__ (line 21) | def __init__(self):
    method forward (line 25) | def forward(self, input, target):
  class ExampleDataset (line 35) | class ExampleDataset(torch.utils.data.Dataset):
    method __init__ (line 36) | def __init__(self, shape, length):
    method __len__ (line 51) | def __len__(self):
    method __getitem__ (line 54) | def __getitem__(self, index):
  function run_examples (line 58) | def run_examples():

FILE: docs/user_guide/precompilation.py
  class ExampleModelWithLoss (line 17) | class ExampleModelWithLoss(torch.nn.Module):
    method __init__ (line 18) | def __init__(self):
    method forward (line 23) | def forward(self, x, target=None):
  function setIpuDevice (line 58) | def setIpuDevice(opts):
  function run_training (line 109) | def run_training(_):
  function run_validation (line 113) | def run_validation(_):

FILE: docs/user_guide/replica_grouped_weights.py
  class ModelWithLoss (line 9) | class ModelWithLoss(torch.nn.Module):
    method __init__ (line 10) | def __init__(self, W_init):
    method forward (line 14) | def forward(self, X):

FILE: docs/user_guide/sumAnchorReturnType.py
  class ExampleClassDataset (line 10) | class ExampleClassDataset(torch.utils.data.Dataset):
    method __init__ (line 24) | def __init__(self, num_classes, vec_length, num_examples):
    method __getitem__ (line 51) | def __getitem__(self, idx):
    method __len__ (line 61) | def __len__(self):
  class MulticlassPerceptron (line 67) | class MulticlassPerceptron(torch.nn.Module):
    method __init__ (line 68) | def __init__(self, vec_length, num_classes):
    method forward (line 73) | def forward(self, x, target):

FILE: docs/user_guide/trainingModel.py
  class ExampleModelWithLoss (line 7) | class ExampleModelWithLoss(torch.nn.Module):
    method __init__ (line 8) | def __init__(self):
    method forward (line 13) | def forward(self, x, target=None):
  function train (line 53) | def train(model):
  function train_on_cpu (line 58) | def train_on_cpu(model):
  function validate (line 66) | def validate(model):

FILE: examples/bert_ipu.py
  class WrappedModel (line 18) | class WrappedModel(torch.nn.Module):
    method __init__ (line 19) | def __init__(self):
    method forward (line 24) | def forward(self, input_ids, attention_mask):
    method __getattr__ (line 29) | def __getattr__(self, attr):

FILE: examples/lstm.py
  class SimpleLSTM (line 9) | class SimpleLSTM(nn.Module):
    method __init__ (line 10) | def __init__(self):
    method forward (line 14) | def forward(self, input_tensors, hidden):

FILE: examples/mnist.py
  function example (line 6) | def example():

FILE: examples/simple_adder.py
  class SimpleAdder (line 12) | class SimpleAdder(nn.Module):
    method forward (line 13) | def forward(self, x, y):

FILE: popart_compiler/include/popart_compiler/CodeletsCompilation.hpp
  type poptorch (line 7) | namespace poptorch {
    type popart_compiler (line 8) | namespace popart_compiler {

FILE: popart_compiler/include/popart_compiler/Compiler.hpp
  type popart (line 14) | namespace popart {
    class any (line 15) | class any
    type DataType (line 16) | enum class DataType
    class ConstVoidData (line 17) | class ConstVoidData
  type poptorch (line 20) | namespace poptorch {
    type popart_compiler (line 21) | namespace popart_compiler {
      type detail (line 23) | namespace detail {
        type CompilerImpl (line 24) | struct CompilerImpl
        type SessionOptionsImpl (line 25) | struct SessionOptionsImpl
      class Compiler (line 42) | class Compiler
      class SessionOptions (line 43) | class SessionOptions {
        method SessionOptions (line 49) | SessionOptions(const SessionOptions &) = delete;
        method SessionOptions (line 50) | SessionOptions &operator=(const SessionOptions &) = delete;
      class PopartAttribute (line 80) | class PopartAttribute {
      class PopartConstant (line 114) | class PopartConstant {
      class HostSideConstant (line 130) | class HostSideConstant {
        method PopartType (line 135) | PopartType popartType() const { return _popart_type; }
      class Compiler (line 147) | class Compiler {

FILE: popart_compiler/include/popart_compiler/Utils.hpp
  type poptorch (line 8) | namespace poptorch {
    type popart_compiler (line 9) | namespace popart_compiler {

FILE: popart_compiler/source/CodeletsCompilation.cpp
  type poptorch (line 15) | namespace poptorch {
    type popart_compiler (line 16) | namespace popart_compiler {
      class ExclusiveFileLock (line 21) | class ExclusiveFileLock {
        method ExclusiveFileLock (line 23) | explicit ExclusiveFileLock(const std::string &path)
      function poplarVersion (line 43) | std::string poplarVersion() {
      function getFileContentHash (line 74) | std::size_t getFileContentHash(const std::string &path) {
      function compiledCodeletPath (line 93) | std::string compiledCodeletPath(const std::string &src_file_path) {
      function compileCodelet (line 106) | void compileCodelet(const std::string &src_file_path,
      function setCustomCodeletsPath (line 216) | void setCustomCodeletsPath(const char *cache_path) {
      function compileCustomCodeletIfNeeded (line 222) | std::unique_ptr<char[]> compileCustomCodeletIfNeeded(const char *src...

FILE: popart_compiler/source/Compiler.cpp
  type poptorch (line 37) | namespace poptorch {
    type popart_compiler (line 38) | namespace popart_compiler {
      function saveModelProtoIfNeeded (line 41) | void saveModelProtoIfNeeded(popart::Builder *builder,
      function T (line 71) | T convertType(T &&t) { return std::forward<T>(t); }
      function convertType (line 73) | std::vector<std::string> convertType(std::vector<const char *> v) {
      function exchangeStrToPopartEnum (line 78) | std::pair<popart::TileSet, popart::ExchangeStrategy>
      type HandleOutput (line 100) | struct HandleOutput {
        method TensorId (line 101) | TensorId operator()(T &in, bool loss, detail::CompilerImpl *_impl) {
      type HandleOutput<popart::TensorId> (line 120) | struct HandleOutput<popart::TensorId> {
        method TensorId (line 121) | TensorId operator()(const popart::TensorId &in, bool loss,
      type HandleOutput<TensorId> (line 149) | struct HandleOutput<TensorId> {
        method TensorId (line 150) | TensorId operator()(TensorId in, bool loss, detail::CompilerImpl *...
      function IsLoss (line 159) | bool IsLoss(const std::string &operation) {
      function copyParam (line 165) | void copyParam(Optimizer &dest_optim, const Optimizer &source_optim,
      function TensorId (line 257) | TensorId Compiler::addInputTensor(const char *type,
      function TensorId (line 278) | TensorId Compiler::createTensorId(const char *name) {
      function TensorId (line 345) | TensorId
      function TensorId (line 365) | TensorId Compiler::addInitializedInputTensor(
      function setUpInputImpl (line 436) | static void setUpInputImpl(TensorId id, T *ptr,
      function addOutput (line 496) | static void addOutput(TensorId id, T *ptr,
      function PopartType (line 1195) | PopartType Compiler::getPopartType(TensorId id) const {
      function TensorId (line 1485) | TensorId Compiler::endForLoop(std::int32_t trip_count, std::int64_t ...
      function TensorId (line 1535) | TensorId Compiler::endIfBlock(const TensorId &condition,
      function TensorId (line 1567) | TensorId Compiler::addUntypedInputTensor() {
      function TensorId (line 1650) | TensorId
      function Timestamps (line 1727) | Timestamps Compiler::getTimestamps() const {
      function setPopartLogLevel (line 1784) | void setPopartLogLevel(logging::Level level) {
      function throwTestError (line 1793) | void throwTestError(TestErrorType type) {
      class PopExceptionInfo (line 1833) | class PopExceptionInfo : public ExceptionInfo {
      function ErrorCategory (line 1873) | ErrorCategory PopExceptionInfo::category() const { return mcategory; }
      function rethrowPopartOrPoplarException (line 1899) | void rethrowPopartOrPoplarException(const std::exception_ptr &eptr,

FILE: popart_compiler/source/CompilerImpl.cpp
  type poptorch (line 37) | namespace poptorch {
    type popart_compiler (line 38) | namespace popart_compiler {
      function toString (line 41) | std::string toString(const std::vector<std::string> &vec) {
      function toString (line 53) | std::string toString(OptimizerType type) {
      function getAttributeNames (line 83) | std::vector<std::string> getAttributeNames(OptimizerType type,
      function indexOf (line 130) | int indexOf(const std::vector<std::string> &vec, const std::string &...
      function vectorDiff (line 138) | std::vector<std::string> vectorDiff(const std::vector<std::string> &...
      type OptimizerParameters (line 151) | struct OptimizerParameters {
      function assertSingleInstanceMaxNumIPUs (line 234) | void assertSingleInstanceMaxNumIPUs(std::size_t num_ipus) {
      type detail (line 243) | namespace detail {
        function T (line 304) | T StepIO::get(const popart::TensorId &id, TensorArrayInfo *map,
        function TensorId (line 606) | TensorId CompilerImpl::hostSideTensorConstant(
        type Bool (line 991) | struct Bool {
        type PoptorchUnfoldHelper (line 1006) | struct PoptorchUnfoldHelper {
          type InternalState (line 1007) | struct InternalState {
            method scalarConstI64 (line 1012) | popart::TensorId scalarConstI64(int64_t val) const {
            method shapeAsTensor (line 1017) | popart::TensorId shapeAsTensor(const std::vector<uint64_t> &sh...
            method InternalState (line 1025) | InternalState transform(popart::TensorId &&new_id) const {
          method InternalState (line 1033) | static InternalState slice(const InternalState &state, uint64_t ...
            method scalarConstI64 (line 1012) | popart::TensorId scalarConstI64(int64_t val) const {
            method shapeAsTensor (line 1017) | popart::TensorId shapeAsTensor(const std::vector<uint64_t> &sh...
            method InternalState (line 1025) | InternalState transform(popart::TensorId &&new_id) const {
          method InternalState (line 1043) | static InternalState broadcast(const InternalState &state, uint6...
            method scalarConstI64 (line 1012) | popart::TensorId scalarConstI64(int64_t val) const {
            method shapeAsTensor (line 1017) | popart::TensorId shapeAsTensor(const std::vector<uint64_t> &sh...
            method InternalState (line 1025) | InternalState transform(popart::TensorId &&new_id) const {
          method InternalState (line 1054) | static InternalState reshape(const InternalState &state,
            method scalarConstI64 (line 1012) | popart::TensorId scalarConstI64(int64_t val) const {
            method shapeAsTensor (line 1017) | popart::TensorId shapeAsTensor(const std::vector<uint64_t> &sh...
            method InternalState (line 1025) | InternalState transform(popart::TensorId &&new_id) const {
          method InternalState (line 1062) | static InternalState concat(const std::vector<InternalState> &st...
            method scalarConstI64 (line 1012) | popart::TensorId scalarConstI64(int64_t val) const {
            method shapeAsTensor (line 1017) | popart::TensorId shapeAsTensor(const std::vector<uint64_t> &sh...
            method InternalState (line 1025) | InternalState transform(popart::TensorId &&new_id) const {
          method InternalState (line 1077) | static InternalState dimShuffle(const InternalState &state,
            method scalarConstI64 (line 1012) | popart::TensorId scalarConstI64(int64_t val) const {
            method shapeAsTensor (line 1017) | popart::TensorId shapeAsTensor(const std::vector<uint64_t> &sh...
            method InternalState (line 1025) | InternalState transform(popart::TensorId &&new_id) const {
          method dim (line 1088) | static uint64_t dim(const InternalState &state, uint64_t axis) {
          method rank_u64 (line 1092) | static uint64_t rank_u64(const InternalState &state) { // NOLINT
          method shape (line 1097) | static std::vector<uint64_t> shape(const InternalState &state) {
        function HostSideConstant (line 1140) | const HostSideConstant &CompilerImpl::getHostSideConstant(TensorId...
        function PopartType (line 1253) | PopartType CompilerImpl::getPopartType(TensorId id) const {

FILE: popart_compiler/source/SessionOptions.cpp
  class Setter (line 53) | class Setter {
    method Setter (line 55) | Setter(std::function<void(Value)> fn, std::string name)
  function registerSetter (line 83) | void registerSetter(std::map<std::string, std::function<void(Value)>> &o...
  type poptorch (line 91) | namespace poptorch {
    type popart_compiler (line 92) | namespace popart_compiler {
      type detail (line 93) | namespace detail {

FILE: popart_compiler/source/Utils.cpp
  type ONNX_NAMESPACE (line 16) | namespace ONNX_NAMESPACE {
    type TensorProto_DataType (line 17) | enum class TensorProto_DataType
  type popart (line 20) | namespace popart {
    type onnxutil (line 21) | namespace onnxutil {
  type poptorch (line 27) | namespace poptorch {
    type popart_compiler (line 28) | namespace popart_compiler {
      function ipuModelEnvironmentVariableIsEnabled (line 30) | bool ipuModelEnvironmentVariableIsEnabled() {
      function ipuSmallModelEnvironmentVariableIsEnabled (line 40) | bool ipuSmallModelEnvironmentVariableIsEnabled() {
      function getIpuModelVersion (line 55) | std::string getIpuModelVersion() {
      function getNumTilesPerIpu (line 64) | int getNumTilesPerIpu(const std::string &ipu_model_version) {
      function roundUpNumIPUs (line 89) | std::uint64_t roundUpNumIPUs(std::uint64_t num_ipus) {
      function waitIfIpuIsUnavailable (line 99) | bool waitIfIpuIsUnavailable() {
      function waitForAWhile (line 110) | bool waitForAWhile() {
      function ipuHardwareVersion (line 117) | std::int64_t ipuHardwareVersion(std::uint64_t num_ipus) {
      function stringToUniquePtr (line 145) | std::unique_ptr<char[]> stringToUniquePtr(const std::string &str) {
      function dtypeIntFromOnnxStr (line 152) | int64_t dtypeIntFromOnnxStr(const char *onnx_type) {
      function poplarTypeFromPoptorch (line 165) | poplar::Type poplarTypeFromPoptorch(PopartType type) {
      function popartTypeFromPoptorch (line 170) | popart::DataType popartTypeFromPoptorch(PopartType type) {

FILE: popart_compiler/source/custom_operations/Embedding.cpp
  type poptorch (line 24) | namespace poptorch {
    type poptorch_custom_ops (line 25) | namespace poptorch_custom_ops {
      class EmbeddingGradOp (line 27) | class EmbeddingGradOp
        method EmbeddingGradOp (line 68) | explicit EmbeddingGradOp(const EmbeddingOp &fwd_op)
        method clone (line 74) | std::unique_ptr<popart::Op> clone() const final {
        method setup (line 94) | void setup() final { outInfo(gradOutIndex()) = _wieght_info; }
        method gradInIndex (line 96) | static popart::InIndex gradInIndex() { return 0; }
        method indicesInIndex (line 97) | static popart::InIndex indicesInIndex() { return 1; }
        method gradOutIndex (line 98) | static popart::OutIndex gradOutIndex() { return 0; }
        method appendOutlineAttributes (line 100) | void appendOutlineAttributes(popart::OpSerialiserBase &os) const f...
        method getSubgraphValue (line 106) | float getSubgraphValue() const final { return getLowSubgraphValue(...
        method paddingIndex (line 108) | nonstd::optional<int64_t> paddingIndex() const { return _padding_i...
        method availableMemoryProportion (line 110) | nonstd::optional<float> availableMemoryProportion() const {
      class EmbeddingOp (line 31) | class EmbeddingOp : public popart::GatherOp {
        method EmbeddingOp (line 33) | EmbeddingOp(const popart::OperatorIdentifier &_opid,
        method clone (line 41) | std::unique_ptr<popart::Op> clone() const final {
        method getGradOps (line 45) | std::vector<std::unique_ptr<popart::Op>> getGradOps() final {
        method weightInIndex (line 51) | static popart::InIndex weightInIndex() { return 0; }
        method indicesInIndex (line 52) | static popart::InIndex indicesInIndex() { return 1; }
        method outIndex (line 53) | static popart::OutIndex outIndex() { return 0; }
        method appendOutlineAttributes (line 55) | void appendOutlineAttributes(popart::OpSerialiserBase &os) const f...
        method paddingIndex (line 60) | nonstd::optional<int64_t> paddingIndex() const { return _padding_i...
      class EmbeddingGradOp (line 66) | class EmbeddingGradOp : public popart::Op {
        method EmbeddingGradOp (line 68) | explicit EmbeddingGradOp(const EmbeddingOp &fwd_op)
        method clone (line 74) | std::unique_ptr<popart::Op> clone() const final {
        method setup (line 94) | void setup() final { outInfo(gradOutIndex()) = _wieght_info; }
        method gradInIndex (line 96) | static popart::InIndex gradInIndex() { return 0; }
        method indicesInIndex (line 97) | static popart::InIndex indicesInIndex() { return 1; }
        method gradOutIndex (line 98) | static popart::OutIndex gradOutIndex() { return 0; }
        method appendOutlineAttributes (line 100) | void appendOutlineAttributes(popart::OpSerialiserBase &os) const f...
        method getSubgraphValue (line 106) | float getSubgraphValue() const final { return getLowSubgraphValue(...
        method paddingIndex (line 108) | nonstd::optional<int64_t> paddingIndex() const { return _padding_i...
        method availableMemoryProportion (line 110) | nonstd::optional<float> availableMemoryProportion() const {
      class EmbeddingOpx (line 167) | class EmbeddingOpx : public popart::popx::Opx {
        method EmbeddingOpx (line 169) | EmbeddingOpx(popart::Op *op, popart::popx::Devicex *devicex)
        method grow (line 185) | void grow(poplar::program::Sequence &prog) const final {
        method createInputTensor (line 201) | poplar::Tensor
        method getInputCreatorType (line 229) | popart::popx::InputCreatorType
        method mustExistBeforeCreate (line 239) | std::set<popart::TensorId>
      class EmbeddingGradOpx (line 249) | class EmbeddingGradOpx : public popart::popx::Opx {
        method EmbeddingGradOpx (line 251) | EmbeddingGradOpx(popart::Op *op, popart::popx::Devicex *devicex)
        method grow (line 270) | void grow(poplar::program::Sequence &prog) const final {
        method createInputTensor (line 304) | poplar::Tensor
        method getInputCreatorType (line 332) | popart::popx::InputCreatorType
        method mustExistBeforeCreate (line 342) | std::set<popart::TensorId>

FILE: popart_compiler/source/custom_operations/FastGatherLastDim.cpp
  type poptorch (line 14) | namespace poptorch {
    type poptorch_custom_ops (line 15) | namespace poptorch_custom_ops {

FILE: popart_compiler/source/custom_operations/FastGatherLastDim.hpp
  type poptorch (line 16) | namespace poptorch {
    type poptorch_custom_ops (line 17) | namespace poptorch_custom_ops {
      class FastGatherLastDimOp (line 19) | class FastGatherLastDimOp : public popart::Op {
        method FastGatherLastDimOp (line 25) | FastGatherLastDimOp(const FastGatherLastDimOp &) = default;
        method FastGatherLastDimOp (line 26) | FastGatherLastDimOp &operator=(const FastGatherLastDimOp &) = delete;
        method getSubgraphValue (line 32) | float getSubgraphValue() const final { return getHighSubgraphValue...
        method getAxis (line 33) | int64_t getAxis() const { return _axis; }
        method getInShape (line 34) | popart::Shape getInShape() const { return _in_shape; }
        method getOutShape (line 35) | popart::Shape getOutShape() const { return _out_shape; }
      class FastGatherLastDimOpx (line 45) | class FastGatherLastDimOpx : public popart::popx::Opx {
      class FastGatherLastDimGradOp (line 60) | class FastGatherLastDimGradOp : public popart::Op {
        method setup (line 65) | virtual void setup() {
        method getSubgraphValue (line 94) | float getSubgraphValue() const final { return getLowSubgraphValue(...
        method getFwdInShape (line 96) | popart::Shape getFwdInShape() const { return _fwd_in_shape; }
      class FastGatherLastDimGradOpx (line 104) | class FastGatherLastDimGradOpx : public popart::popx::Opx {

FILE: popart_compiler/source/custom_operations/FastGatherLastDimBwdCodelets.inc.cpp
  type FloatDef (line 15) | struct FloatDef{
  type FloatDef<float, int> (line 19) | struct FloatDef<float, int>{
  type FloatDef<float, short> (line 27) | struct FloatDef<float, short>{
  type FloatDef<half, int> (line 34) | struct FloatDef<half, int>{
  type FloatDef<half, short> (line 41) | struct FloatDef<half, short>{
  type OutputDef (line 48) | struct OutputDef{
  type OutputDef<float> (line 52) | struct OutputDef<float>{
  type OutputDef<half> (line 57) | struct OutputDef<half>{
  class FastGatherGradVertex (line 62) | class FastGatherGradVertex : public Vertex {
    method run (line 75) | static void run(Vector<Input<Vector<FT, ONE_PTR, 8>>> const&       gra...
    method run (line 115) | static void run(Vector<Input<Vector<FT, ONE_PTR, 8>>> const&  grad_out,
    method compute (line 157) | bool compute() {
  class FastGatherGradVertex<float, int> (line 163) | class FastGatherGradVertex<float, int>
  class FastGatherGradVertex<half, int> (line 164) | class FastGatherGradVertex<half, int>

FILE: popart_compiler/source/custom_operations/FastGatherLastDimFwdCodelets.inc.cpp
  type FloatDef (line 15) | struct FloatDef{
  type FloatDef<float, int> (line 19) | struct FloatDef<float, int>{
  type FloatDef<float, short> (line 27) | struct FloatDef<float, short>{
  type FloatDef<half, int> (line 34) | struct FloatDef<half, int>{
  type FloatDef<half, short> (line 41) | struct FloatDef<half, short>{
  class FastGatherVertex (line 47) | class FastGatherVertex : public Vertex {
    method run (line 58) | static void run(Vector<Input<Vector<FT, ONE_PTR, 8>>> const&   data,
    method run (line 91) | static void run(Vector<Input<Vector<FT, ONE_PTR, 8>>> const&   data,
    method compute (line 127) | bool compute() {
  class FastGatherVertex<float, int> (line 133) | class FastGatherVertex<float, int>
  class FastGatherVertex<half, int> (line 134) | class FastGatherVertex<half, int>

FILE: popart_compiler/source/custom_operations/HostOp.cpp
  type poptorch (line 30) | namespace poptorch {
    type poptorch_custom_ops (line 31) | namespace poptorch_custom_ops {
    type popart_compiler (line 41) | namespace popart_compiler {
      function shapeInferOutput (line 46) | popart::TensorInfo shapeInferOutput(detail::CallbackInternalMetadata...
      class HostOp (line 87) | class HostOp : public popart::Op {
        method HostOp (line 89) | HostOp(const popart::OperatorIdentifier &_opid,
        method setup (line 95) | void setup() override {
        method clone (line 102) | std::unique_ptr<Op> clone() const final {
        method getSubgraphValue (line 106) | float getSubgraphValue() const final { return getLowSubgraphValue(...
      class HostOpx (line 111) | class HostOpx : public popart::popx::Opx {
        method HostOpx (line 113) | HostOpx(popart::Op *op, popart::popx::Devicex *devicex)
        method grow (line 120) | void grow(poplar::program::Sequence &sequence) const override {

FILE: popart_compiler/source/custom_operations/TorchSoftplus.cpp
  type poptorch (line 15) | namespace poptorch {
    type poptorch_custom_ops (line 16) | namespace poptorch_custom_ops {
      function create (line 119) | std::unique_ptr<popart::popx::EwuComputex> create(popart::Op *op) {

FILE: popart_compiler/source/custom_operations/TorchSoftplus.hpp
  type poptorch (line 14) | namespace poptorch {
    type poptorch_custom_ops (line 15) | namespace poptorch_custom_ops {
      class TorchSoftplusOp (line 17) | class TorchSoftplusOp : public popart::ElementWiseUnaryOp {
        method beta (line 33) | float beta() const { return _beta; }
        method threshold (line 34) | float threshold() const { return _threshold; }
      class TorchSoftplusInplaceOp (line 41) | class TorchSoftplusInplaceOp : public popart::ElementWiseInplaceUnar...
        method beta (line 48) | float beta() const { return _beta; }
        method threshold (line 49) | float threshold() const { return _threshold; }
      class TorchSoftplusGradOp (line 56) | class TorchSoftplusGradOp : public popart::ElementWiseNonLinearUnary...
        method beta (line 63) | float beta() const { return _beta; }
        method threshold (line 64) | float threshold() const { return _threshold; }
      class TorchSoftplusComputex (line 71) | class TorchSoftplusComputex : public popart::popx::EwuComputex {
        method TorchSoftplusComputex (line 73) | TorchSoftplusComputex(float beta, float threshold)
      class TorchSoftplusOpx (line 88) | class TorchSoftplusOpx : public popart::popx::ElementWiseUnaryOutpla...
      class TorchSoftplusInplaceOpx (line 93) | class TorchSoftplusInplaceOpx
      class TorchSoftplusGradOpx (line 99) | class TorchSoftplusGradOpx : public popart::popx::Opx {

FILE: popart_compiler/source/custom_operations/UpsampleBilinear2d.cpp
  type BilinearParams (line 23) | struct BilinearParams {
  function areaPixelComputeSourceIndex (line 30) | float areaPixelComputeSourceIndex(float scale, size_t dst_index,
  function BilinearParams (line 51) | BilinearParams computeSourceIndexAndLambda(const float scale,
  function connectVertex (line 73) | poplar::VertexRef connectVertex(
  type TileInputs (line 94) | struct TileInputs {
  function bilinearMap (line 102) | poplar::Tensor bilinearMap(poplar::Graph &graph,            // NOLINT
  type GradMultipleVal (line 191) | struct GradMultipleVal {
  function GradMultipleMap (line 197) | GradMultipleMap computeGradMap(size_t in_height, size_t in_width,
  function computeInputsWeights (line 220) | std::pair<std::vector<poplar::Tensor>, std::vector<float>>
  function splitIntervalMultiple (line 244) | void splitIntervalMultiple(
  function splitInterval (line 289) | void splitInterval(poplar::Graph &graph, poplar::ComputeSet &cs, // NOLINT
  function splitIntervalMultiplePixels (line 335) | void splitIntervalMultiplePixels(poplar::Graph &graph,   // NOLINT
  function processTile (line 398) | void processTile(poplar::Graph &graph, poplar::ComputeSet &cs, // NOLINT
  function splitMapping (line 423) | std::vector<Mapping> splitMapping(const Mapping &m, uint32_t partitions,
  function bilinearMapGrads (line 438) | poplar::Tensor bilinearMapGrads(poplar::Graph &graph,            // NOLINT
  class UpsampleOp (line 520) | class UpsampleOp
    method UpsampleOp (line 621) | UpsampleOp(const popart::OperatorIdentifier &_opid, float scalingFactor,
    method setup (line 628) | void setup() override {
    method clone (line 644) | std::unique_ptr<Op> clone() const final {
    method getGradOps (line 652) | std::vector<std::unique_ptr<popart::Op>> getGradOps() override {
    method appendAttributes (line 657) | void appendAttributes(popart::OpSerialiserBase &os) const override {
    method appendOutlineAttributes (line 663) | void appendOutlineAttributes(popart::OpSerialiserBase &os) const overr...
    method getSubgraphValue (line 670) | float getSubgraphValue() const final { return getLowSubgraphValue(); }
    method getScalingFactor (line 672) | float getScalingFactor() const { return _scalingFactor; }
    method getAlignCorners (line 673) | bool getAlignCorners() const { return _alignCorners; }
  class UpsampleGradOp (line 521) | class UpsampleGradOp
    method clone (line 538) | std::unique_ptr<Op> clone() const final {
    method setup (line 546) | void setup() final {
    method getSubgraphValue (line 603) | float getSubgraphValue() const final { return getLowSubgraphValue(); }
    method getScalingFactor (line 605) | float getScalingFactor() const { return _scalingFactor; }
    method getAlignCorners (line 606) | bool getAlignCorners() const { return _alignCorners; }
  class UpsampleOpx (line 522) | class UpsampleOpx
    method UpsampleOpx (line 709) | UpsampleOpx(popart::Op *op, popart::popx::Devicex *devicex)
    method grow (line 723) | void grow(poplar::program::Sequence &prog) const final {
  class UpsampleGradOpx (line 523) | class UpsampleGradOpx
    method UpsampleGradOpx (line 739) | UpsampleGradOpx(popart::Op *op, popart::popx::Devicex *devicex)
    method grow (line 747) | void grow(poplar::program::Sequence &prog) const final {
  function makeUnique (line 528) | std::unique_ptr<T> makeUnique(Args &&...args) {
  class UpsampleGradOp (line 534) | class UpsampleGradOp : public popart::Op {
    method clone (line 538) | std::unique_ptr<Op> clone() const final {
    method setup (line 546) | void setup() final {
    method getSubgraphValue (line 603) | float getSubgraphValue() const final { return getLowSubgraphValue(); }
    method getScalingFactor (line 605) | float getScalingFactor() const { return _scalingFactor; }
    method getAlignCorners (line 606) | bool getAlignCorners() const { return _alignCorners; }
  class UpsampleOp (line 619) | class UpsampleOp : public popart::Op {
    method UpsampleOp (line 621) | UpsampleOp(const popart::OperatorIdentifier &_opid, float scalingFactor,
    method setup (line 628) | void setup() override {
    method clone (line 644) | std::unique_ptr<Op> clone() const final {
    method getGradOps (line 652) | std::vector<std::unique_ptr<popart::Op>> getGradOps() override {
    method appendAttributes (line 657) | void appendAttributes(popart::OpSerialiserBase &os) const override {
    method appendOutlineAttributes (line 663) | void appendOutlineAttributes(popart::OpSerialiserBase &os) const overr...
    method getSubgraphValue (line 670) | float getSubgraphValue() const final { return getLowSubgraphValue(); }
    method getScalingFactor (line 672) | float getScalingFactor() const { return _scalingFactor; }
    method getAlignCorners (line 673) | bool getAlignCorners() const { return _alignCorners; }
  class UpsampleOpx (line 707) | class UpsampleOpx : public popart::popx::Opx {
    method UpsampleOpx (line 709) | UpsampleOpx(popart::Op *op, popart::popx::Devicex *devicex)
    method grow (line 723) | void grow(poplar::program::Sequence &prog) const final {
  class UpsampleGradOpx (line 737) | class UpsampleGradOpx : public popart::popx::Opx {
    method UpsampleGradOpx (line 739) | UpsampleGradOpx(popart::Op *op, popart::popx::Devicex *devicex)
    method grow (line 747) | void grow(poplar::program::Sequence &prog) const final {

FILE: popart_compiler/source/custom_operations/UpsampleBilinear2dCodelets.inc.cpp
  class BilinearMultipleVertex (line 16) | class BilinearMultipleVertex : public poplar::Vertex {
    method compute (line 22) | bool compute() {
  class BilinearMultipleVertex<float> (line 33) | class BilinearMultipleVertex<float>
  class BilinearMultipleVertex<half> (line 34) | class BilinearMultipleVertex<half>
  class BilinearGradVertex (line 36) | class BilinearGradVertex : public poplar::Vertex {
    method compute (line 42) | bool compute() {
  class BilinearGradVertex<float> (line 56) | class BilinearGradVertex<float>
  class BilinearGradVertex<half> (line 57) | class BilinearGradVertex<half>
  class BilinearGradMultipleVertex (line 59) | class BilinearGradMultipleVertex : public poplar::Vertex {
    method compute (line 66) | bool compute() {
  class BilinearGradMultipleVertex<float> (line 87) | class BilinearGradMultipleVertex<float>
  class BilinearGradMultipleVertex<half> (line 88) | class BilinearGradMultipleVertex<half>

FILE: popart_compiler/source/include/popart_compiler/CompilerImpl.hpp
  type poptorch (line 31) | namespace poptorch {
    type popart_compiler (line 32) | namespace popart_compiler {
      class Compiler (line 34) | class Compiler
      type detail (line 36) | namespace detail {
        type CallbackInternalMetadata (line 43) | struct CallbackInternalMetadata {
        class StepIO (line 71) | class StepIO : public popart::IStepIO {
          type ArrayInfo (line 73) | struct ArrayInfo {
          method StepIO (line 87) | StepIO() = default;
          method assertNumElements (line 105) | void assertNumElements(
        class WeightsIO (line 146) | class WeightsIO : public popart::IWeightsIO {
        type ConstVoidDataLessThan (line 162) | struct ConstVoidDataLessThan {
        type CompilerImpl (line 167) | struct CompilerImpl {
          method CompilerImpl (line 171) | CompilerImpl() : op_builder(popart::Builder::create()) {
          method optimizerGroup (line 341) | void optimizerGroup(const std::vector<TensorId> &tensors, int64_...
          method setOptionIfNotSet (line 355) | void setOptionIfNotSet(T &option, U value, const std::string &name,
          method setOptionIfNotSet (line 368) | void setOptionIfNotSet(T &option, U value, const std::string &na...
          method PopartType (line 402) | PopartType getCachedPopartType(TensorId id) const { return ids_t...

FILE: popart_compiler/source/include/popart_compiler/CompilerOptions.hpp
  type poptorch (line 15) | namespace poptorch {
    type popart_compiler (line 16) | namespace popart_compiler {
      type detail (line 17) | namespace detail {
        type ExecutionMode (line 19) | enum class ExecutionMode { Pipelined, Sharded, Phased, N }
        type Liveness (line 22) | enum class Liveness {
        type CompilerOptions (line 30) | struct CompilerOptions {

FILE: popart_compiler/source/include/popart_compiler/CustomOps.hpp
  type poptorch (line 14) | namespace poptorch {
    type poptorch_custom_ops (line 15) | namespace poptorch_custom_ops {

FILE: popart_compiler/source/include/popart_compiler/MultiConvBuilder.hpp
  type poptorch (line 14) | namespace poptorch {
    type popart_compiler (line 15) | namespace popart_compiler {
      type detail (line 16) | namespace detail {
        class MultiConvBuilder (line 18) | class MultiConvBuilder {
          method addConv (line 20) | void addConv(const std::vector<popart::TensorId> &inputs,
          method setAvailableMemoryProportions (line 33) | void setAvailableMemoryProportions(const std::vector<float> &v) {
          method setPartialsTypes (line 37) | void setPartialsTypes(const std::vector<int64_t> &partials_types) {
          method setEnableConvDithering (line 53) | void setEnableConvDithering(const std::vector<int64_t> &v) {
          method setPlanType (line 57) | void setPlanType(int64_t plan_type) {
          method setPerConvReservedTiles (line 67) | void setPerConvReservedTiles(int n) { _options.perConvReservedTi...
          method setCycleBackOff (line 69) | void setCycleBackOff(float v) { _options.cycleBackOff = v; }
          method build (line 71) | std::vector<popart::TensorId> build(popart::Builder *builder) co...

FILE: popart_compiler/source/include/popart_compiler/SessionOptionsImpl.hpp
  type poptorch (line 13) | namespace poptorch {
    type popart_compiler (line 14) | namespace popart_compiler {
      type detail (line 15) | namespace detail {
        type SessionOptionsImpl (line 17) | struct SessionOptionsImpl {
          method setMemoryProportion (line 33) | void setMemoryProportion(std::uint32_t ipu, float memory) {
          method set (line 38) | void set(const std::string &key, ValueType value,

FILE: popart_compiler/types/include/popart_compiler/CompilerTypes.hpp
  type poptorch (line 13) | namespace poptorch {
    type popart_compiler (line 14) | namespace popart_compiler {
      type TensorMetadata (line 18) | struct TensorMetadata {
      type CallbackMetadata (line 32) | struct CallbackMetadata {
      type OutputElemType (line 49) | enum class OutputElemType { Tensor, Tuple, List }
      type TestErrorType (line 52) | enum class TestErrorType {
      type OutputTypeShape (line 63) | struct OutputTypeShape {
      type Timestamps (line 68) | struct Timestamps {
      type Optimizer (line 75) | struct Optimizer {
        type Parameter (line 76) | struct Parameter {
        method Optimizer (line 83) | explicit Optimizer(OptimizerType t, bool useTfVariant)
        method Optimizer (line 85) | explicit Optimizer(OptimizerType t, bool useTfVariant, float maxGr...
        method Optimizer (line 88) | Optimizer(OptimizerType t, bool accumType, bool firstOrderType,

FILE: popart_compiler/types/include/popart_compiler/PopartEnums.hpp
  type poptorch (line 8) | namespace poptorch {
    type popart_compiler (line 9) | namespace popart_compiler {
      type OptimizerType (line 18) | enum class OptimizerType : std::uint8_t {
      type PopartType (line 60) | enum class PopartType { FOR_ALL_POPART_TYPES
      function toPopartTypeStr (line 68) | inline std::string toPopartTypeStr(const PopartType &type) {
      type PopartOutputMode (line 79) | enum class PopartOutputMode : std::uint8_t { Final = 0, EveryN, All,...
      function PopartOutputMode (line 88) | static PopartOutputMode outputModeFromString(const std::string &str) {

FILE: poptorch/include/poptorch/DispatchTracer.hpp
  type at (line 11) | namespace at {
    class Tensor (line 12) | class Tensor
  type torch (line 15) | namespace torch {
    type jit (line 16) | namespace jit {
      type Graph (line 17) | struct Graph
      type Node (line 18) | struct Node
      type Value (line 19) | struct Value
  type poptorch (line 23) | namespace poptorch {
    type CompilerOptions (line 25) | struct CompilerOptions
    type InplaceGraphInfo (line 26) | struct InplaceGraphInfo
    type PoptorchErrorInfo (line 27) | struct PoptorchErrorInfo
    type TracingMode (line 31) | enum TracingMode {
    type PerReplicaSettings (line 36) | struct PerReplicaSettings {

FILE: poptorch/include/poptorch/InplaceOps.hpp
  type c10 (line 11) | namespace c10 {
    type Symbol (line 12) | struct Symbol
  type torch (line 15) | namespace torch {
    type jit (line 16) | namespace jit {
      type Graph (line 17) | struct Graph
      type Node (line 18) | struct Node
      type Value (line 20) | struct Value
  type poptorch (line 24) | namespace poptorch {
    type InplaceGraphInfo (line 27) | struct InplaceGraphInfo {
    class InplaceInputsTracker (line 58) | class InplaceInputsTracker {

FILE: poptorch/include/poptorch/LowerToPopart.hpp
  type poptorch (line 18) | namespace poptorch {
    type popart_compiler (line 19) | namespace popart_compiler {
      class SessionOptions (line 20) | class SessionOptions
    type detail (line 23) | namespace detail {
      class LowerToPopartImpl (line 24) | class LowerToPopartImpl
    type Anchor (line 32) | struct Anchor {
      method Anchor (line 33) | Anchor(std::string n, std::uint8_t m, size_t p)
    type InplaceGraphInfo (line 47) | struct InplaceGraphInfo
    class LowerToPopart (line 49) | class LowerToPopart {

FILE: poptorch/include/poptorch/LowerToPopartFactories.hpp
  type poptorch (line 14) | namespace poptorch {

FILE: poptorch/include/poptorch/PoplarExecutable.hpp
  type poptorch (line 16) | namespace poptorch {
    class PoplarExecutable (line 18) | class PoplarExecutable {
      method PoplarExecutable (line 20) | PoplarExecutable() = delete;
      method PoplarExecutable (line 21) | PoplarExecutable(popart_compiler::Compiler &&c,

FILE: poptorch/include/poptorch/SessionOptionsParser.hpp
  type poptorch (line 18) | namespace poptorch {
    type popart_compiler (line 19) | namespace popart_compiler {
      class SessionOptions (line 20) | class SessionOptions
    class IPyValue (line 24) | class IPyValue {
    class SessionOptionsParser (line 54) | class SessionOptionsParser {

FILE: poptorch/include/poptorch/Utils.hpp
  type poptorch (line 13) | namespace poptorch {
    class ListTypeWithNumElements (line 62) | class ListTypeWithNumElements
      method ListTypeWithNumElements (line 66) | ListTypeWithNumElements(c10::TypePtr elem_type, size_t num_elements)
      method equals (line 69) | bool equals(const Type &rhs) const override {
      method numElements (line 76) | size_t numElements() const { return _num_elements; }
      method getOriginalListType (line 80) | c10::ListTypePtr getOriginalListType() const {
      method annotation_str_impl (line 87) | std::string annotation_str_impl(c10::TypePrinter printer) const over...
    type JitTensorInfo (line 94) | struct JitTensorInfo {

FILE: poptorch/source/AddDetachOperations.cpp
  type poptorch (line 12) | namespace poptorch {
    function maybeInsertDetachOp (line 45) | void maybeInsertDetachOp(torch::jit::Graph *graph, torch::jit::Node *n...
    function replaceDetachedValues (line 63) | void replaceDetachedValues(torch::jit::Node *node) {
    function addDetachOperations (line 89) | void addDetachOperations(torch::jit::Graph *graph) {

FILE: poptorch/source/AddSubgraphConnectionNodes.cpp
  type poptorch (line 16) | namespace poptorch {
    type Subgraph (line 21) | struct Subgraph {
    function isTerminator (line 36) | bool isTerminator(const torch::jit::Node *node) {
    function isUsedInTerminator (line 40) | bool isUsedInTerminator(const torch::jit::Node *node) {
    function markInputsAsComingFromParent (line 54) | bool markInputsAsComingFromParent(torch::jit::Graph *graph,
    function markOutputs (line 83) | void markOutputs(torch::jit::Graph *graph, torch::jit::Node *outputs,
    type InsertionPointAndShape (line 111) | struct InsertionPointAndShape {
    function markCondOutputs (line 117) | void markCondOutputs(torch::jit::Graph *graph, torch::jit::Node *outputs,
    function insertSetAttribute (line 204) | void insertSetAttribute(torch::jit::Graph *graph, size_t cond_nest_lvl,
    function insertClearAttribute (line 217) | void insertClearAttribute(torch::jit::Graph *graph, size_t cond_nest_lvl,
    function annotateSubgraphs (line 237) | void annotateSubgraphs(torch::jit::Graph *graph, torch::jit::Node *sta...

FILE: poptorch/source/AliasProcessing.cpp
  type poptorch (line 8) | namespace poptorch {
    function resolveAliases (line 10) | void resolveAliases(torch::jit::Graph *graph) {

FILE: poptorch/source/CPUOffloadingCleanUp.cpp
  type poptorch (line 30) | namespace poptorch {
    function cpuOffloadingCleanup (line 32) | void cpuOffloadingCleanup(torch::jit::Graph *graph) {

FILE: poptorch/source/ErrorOnUnsupportedAten.cpp
  type poptorch (line 9) | namespace poptorch {
    function errorOnUnsupportedAten (line 11) | void errorOnUnsupportedAten(torch::jit::Graph *graph) {

FILE: poptorch/source/FixupSetAvailableMemory.cpp
  type poptorch (line 18) | namespace poptorch {
    function isValidInputOpForAMP (line 23) | bool isValidInputOpForAMP(const Node *node) {
    function tryRemovePossibleInput (line 33) | bool tryRemovePossibleInput(const Node *input) {
    function setAvailableMemoryAddPossibleInputOp (line 60) | void setAvailableMemoryAddPossibleInputOp(torch::jit::Node *node) {
    function moveSetAvailableMemoryIfRequired (line 69) | void moveSetAvailableMemoryIfRequired(

FILE: poptorch/source/GNNOptimizations.cpp
  type poptorch (line 21) | namespace poptorch {
    function groupScatterReduceAndGatherNodes (line 79) | void groupScatterReduceAndGatherNodes(torch::jit::Graph *graph) {
    function removeScatterAddIndexExpansion (line 84) | void removeScatterAddIndexExpansion(torch::jit::Graph *graph) {
    function groupScatterReduceNodes (line 130) | void groupScatterReduceNodes(torch::jit::Graph *graph) {
    function groupGatherNodes (line 232) | void groupGatherNodes(torch::jit::Graph *graph) {
    function initQueue (line 319) | void initQueue(torch::jit::Graph *graph, std::queue<torch::jit::Node *...
    function deduceOpStage (line 344) | std::size_t deduceOpStage(const torch::jit::Node *node,
    function dispatch (line 353) | torch::jit::node_list dispatch(torch::jit::Graph *graph,
    function removeDuplicates (line 416) | torch::jit::node_list removeDuplicates(const torch::jit::node_list &no...
    function sortInTopologicalOrder (line 445) | void sortInTopologicalOrder(torch::jit::node_list &nodes) {
    function moveOutputNodesAfterInsertionPoint (line 452) | void moveOutputNodesAfterInsertionPoint(
    function GroupedInputArgs (line 498) | GroupedInputArgs groupInputs(const torch::jit::node_list &nodes,
    function InputArgs (line 517) | InputArgs getInputArgs(const torch::jit::Node *node, bool with_update) {
    function concatGroupedInputs (line 522) | std::vector<torch::jit::Value *>
    function unpackGroupedOutputs (line 583) | void unpackGroupedOutputs(torch::jit::Graph *graph,

FILE: poptorch/source/GatherWithExpandedIndicesOptimization.cpp
  type poptorch (line 12) | namespace poptorch {
    function simplifyGatherWithExpandedIndices (line 14) | void simplifyGatherWithExpandedIndices(torch::jit::Graph *graph) {

FILE: poptorch/source/ImplicitCasting.cpp
  type poptorch (line 19) | namespace poptorch {
    function skipInput (line 22) | bool skipInput(const ImplicitCast implicit_cast, const unsigned int in...
    function inferExpectedTypeDispatch (line 42) | c10::ScalarType inferExpectedTypeDispatch(
    function needToRetype (line 74) | bool needToRetype(const torch::jit::Value *input,
    function implicitCastInputs (line 100) | std::vector<torch::jit::Value *>
    function removeDeadImplicitCasts (line 123) | void removeDeadImplicitCasts(torch::jit::Graph *graph) {

FILE: poptorch/source/InplaceOps.cpp
  type poptorch (line 22) | namespace poptorch {
    function countNumTensorOutputs (line 47) | size_t countNumTensorOutputs(torch::jit::Graph &graph) {
    function addAdditionalInputsIfRequired (line 66) | void addAdditionalInputsIfRequired(torch::jit::Graph *graph,
    function removeRemainingInplaceOps (line 100) | void removeRemainingInplaceOps(torch::jit::Graph &graph) {
    function outplaceKind (line 124) | torch::jit::NodeKind outplaceKind(torch::jit::NodeKind kind) {
    function InplaceGraphInfo (line 177) | InplaceGraphInfo
    function fixForLoopInputs (line 278) | void fixForLoopInputs(torch::jit::Graph &graph) {
    function verifyIfElseBlocksOrder (line 296) | void verifyIfElseBlocksOrder(const torch::jit::Graph &graph) {

FILE: poptorch/source/LowerToPopart.cpp
  type poptorch (line 29) | namespace poptorch {
    function getModelProtoFilename (line 33) | std::string getModelProtoFilename() {
    class ValueMap (line 53) | class ValueMap {
      method hasTensor (line 64) | bool hasTensor(torch::jit::Value *value) const {
      type Data (line 73) | struct Data {
        method Data (line 74) | explicit Data(popart_compiler::TensorId id)
        method Data (line 79) | Data(TensorList tuple, popart_compiler::OutputElemType type_)
    function getTensorDimensions (line 168) | std::vector<int64_t> getTensorDimensions(const at::Tensor &tensor) {
    function fromPopartType (line 173) | at::ScalarType fromPopartType(const popart_compiler::PopartType type) {
    function toPopartType (line 221) | popart_compiler::PopartType toPopartType(const at::ScalarType type) {
    function platformAgnosticTypeInfoFromIRType (line 264) | void platformAgnosticTypeInfoFromIRType(
    type detail (line 284) | namespace detail {
      class LowerToPopartImpl (line 288) | class LowerToPopartImpl {
      function maskVector (line 355) | void maskVector(std::vector<T> *vec, const std::vector<bool> &mask,
      function T (line 1135) | T convertType(T &&t) { return t; }
      function convertType (line 1143) | std::vector<const char *> convertType(const std::vector<std::string>...
      function convertType (line 1153) | std::vector<float> convertType(const std::vector<double> &v) {
      function convertTensorConstantNode (line 1160) | popart_compiler::PopartConstant
      function convertHostSideTensorConstantNode (line 1185) | popart_compiler::HostSideConstant
      function processListAttribute (line 1200) | void processListAttribute(
      function convertCustomOpAttributes (line 1240) | std::shared_ptr<std::vector<popart_compiler::PopartAttribute>>

FILE: poptorch/source/LowerToPopartFactories.cpp
  type poptorch (line 25) | namespace poptorch {
    function lowerToPopartFromDispatch (line 27) | poptorch::LowerToPopart lowerToPopartFromDispatch(

FILE: poptorch/source/OpBuilder.cpp
  type poptorch (line 18) | namespace poptorch {
    function scalarTypeFromInput (line 21) | at::ScalarType scalarTypeFromInput(const torch::jit::Node *node, size_...
    class SourceLocation (line 28) | class SourceLocation {
      method isEnabled (line 32) | bool isEnabled() const { return _enabled; }
      method setLocation (line 34) | void setLocation(const std::string &filename, std::uint64_t line) {
      method setMetadata (line 41) | void setMetadata(const std::string &metadata) {
    function resetCurrentSourceLocation (line 75) | void resetCurrentSourceLocation() {
    function setCurrentPythonCodeLocation (line 79) | void setCurrentPythonCodeLocation(
    function setCurrentMetadata (line 91) | void setCurrentMetadata(const std::string &metadata) {
    function setSourceRangeToCurrentLocation (line 166) | void setSourceRangeToCurrentLocation(torch::jit::Node *node) {
    function insertNodeInGraph (line 170) | void insertNodeInGraph(torch::jit::Graph *graph, torch::jit::Node *new...
    function insertNodeBeforeNode (line 176) | void insertNodeBeforeNode(torch::jit::Node *new_node,
    function insertNodeAfterNode (line 183) | void insertNodeAfterNode(torch::jit::Node *new_node,
    function setNodeOutputsTypes (line 191) | void setNodeOutputsTypes(torch::jit::Node *node,
    function convertPytorchPads (line 394) | static std::vector<std::int64_t>

FILE: poptorch/source/OverlappedIO.cpp
  type poptorch (line 15) | namespace poptorch {
    function attributiseOverlappedInputs (line 18) | void attributiseOverlappedInputs(
    function errorOnDoubleReturnOfOutput (line 69) | void errorOnDoubleReturnOfOutput(torch::jit::Node *node) {
    function attributiseOverlappedOutputs (line 99) | void attributiseOverlappedOutputs(
    function attributiseOverlappedIO (line 148) | void attributiseOverlappedIO(torch::jit::Graph *graph) {

FILE: poptorch/source/PopartCanonicalization.cpp
  type torch (line 19) | namespace torch {
    type jit (line 20) | namespace jit {
  type poptorch (line 25) | namespace poptorch {
    type ReplaceInfo (line 28) | struct ReplaceInfo {
    function propagateHalfOnListOrTupleConstruct (line 139) | void propagateHalfOnListOrTupleConstruct(torch::jit::Node *n, bool tup...
    class CanonicalizeImpl (line 183) | class CanonicalizeImpl {
    function canonicalize (line 295) | void canonicalize(torch::jit::Graph *graph) {

FILE: poptorch/source/PopartLateCanonicalization.cpp
  type poptorch (line 16) | namespace poptorch {
    function broadcast (line 21) | void broadcast(std::vector<T> &option, size_t num_convs) {
    class MultiConvHandler (line 29) | class MultiConvHandler {
      method MultiConvHandler (line 31) | explicit MultiConvHandler(torch::jit::Graph *g) : _graph(g) {}
      method inMultiConv (line 33) | bool inMultiConv() const { return _in_multi_conv; }
      method begin (line 35) | void begin(torch::jit::Node *node) {
      method part (line 41) | void part(torch::jit::Node *node) { _parts.push_back(node); }
      method FunctionTy (line 43) | FunctionTy end(torch::jit::Node *node) {
      method cleanup (line 53) | void cleanup() { searchAndPossiblyDestroy(_to_delete); }
      method applyOptions (line 56) | void applyOptions(torch::jit::Node *end_node) {
      method applyPartLinks (line 115) | void applyPartLinks(torch::jit::Node *end_node) {
    function FunctionTy (line 182) | FunctionTy reorderMatmulSeralisationIfRequired(torch::jit::Node *node) {
    function canonicalizeLate (line 213) | void canonicalizeLate(torch::jit::Graph *graph) {

FILE: poptorch/source/PoplarExecutable.cpp
  type poptorch (line 16) | namespace poptorch {

FILE: poptorch/source/PoptorchSymbols.cpp
  type c10::aten (line 12) | namespace c10::aten {
    function initializeAtenSymbols (line 17) | __attribute__((constructor(SYMBOL_INIT_PRIORITY)))
  type torch_scatter (line 26) | namespace torch_scatter {
    function initializeTorchScatterSymbols (line 33) | __attribute__((constructor(SYMBOL_INIT_PRIORITY)))
  type torch_cluster (line 44) | namespace torch_cluster {
    function initializeTorchScatterSymbols (line 49) | __attribute__((constructor(SYMBOL_INIT_PRIORITY)))
  type torch_spline_conv (line 58) | namespace torch_spline_conv {
    function initializeTorchSplineConvSymbols (line 64) | __attribute__((constructor(SYMBOL_INIT_PRIORITY)))
  type poptorch (line 74) | namespace poptorch {
    type symbols (line 75) | namespace symbols {
      function initializeSupportedOperations (line 89) | __attribute__((constructor(SYMBOL_INIT_PRIORITY)))
      type poptorch (line 109) | namespace poptorch {
        function initializePoptorchSymbols (line 158) | __attribute__((constructor(SYMBOL_INIT_PRIORITY)))
    function getOverlapSymbol (line 211) | c10::Symbol getOverlapSymbol(const char *suffix, unsigned int num) {

FILE: poptorch/source/PoptorchSymbols.hpp
  type c10::aten (line 11) | namespace c10::aten {
  type poptorch (line 16) | namespace poptorch {
    type symbols (line 18) | namespace symbols {
    type symbols::poptorch (line 37) | namespace symbols::poptorch {
  type torch_scatter (line 92) | namespace torch_scatter {
  type torch_cluster (line 98) | namespace torch_cluster {
  type torch_spline_conv (line 102) | namespace torch_spline_conv {

FILE: poptorch/source/RemoveSurplusIdentityLosses.cpp
  type poptorch (line 18) | namespace poptorch {
    function traverseUseDef (line 20) | bool traverseUseDef(torch::jit::Node *node) {
    function removeSurplusIdentityLosses (line 47) | void removeSurplusIdentityLosses(torch::jit::Graph *graph) {

FILE: poptorch/source/RequiresGrad.cpp
  type poptorch (line 11) | namespace poptorch {
    function fixRequiresGradFromDispatch (line 13) | void fixRequiresGradFromDispatch(torch::jit::Graph *graph) {

FILE: poptorch/source/SessionOptionsParser.cpp
  type poptorch (line 9) | namespace poptorch {

FILE: poptorch/source/Utils.cpp
  type poptorch (line 19) | namespace poptorch {
    function isNondeterministic (line 37) | bool isNondeterministic(const torch::jit::Node &node) {
    function nodeToString (line 56) | std::string nodeToString(const torch::jit::Node *node) {
    function scalarTypeToOnnxString (line 63) | std::string scalarTypeToOnnxString(const at::ScalarType type) {
    function onnxStrToScalarType (line 100) | at::ScalarType onnxStrToScalarType(const char *type_str) {
    function coerceToSupportedType (line 141) | at::ScalarType coerceToSupportedType(at::ScalarType type) {
    function addNullPtrsForUnusedTuple (line 175) | void addNullPtrsForUnusedTuple(const c10::TupleType *tuple_type,
    function processInput (line 196) | void processInput(torch::jit::Graph *graph, torch::jit::Value *input,
    function collapsedGraphInputHierachy (line 231) | std::vector<torch::jit::Value *>
    function numTensorsForType (line 242) | size_t numTensorsForType(const c10::TypePtr &type) {
    function shouldDestroy (line 267) | bool shouldDestroy(torch::jit::Node *node) {
    function copyInputs (line 274) | std::unordered_set<torch::jit::Node *> copyInputs(torch::jit::Node *no...
    function searchAndPossiblyDestroyInternal (line 282) | void searchAndPossiblyDestroyInternal(
    function searchAndPossiblyDestroy (line 303) | void searchAndPossiblyDestroy(
    function removeAndPossiblyDestroyAllInputs (line 311) | void removeAndPossiblyDestroyAllInputs(torch::jit::Node *node) {
    function stringToUniquePtr (line 320) | std::unique_ptr<char[]> stringToUniquePtr(const std::string &str) {
    function shapeFromTensor (line 328) | std::vector<std::int64_t> shapeFromTensor(const torch::jit::Value *val...
    function castWeightAndBias (line 354) | void castWeightAndBias(torch::jit::Graph *graph, torch::jit::Value *in...
    function validateTensorShapeAndType (line 402) | void validateTensorShapeAndType(torch::jit::Value *value,
    function setNodeTensorAttrValue (line 413) | void setNodeTensorAttrValue(torch::jit::Node *node,

FILE: poptorch/source/dispatch_tracer/CommonHelperFunctions.cpp
  type poptorch (line 25) | namespace poptorch {
    function isGenericListOfTensors (line 29) | bool isGenericListOfTensors(c10::IValue &value) {
    function isListOfOptionalTensors (line 43) | bool isListOfOptionalTensors(c10::IValue &value) {
    function scalarTypeOrDefault (line 180) | at::ScalarType scalarTypeOrDefault(c10::optional<at::ScalarType> dtype) {
    function copyAndCoerceType (line 184) | at::Tensor copyAndCoerceType(const at::Tensor &tensor) {
    function getInplaceArguments (line 199) | std::vector<at::Tensor> getInplaceArguments(const c10::Stack &stack,
    function toString (line 248) | std::string toString(const at::Tensor &t) {
    function isHalfTensor (line 252) | bool isHalfTensor(const at::Tensor &t) {
    function deviceOrDefaultIpu (line 256) | c10::Device deviceOrDefaultIpu(c10::optional<c10::Device> device) {
    function getSchemaKey (line 260) | std::string getSchemaKey(const c10::FunctionSchema &schema) {

FILE: poptorch/source/dispatch_tracer/CommonHelperFunctions.hpp
  type torch (line 13) | namespace torch {
    type jit (line 14) | namespace jit {
      type Graph (line 15) | struct Graph
      type Node (line 16) | struct Node
      type Value (line 17) | struct Value
  type poptorch (line 21) | namespace poptorch {
    class ValueMapper (line 23) | class ValueMapper

FILE: poptorch/source/dispatch_tracer/InplaceAliasMapper.cpp
  type poptorch (line 6) | namespace poptorch {
    function InplaceArgAliasMapper (line 8) | InplaceArgAliasMapper &InplaceArgAliasMapper::getInstance() {
    function INPLACE_ARG_MAPPER_IMPL (line 47) | INPLACE_ARG_MAPPER_IMPL(torch_scatter, mapper) {

FILE: poptorch/source/dispatch_tracer/InplaceAliasMapper.hpp
  type poptorch (line 10) | namespace poptorch {
    class InplaceArgAliasMapper (line 12) | class InplaceArgAliasMapper {
      method InplaceArgAliasMapper (line 24) | InplaceArgAliasMapper() = default;
      method InplaceArgAliasMapper (line 26) | InplaceArgAliasMapper(const InplaceArgAliasMapper &) = delete;
      method InplaceArgAliasMapper (line 27) | InplaceArgAliasMapper(InplaceArgAliasMapper &&) = delete;
      method InplaceArgAliasMapper (line 28) | InplaceArgAliasMapper &operator=(const InplaceArgAliasMapper &) = de...
      method InplaceArgAliasMapper (line 29) | InplaceArgAliasMapper &operator=(InplaceArgAliasMapper &&) = delete;
    type InplaceArgAliasMapperInit (line 35) | struct InplaceArgAliasMapperInit {

FILE: poptorch/source/dispatch_tracer/RegisterAtenOverloads.cpp
  type poptorch (line 49) | namespace poptorch {
    function valueToString (line 53) | std::string valueToString(const c10::IValue &ivalue) {
    function isIpuDevice (line 82) | bool isIpuDevice(const c10::Device &d) {
    type GlobalTracerContext (line 92) | struct GlobalTracerContext {
      method isDispatchOn (line 96) | inline bool isDispatchOn() { return dispatch_on; }
      method hasActiveDispatch (line 98) | bool hasActiveDispatch() { return static_cast<bool>(_active_dispatch...
      method IDispatch (line 100) | IDispatch *activeDispatch() {
      method resetActiveDispatch (line 105) | void resetActiveDispatch(std::unique_ptr<IDispatch> new_dispatch) {
      method updatePythonCallstack (line 109) | void updatePythonCallstack() {
      method throwPoptorchError (line 113) | void throwPoptorchError(const PoptorchErrorInfo &info) {
      method setPoptorchErrorThrower (line 146) | void setPoptorchErrorThrower(PoptorchErrorThrower thrower) {
    function GlobalTracerContext (line 159) | GlobalTracerContext &getContext() { return *context; }
      method isDispatchOn (line 96) | inline bool isDispatchOn() { return dispatch_on; }
      method hasActiveDispatch (line 98) | bool hasActiveDispatch() { return static_cast<bool>(_active_dispatch...
      method IDispatch (line 100) | IDispatch *activeDispatch() {
      method resetActiveDispatch (line 105) | void resetActiveDispatch(std::unique_ptr<IDispatch> new_dispatch) {
      method updatePythonCallstack (line 109) | void updatePythonCallstack() {
      method throwPoptorchError (line 113) | void throwPoptorchError(const PoptorchErrorInfo &info) {
      method setPoptorchErrorThrower (line 146) | void setPoptorchErrorThrower(PoptorchErrorThrower thrower) {
    function downCastIfNeeded (line 162) | at::Tensor downCastIfNeeded(const at::Tensor &t) {
    function hostSideCast (line 173) | void hostSideCast(void *dest, c10::ScalarType dest_scalar_type, void *...
    function isParameter (line 199) | inline bool isParameter(const at::Tensor &tensor) {
    function copyInplace (line 205) | void copyInplace(const c10::OperatorHandle &op, c10::Stack *stack) {
    function startParametersMove (line 328) | void startParametersMove() { getContext().moving_parameters = true; }
    function endParametersMove (line 330) | void endParametersMove() { getContext().moving_parameters = false; }
    function startOutputsMove (line 332) | void startOutputsMove() { getContext().moving_outputs = true; }
    function endOutputsMove (line 334) | void endOutputsMove() { getContext().moving_outputs = false; }
    function startDispatch (line 337) | void startDispatch() { getContext().dispatch_on = true; }
    function setPoptorchErrorThrower (line 339) | void setPoptorchErrorThrower(PoptorchErrorThrower thrower) {
    function throwPoptorchError (line 343) | void throwPoptorchError(const PoptorchErrorInfo &info) {
    function endDispatch (line 348) | void endDispatch(bool error_occurred) {
    function poptorchAtExit (line 358) | void poptorchAtExit() {
    function destroyDispatcher (line 365) | void destroyDispatcher() {
    function setParameterName (line 372) | void setParameterName(const at::Tensor &tensor, const std::string &nam...
    function getParameterName (line 376) | std::string getParameterName(torch::jit::Value *value) {
    function setParameterPerReplica (line 380) | void setParameterPerReplica(const std::string &param_name,
    function getParameterPerReplica (line 387) | bool getParameterPerReplica(torch::jit::Value *value,
    function isCompilingWithDispatcher (line 395) | bool isCompilingWithDispatcher() { return getContext().hasActiveDispat...
    function isDispatcherOn (line 399) | bool isDispatcherOn() { return getContext().isDispatchOn(); }
    function CompilerOptions (line 401) | CompilerOptions
    function createGraph (line 415) | void createGraph(TracingMode mode, const std::vector<at::Tensor> &inputs,
    function cpuFallback (line 432) | void cpuFallback(const c10::OperatorHandle &op, torch::jit::Stack *sta...
    function fallback (line 441) | void fallback(const c10::OperatorHandle &op, c10::Stack *stack) {
    function InplaceGraphInfo (line 455) | InplaceGraphInfo getInplaceGraphInfo(size_t num_anchors,
    function getTracedGraph (line 462) | std::shared_ptr<torch::jit::Graph> getTracedGraph() {
    function finalizeGraph (line 483) | void finalizeGraph() { getContext().activeDispatch()->finalizeGraph(); }
    function isParameter (line 493) | bool isParameter(torch::jit::Value *value) {
    function localScalarDense (line 500) | at::Scalar localScalarDense(const at::Tensor &self) {
    function item (line 507) | at::Scalar item(const at::Tensor &self) {
    function emptyBase (line 517) | at::Tensor
    function emptyMemoryFormat (line 548) | at::Tensor emptyMemoryFormat(
    function emptyStrided (line 565) | at::Tensor emptyStrided(at::IntArrayRef size, at::IntArrayRef stride,
    function linalgMatrixNorm (line 578) | at::Tensor linalgMatrixNorm(const at::Tensor &self, const at::Scalar &...
    function linalgMatrixNormStrOrd (line 593) | at::Tensor linalgMatrixNormStrOrd(const at::Tensor &self, c10::string_...
    function detach (line 606) | void detach(const c10::OperatorHandle &op, c10::Stack *stack) {
    function weightNormInterface (line 635) | void weightNormInterface(const c10::OperatorHandle &op, c10::Stack *st...
    function replaceValueDispatcher (line 654) | void replaceValueDispatcher(torch::jit::Value *v_old,
    function getIpuTensorId (line 662) | std::uint64_t getIpuTensorId(const at::Tensor &tensor) {
  function TORCH_LIBRARY_IMPL (line 675) | TORCH_LIBRARY_IMPL(_, IPU, m) { m.fallback(PTC_BOXED(poptorch::fallback)...
  function TORCH_LIBRARY_IMPL (line 677) | TORCH_LIBRARY_IMPL(_, AutogradIPU, m) {
  function TORCH_LIBRARY_IMPL (line 704) | TORCH_LIBRARY_IMPL(aten, AutogradIPU, m) {
  function popArgumentsFromStack (line 715) | void popArgumentsFromStack(const c10::OperatorHandle &op, c10::Stack *st...
  function pushResultsToStack (line 721) | void pushResultsToStack(c10::Stack *stack,
  function updateStack (line 728) | void updateStack(const c10::OperatorHandle &op, c10::Stack *stack,
  function getNthArgument (line 737) | c10::IValue getNthArgument(const c10::OperatorHandle &op, c10::Stack *st...
  function opReturningFirstArgument (line 743) | void opReturningFirstArgument(const c10::OperatorHandle &op,
  function opWithoutOutputs (line 749) | void opWithoutOutputs(const c10::OperatorHandle &op, c10::Stack *stack) {
  function callCpuOp (line 757) | void callCpuOp(const c10::OperatorHandle &op, c10::Stack *stack) {
  function endCpuOp (line 765) | void endCpuOp(const c10::OperatorHandle &op, c10::Stack *stack) {
  function castOp (line 776) | at::Tensor castOp(const at::Tensor &tensor, const std::string &type) {
  function customOperation (line 802) | void customOperation(const c10::OperatorHandle &op, c10::Stack *stack) {
  function dynamicSlice (line 809) | at::Tensor dynamicSlice(const at::Tensor &self, int64_t dim,
  function dynamicUpdate (line 828) | at::Tensor dynamicUpdate(const at::Tensor &self, const at::Tensor &src,
  function ctcBeamSearchDecoder (line 845) | std::tuple<at::Tensor, at::Tensor, at::Tensor>
  function identityLoss (line 863) | at::Tensor identityLoss(const at::Tensor &t, int64_t reduction) {
  function TORCH_LIBRARY (line 884) | TORCH_LIBRARY(poptorch, m) {
  function TORCH_LIBRARY_IMPL (line 958) | TORCH_LIBRARY_IMPL(poptorch, CPU, m) {
  function TORCH_LIBRARY_IMPL (line 991) | TORCH_LIBRARY_IMPL(poptorch, AutogradIPU, m) {

FILE: poptorch/source/dispatch_tracer/Tensor.cpp
  type poptorch (line 28) | namespace poptorch {
    type Overloaded (line 35) | struct Overloaded : Ts... { using Ts::operator()...; }
    function toCompilerType (line 47) | poptorch_ir::Type toCompilerType(const at::ScalarType &elem_type) {
    function toCompilerElementType (line 70) | poptorch_ir::Type toCompilerElementType(const at::Tensor &tensor) {
    function tensorImplDataSize (line 76) | uint64_t tensorImplDataSize(const at::TensorImpl &impl) {
    type IpuTensorImpl (line 88) | struct IpuTensorImpl : public at::TensorImpl {
      method IpuTensorImpl (line 92) | IpuTensorImpl(const IpuTensorImpl &src)
      method release_resources (line 97) | void release_resources() override { details.reset(); }
      method IpuTensorImpl (line 99) | IpuTensorImpl(const caffe2::TypeMeta data_type, c10::Device device,
      method shallow_copy_and_detach (line 116) | c10::intrusive_ptr<TensorImpl>
      method shallow_copy_and_detach (line 130) | c10::intrusive_ptr<TensorImpl>
      method set_size (line 144) | void set_size(int64_t dim, int64_t new_size) override {
      method set_stride (line 150) | void set_stride(int64_t dim, int64_t new_stride) override {
      method set_storage_offset (line 156) | void set_storage_offset(int64_t storage_offset) override {
    function IpuTensorImpl (line 169) | IpuTensorImpl *tryIpuTensorImpl(const at::Tensor &tensor) {
      method IpuTensorImpl (line 92) | IpuTensorImpl(const IpuTensorImpl &src)
      method release_resources (line 97) | void release_resources() override { details.reset(); }
      method IpuTensorImpl (line 99) | IpuTensorImpl(const caffe2::TypeMeta data_type, c10::Device device,
      method shallow_copy_and_detach (line 116) | c10::intrusive_ptr<TensorImpl>
      method shallow_copy_and_detach (line 130) | c10::intrusive_ptr<TensorImpl>
      method set_size (line 144) | void set_size(int64_t dim, int64_t new_size) override {
      method set_stride (line 150) | void set_stride(int64_t dim, int64_t new_stride) override {
      method set_storage_offset (line 156) | void set_storage_offset(int64_t storage_offset) override {
    function IpuTensorImpl (line 173) | IpuTensorImpl *toIpuTensorImpl(const at::Tensor &tensor) {
      method IpuTensorImpl (line 92) | IpuTensorImpl(const IpuTensorImpl &src)
      method release_resources (line 97) | void release_resources() override { details.reset(); }
      method IpuTensorImpl (line 99) | IpuTensorImpl(const caffe2::TypeMeta data_type, c10::Device device,
      method shallow_copy_and_detach (line 116) | c10::intrusive_ptr<TensorImpl>
      method shallow_copy_and_detach (line 130) | c10::intrusive_ptr<TensorImpl>
      method set_size (line 144) | void set_size(int64_t dim, int64_t new_size) override {
      method set_stride (line 150) | void set_stride(int64_t dim, int64_t new_stride) override {
      method set_storage_offset (line 156) | void set_storage_offset(int64_t storage_offset) override {
    function IpuTensorImpl (line 182) | const IpuTensorImpl *toIpuTensorImpl(const at::TensorImpl &tensor) {
      method IpuTensorImpl (line 92) | IpuTensorImpl(const IpuTensorImpl &src)
      method release_resources (line 97) | void release_resources() override { details.reset(); }
      method IpuTensorImpl (line 99) | IpuTensorImpl(const caffe2::TypeMeta data_type, c10::Device device,
      method shallow_copy_and_detach (line 116) | c10::intrusive_ptr<TensorImpl>
      method shallow_copy_and_detach (line 130) | c10::intrusive_ptr<TensorImpl>
      method set_size (line 144) | void set_size(int64_t dim, int64_t new_size) override {
      method set_stride (line 150) | void set_stride(int64_t dim, int64_t new_stride) override {
      method set_storage_offset (line 156) | void set_storage_offset(int64_t storage_offset) override {
    function getTensorDetails (line 190) | std::shared_ptr<IpuTensorDetails>
    type GuardImpl (line 196) | struct GuardImpl : public c10::impl::DeviceGuardImplInterface {
      method type (line 197) | at::DeviceType type() const override { return at::DeviceType::IPU; }
      method exchangeDevice (line 199) | c10::Device exchangeDevice(c10::Device device) const override {
      method getDevice (line 209) | c10::Device getDevice() const override { return _current_device; }
      method setDevice (line 211) | void setDevice(c10::Device device) const override {
      method uncheckedSetDevice (line 216) | void uncheckedSetDevice(c10::Device device) const noexcept override {
      method getStream (line 227) | c10::Stream getStream(c10::Device device) const noexcept override {
      method exchangeStream (line 231) | c10::Stream exchangeStream(c10::Stream s) const noexcept override {
      method deviceCount (line 237) | c10::DeviceIndex deviceCount() const noexcept override { return 1; }
    function getTensorType (line 245) | poptorch_ir::TensorType getTensorType(const at::ScalarType &scalar_type,
    function getTensorType (line 251) | poptorch_ir::TensorType getTensorType(const at::Tensor &tensor) {
    function ipuTensorId (line 255) | uint64_t ipuTensorId(const at::Tensor &tensor) {
    function ipuTensorId (line 259) | uint64_t ipuTensorId(const at::TensorImpl &tensor) {
    function isIpuTensor (line 263) | bool isIpuTensor(const at::Tensor &tensor) {
    function str (line 267) | std::string str(const at::Tensor &tensor) {
    function tensorDataSize (line 285) | uint64_t tensorDataSize(const at::Tensor &tensor) {
    function Buffer (line 289) | Buffer &getHostBuffer(const at::Tensor &ipu_tensor) {
    function Buffer (line 293) | Buffer &getHostBuffer(const at::TensorImpl &ipu_tensor) {
    function hasData (line 298) | bool hasData(const at::Tensor &ipu_tensor) {
    function errorOnZeroSizedTensor (line 303) | void errorOnZeroSizedTensor(const at::Tensor &tensor) {
    function Buffer (line 372) | Buffer &TensorStore::allocateBuffer(IpuTensorDetails &details) {
    function getTensorDetails (line 434) | std::shared_ptr<IpuTensorDetails>
    function getTensorDetails (line 439) | std::vector<std::shared_ptr<IpuTensorDetails>>
    function setTensorDetails (line 449) | void setTensorDetails(const at::Tensor &ipu_tensor,
    function getBufferOrView (line 459) | IpuTensorDetails::Data getBufferOrView(std::shared_ptr<ITensorView> vi...
    function Buffer (line 474) | Buffer &IpuTensorDetails::getBuffer() {

FILE: poptorch/source/dispatch_tracer/Tensor.hpp
  type poptorch_ir (line 18) | namespace poptorch_ir {
    class IIpuSession (line 19) | class IIpuSession
  type poptorch (line 22) | namespace poptorch {
    class IDispatch (line 27) | class IDispatch
    type IpuTensorImpl (line 28) | struct IpuTensorImpl
    class ValueMapper (line 29) | class ValueMapper
    class ITensorView (line 31) | class ITensorView {
    type IpuTensorDetails (line 41) | struct IpuTensorDetails {
    class TensorStore (line 119) | class TensorStore {
      method TensorStore (line 122) | TensorStore(const TensorStore &) = delete;
      method TensorStore (line 123) | TensorStore(TensorStore &&) = delete;
      method TensorStore (line 124) | TensorStore &operator=(TensorStore &) = delete;
      method TensorStore (line 125) | TensorStore &operator=(TensorStore &&) = delete;

FILE: poptorch/source/dispatch_tracer/TypeInferenceHandler.cpp
  type poptorch (line 11) | namespace poptorch {
    function copyTensorsFrom (line 18) | c10::Stack copyTensorsFrom(const c10::Stack &meta_stack) {
    function createMetaTensorList (line 87) | c10::List<T> createMetaTensorList(const c10::List<T> &ipu_tensor_list,
    function createMetaDevice (line 111) | c10::Device createMetaDevice(const c10::Device &device) {
    function isUpcastRequired (line 115) | bool isUpcastRequired(const std::string &schema_key,
    function getMetaTensorSize (line 220) | std::vector<int64_t> getMetaTensorSize(const at::Tensor &tensor,
    function getMetaTensorDtype (line 230) | c10::ScalarType getMetaTensorDtype(const at::Tensor &tensor,
    function createEmptyMetaTensor (line 240) | at::Tensor createEmptyMetaTensor(const at::Tensor &tensor,
    function reductionWorkaroundPredicate (line 309) | static bool reductionWorkaroundPredicate(const std::size_t value_index,
    function reductionTransform (line 319) | static c10::IValue reductionTransform(const c10::IValue &transformed_v...
    function makeReductionWorkaround (line 330) | static auto makeReductionWorkaround(const std::size_t dtype_index,

FILE: poptorch/source/dispatch_tracer/TypeInferenceHandler.hpp
  type poptorch (line 14) | namespace poptorch {
    class TypeInferenceHandler (line 16) | class TypeInferenceHandler {
      method TypeInferenceHandler (line 18) | explicit TypeInferenceHandler(TensorStore *tensor_store)
      type Workaround (line 23) | struct Workaround {

FILE: poptorch/source/dispatch_tracer/ValueMapper.cpp
  type poptorch (line 15) | namespace poptorch {
    function Buffer (line 269) | Buffer ValueMapper::getBufferForId(IpuTensorId id) const {

FILE: poptorch/source/dispatch_tracer/ValueMapper.hpp
  type poptorch (line 18) | namespace poptorch {
    class ValueMapper (line 27) | class ValueMapper {
      type TensorListHash (line 37) | struct TensorListHash {
      method ValueMapper (line 50) | ValueMapper() = default;
      method ValueMapper (line 54) | ValueMapper(const ValueMapper &) = delete;
      method ValueMapper (line 55) | ValueMapper &operator=(const ValueMapper &) = delete;
      type TrackedTensor (line 61) | struct TrackedTensor {

FILE: poptorch/source/dispatch_tracer/dispatchers/IDispatch.cpp
  type poptorch (line 14) | namespace poptorch {

FILE: poptorch/source/dispatch_tracer/dispatchers/IDispatch.hpp
  type poptorch (line 16) | namespace poptorch {
    class IDispatch (line 18) | class IDispatch {
      method IDispatch (line 22) | IDispatch(IDispatch &&other) noexcept = default;
      method IDispatch (line 23) | IDispatch &operator=(IDispatch &&other) noexcept = default;
      method IDispatch (line 24) | IDispatch(const IDispatch &other) noexcept = delete;
      method IDispatch (line 25) | IDispatch &operator=(const IDispatch &other) noexcept = delete;

FILE: poptorch/source/dispatch_tracer/dispatchers/JitDispatch.cpp
  type poptorch (line 24) | namespace poptorch {
    class WithMetadata (line 26) | class WithMetadata {
      method WithMetadata (line 28) | explicit WithMetadata(const std::string &metadata) {
    function truncateGraphString (line 34) | std::string truncateGraphString(torch::jit::Graph &graph) {
    function InplaceGraphInfo (line 444) | InplaceGraphInfo

FILE: poptorch/source/dispatch_tracer/dispatchers/JitDispatch.hpp
  type poptorch (line 20) | namespace poptorch {
    type CompilerOptions (line 21) | struct CompilerOptions
    class JITDispatch (line 23) | class JITDispatch final : public IDispatch {

FILE: poptorch/source/include/poptorch/AliasProcessing.hpp
  type torch (line 5) | namespace torch {
    type jit (line 6) | namespace jit {
      type Graph (line 7) | struct Graph
  type poptorch (line 11) | namespace poptorch {

FILE: poptorch/source/include/poptorch/ImplicitCasting.hpp
  type c10 (line 6) | namespace c10 {
    class ArrayRef (line 7) | class ArrayRef
  type torch (line 10) | namespace torch {
    type jit (line 11) | namespace jit {
      type Graph (line 13) | struct Graph
      type Value (line 14) | struct Value
  type poptorch (line 18) | namespace poptorch {
    type ImplicitCast (line 20) | enum class ImplicitCast {
    type ImplicitCastOutput (line 29) | enum class ImplicitCastOutput { None, AsPromoted, AlwaysBool, AlwaysFl...

FILE: poptorch/source/include/poptorch/OpBuilder.hpp
  type OutputType (line 18) | enum class OutputType {
  type c10 (line 32) | namespace c10 {
    class optional (line 33) | class optional
  type poptorch (line 36) | namespace poptorch {
    class WithNodeMetadata (line 43) | class WithNodeMetadata {
    type UseOfNode (line 97) | enum class UseOfNode { HostSideOnly, PopARTOnly, HostSideAndPopART }
    type CreateCast (line 212) | struct CreateCast {}
    type CreateCast<float> (line 214) | struct CreateCast<float> {
    type CreateCast<std::int32_t> (line 221) | struct CreateCast<std::int32_t> {
    type CreateCast<std::int64_t> (line 228) | struct CreateCast<std::int64_t> {

FILE: poptorch/source/include/poptorch/OverlappedIO.hpp
  type torch (line 5) | namespace torch {
    type jit (line 6) | namespace jit {
      type Graph (line 7) | struct Graph
  type poptorch (line 12) | namespace poptorch {

FILE: poptorch/source/include/poptorch/PopartCanonicalization.hpp
  type torch (line 9) | namespace torch {
    type jit (line 10) | namespace jit {
      type Graph (line 11) | struct Graph
      type Node (line 12) | struct Node
  type at (line 16) | namespace at {
    class Tensor (line 17) | class Tensor
  type poptorch (line 20) | namespace poptorch {

FILE: poptorch/source/include/poptorch/RequiresGrad.hpp
  type torch (line 5) | namespace torch {
    type jit (line 6) | namespace jit {
      type Graph (line 7) | struct Graph
  type poptorch (line 11) | namespace poptorch {

FILE: poptorch/source/include/poptorch/TypeAndConstantCanonicalization.hpp
  type at (line 9) | namespace at {
    class Tensor (line 10) | class Tensor
  type c10 (line 13) | namespace c10 {
    type Symbol (line 14) | struct Symbol
  type torch (line 17) | namespace torch {
    type jit (line 18) | namespace jit {
      type Graph (line 19) | struct Graph
      type Node (line 20) | struct Node
  type poptorch (line 24) | namespace poptorch {
    type type_and_constant_canonicalization (line 25) | namespace type_and_constant_canonicalization {

FILE: poptorch/source/popart_canonicalization/ActivationOps.cpp
  type poptorch (line 14) | namespace poptorch {
    function registration (line 184) | __attribute__((constructor(HANDLER_INIT_PRIORITY))) static void regist...

FILE: poptorch/source/popart_canonicalization/ArithmeticOps.cpp
  type poptorch (line 13) | namespace poptorch {
    function calculateVarMean (line 210) | std::pair<torch::jit::Value *, torch::jit::Value *>
    function registration (line 319) | __attribute__((constructor(HANDLER_INIT_PRIORITY))) static void regist...

FILE: poptorch/source/popart_canonicalization/AtenHandlers.gen.cpp
  type poptorch (line 12) | namespace poptorch {
    function registration (line 778) | __attribute__((constructor(HANDLER_INIT_PRIORITY))) static void regist...

FILE: poptorch/source/popart_canonicalization/BilinearOps.cpp
  type poptorch (line 10) | namespace poptorch {
    function registration (line 81) | __attribute__((constructor(HANDLER_INIT_PRIORITY))) static void regist...

FILE: poptorch/source/popart_canonicalization/BitwiseOps.cpp
  type poptorch (line 9) | namespace poptorch {
    function verifyCompatibleIntegralInputs (line 17) | void verifyCompatibleIntegralInputs(torch::jit::Node *node,
    function registration (line 78) | __attribute__((constructor(HANDLER_INIT_PRIORITY))) static void regist...

FILE: poptorch/source/popart_canonicalization/BlasOps.cpp
  type poptorch (line 12) | namespace poptorch {
    function registration (line 150) | __attribute__((constructor(HANDLER_INIT_PRIORITY))) static void regist...

FILE: poptorch/source/popart_canonicalization/ConstantOps.cpp
  type poptorch (line 16) | namespace poptorch {
    function registration (line 133) | __attribute__((constructor(HANDLER_INIT_PRIORITY))) static void regist...

FILE: poptorch/source/popart_canonicalization/ConvolutionOps.cpp
  type poptorch (line 10) | namespace poptorch {
    function registration (line 255) | __attribute__((constructor(HANDLER_INIT_PRIORITY))) static void regist...

FILE: poptorch/source/popart_canonicalization/CustomOps.cpp
  type poptorch (line 11) | namespace poptorch {
    function registration (line 43) | __attribute__((constructor(HANDLER_INIT_PRIORITY))) static void regist...

FILE: poptorch/source/popart_canonicalization/DistanceOps.cpp
  type poptorch (line 11) | namespace poptorch {
    function registration (line 207) | __attribute__((constructor(HANDLER_INIT_PRIORITY))) static void regist...

FILE: poptorch/source/popart_canonicalization/DropoutOps.cpp
  type poptorch (line 9) | namespace poptorch {
    function registration (line 50) | __attribute__((constructor(HANDLER_INIT_PRIORITY))) static void regist...

FILE: poptorch/source/popart_canonicalization/EinsumOp.cpp
  type poptorch (line 9) | namespace poptorch {

FILE: poptorch/source/popart_canonicalization/EinsumOp.hpp
  type poptorch (line 9) | namespace poptorch {
    class EinsumOp (line 10) | class EinsumOp {
      method sortedPermutation (line 28) | std::vector<std::int64_t>

FILE: poptorch/source/popart_canonicalization/EmbeddingOps.cpp
  type poptorch (line 16) | namespace poptorch {
    function registration (line 147) | __attribute__((constructor(HANDLER_INIT_PRIORITY))) static void regist...

FILE: poptorch/source/popart_canonicalization/IndexOps.cpp
  type poptorch (line 18) | namespace poptorch {
    type IndexInfo (line 21) | struct IndexInfo {
    function padShape (line 26) | std::vector<std::int64_t> padShape(const std::vector<std::int64_t> &sh...
    function IndexInfo (line 40) | IndexInfo processIndex(torch::jit::Graph *graph, torch::jit::Value *x,
    function isMaskedAssign (line 141) | bool isMaskedAssign(torch::jit::Graph *graph, torch::jit::Value *x,
    function canVectorizeInDim (line 174) | std::optional<std::int32_t>
    function applyInplaceSlice (line 208) | void applyInplaceSlice(torch::jit::Node *node, torch::jit::Node *out) {
    function registration (line 344) | __attribute__((constructor(HANDLER_INIT_PRIORITY))) static void regist...

FILE: poptorch/source/popart_canonicalization/LossOps.cpp
  type poptorch (line 12) | namespace poptorch {
    function registration (line 635) | __attribute__((constructor(HANDLER_INIT_PRIORITY))) static void regist...

FILE: poptorch/source/popart_canonicalization/NormalizationOps.cpp
  type poptorch (line 11) | namespace poptorch {
    function initializeParamConstant (line 14) | void initializeParamConstant(torch::jit::Graph *graph, torch::jit::Val...
    function maybeInitializeAffineParamConstants (line 46) | bool maybeInitializeAffineParamConstants(torch::jit::Graph *graph,
    function maybeInitializeRunningParamConstants (line 68) | void maybeInitializeRunningParamConstants(
    function registration (line 311) | __attribute__((constructor(HANDLER_INIT_PRIORITY))) static void regist...

FILE: poptorch/source/popart_canonicalization/OtherOps.cpp
  type poptorch (line 19) | namespace poptorch {
    function isIndexBroadcastEnabled (line 245) | bool isIndexBroadcastEnabled(torch::jit::Node *node) {
    function registration (line 476) | __attribute__((constructor(HANDLER_INIT_PRIORITY))) static void regist...

FILE: poptorch/source/popart_canonicalization/PoolingOps.cpp
  type poptorch (line 13) | namespace poptorch {
    function registration (line 154) | __attribute__((constructor(HANDLER_INIT_PRIORITY))) static void regist...

FILE: poptorch/source/popart_canonicalization/PopartCanonicalizationUtils.cpp
  type poptorch (line 18) | namespace poptorch {
    function registerHandler (line 31) | bool registerHandler(c10::Symbol symbol, const SymbolHandler &handler) {
    function SymbolHandler (line 41) | SymbolHandler getHandler(torch::jit::NodeKind kind) {
    function allInputsOfType (line 49) | bool allInputsOfType(torch::jit::Node *node, at::ScalarType type,
    function allInputsBool (line 68) | bool allInputsBool(torch::jit::Node *node, int ignore_input) {
    function allInputsInteger (line 72) | bool allInputsInteger(torch::jit::Node *node, int ignore_input) {
    function handleTensorList (line 90) | std::vector<torch::jit::Value *> handleTensorList(torch::jit::Node *no...
    function getNodeScalarType (line 114) | at::ScalarType getNodeScalarType(const torch::jit::Value *tensor) {
    function hasUnityValue (line 123) | bool hasUnityValue(torch::jit::Value *value) {
    function isNone (line 131) | bool isNone(torch::jit::Node *node) {
    function isNone (line 140) | bool isNone(const torch::jit::Value *value) {
    function handleDimensionParam (line 144) | std::int64_t handleDimensionParam(torch::jit::Value *value,
    function isAnyConstant (line 159) | bool isAnyConstant(torch::jit::Node *node) {
    function isFloatingPointConstant (line 163) | bool isFloatingPointConstant(torch::jit::Node *node) {
    function isTensorConstant (line 176) | bool isTensorConstant(torch::jit::Node *node) {
    function isConstantScalar (line 181) | bool isConstantScalar(torch::jit::Value *input) {
    function constantToFloat (line 193) | float constantToFloat(torch::jit::Node *node) {
    function constantToInt (line 218) | std::int32_t constantToInt(torch::jit::Node *node) {
    function constantToLong (line 234) | std::int64_t constantToLong(torch::jit::Node *node) {
    function constantToLongVec (line 251) | std::vector<std::int64_t> constantToLongVec(torch::jit::Node *node) {
    function constantToFloatVec (line 255) | std::vector<float> constantToFloatVec(torch::jit::Node *node) {
    function constantToBool (line 259) | bool constantToBool(torch::jit::Node *node) {
    function constantToString (line 266) | std::string constantToString(torch::jit::Node *node) {
    function constantToScalarType (line 278) | at::ScalarType constantToScalarType(torch::jit::Node *node) {
    function convertReduceToPopart (line 288) | std::int32_t convertReduceToPopart(std::int32_t pytorchReduce) {
    function markNodeForDeletion (line 306) | void markNodeForDeletion(torch::jit::Node *node) {
    function isMarkedForDeletion (line 310) | bool isMarkedForDeletion(torch::jit::Node *node) {
    function replaceOutputUse (line 314) | void replaceOutputUse(torch::jit::Value *old_val, torch::jit::Value *n...
    function replaceOutputUse (line 322) | void replaceOutputUse(torch::jit::Node *oldNode, torch::jit::Node *new...
    function reduceHelperDimensionCreator (line 335) | std::vector<std::int64_t>
    function attributeEqual (line 349) | bool attributeEqual(torch::jit::Node *a, torch::jit::Node *b,

FILE: poptorch/source/popart_canonicalization/PopartCanonicalizationUtils.hpp
  type poptorch (line 12) | namespace poptorch {
    function reduceHelperDimensionCreator (line 22) | inline std::vector<std::int64_t>
    function constantListToVec (line 120) | std::vector<T> constantListToVec(torch::jit::Node *node,
    function promoteTypes (line 149) | c10::ScalarType promoteTypes(const c10::ScalarType &a, const c10::Scal...
    function promoteTypes (line 159) | c10::ScalarType promoteTypes(const torch::jit::Value *a,
    function promoteTensors (line 170) | std::vector<torch::jit::Value *>

FILE: poptorch/source/popart_canonicalization/PoptorchHandlers.gen.cpp
  type poptorch (line 12) | namespace poptorch {
    function registration (line 166) | __attribute__((constructor(HANDLER_INIT_PRIORITY))) static void regist...

FILE: poptorch/source/popart_canonicalization/PyGTorchScatterOps.cpp
  type poptorch (line 13) | namespace poptorch {
    function getReductionMethod (line 15) | std::int32_t getReductionMethod(const torch::jit::Node *node) {
    function registration (line 119) | __attribute__((constructor(HANDLER_INIT_PRIORITY))) static void regist...

FILE: poptorch/source/popart_canonicalization/PyGTorchSplineConvOps.cpp
  type poptorch (line 11) | namespace poptorch {
    function registration (line 43) | __attribute__((constructor(HANDLER_INIT_PRIORITY))) static void regist...

FILE: poptorch/source/popart_canonicalization/RNNOps.cpp
  type poptorch (line 9) | namespace poptorch {
    function registration (line 340) | __attribute__((constructor(HANDLER_INIT_PRIORITY))) static void regist...

FILE: poptorch/source/popart_canonicalization/RandomSamplingOps.cpp
  type poptorch (line 12) | namespace poptorch {
    function registration (line 115) | __attribute__((constructor(HANDLER_INIT_PRIORITY))) static void regist...

FILE: poptorch/source/popart_canonicalization/ReduceOps.cpp
  type poptorch (line 15) | namespace poptorch {
    function registration (line 509) | __attribute__((constructor(HANDLER_INIT_PRIORITY))) static void regist...

FILE: poptorch/source/popart_canonicalization/ReshapeOps.cpp
  type poptorch (line 20) | namespace poptorch {
    function getGatherIndices (line 271) | std::vector<int64_t> getGatherIndices(int64_t orig_rows, int64_t orig_...
    function indicesToSlices (line 360) | std::vector<std::pair<int64_t, int64_t>>
    function getScatterReduceIndices (line 462) | at::Tensor getScatterReduceIndices(int64_t num_cols, int64_t orig_rows,
    function registration (line 989) | __attribute__((constructor(HANDLER_INIT_PRIORITY))) static void regist...

FILE: poptorch/source/popart_canonicalization/ScatterReduction.cpp
  type poptorch (line 6) | namespace poptorch {
    function getReductionMethod (line 8) | std::int32_t getReductionMethod(torch::jit::Node *node) {
    function getReductionInitValue (line 29) | float getReductionInitValue(std::int32_t reduce) {

FILE: poptorch/source/popart_canonicalization/ScatterReduction.hpp
  type torch (line 7) | namespace torch {
    type jit (line 8) | namespace jit {
      class Node (line 9) | class Node
  type poptorch (line 13) | namespace poptorch {
    type ScatterReduction (line 15) | enum class ScatterReduction { Sum = 0, Max, Min, Mul, None, Mean }

FILE: poptorch/source/popart_canonicalization/SliceOps.cpp
  type poptorch (line 18) | namespace poptorch {
    function extractAddSubtractConstant (line 26) | void extractAddSubtractConstant(torch::jit::Node *node, std::int64_t *...
    function nodesAlwaysSameOutput (line 75) | bool nodesAlwaysSameOutput(torch::jit::Node *a, torch::jit::Node *b) {
    function resolveCastConstants (line 116) | void resolveCastConstants(torch::jit::Graph *graph, torch::jit::Node *...
    function populateAncestory (line 152) | void populateAncestory(torch::jit::Graph *graph,
    function removeCommonNodes (line 199) | void removeCommonNodes(std::vector<torch::jit::Node *> *start_ancestory,
    function determineSizeConstant (line 217) | std::int64_t
    function inferDynamicSliceSize (line 244) | std::int64_t inferDynamicSliceSize(torch::jit::Graph *graph,
    function registration (line 518) | __attribute__((constructor(HANDLER_INIT_PRIORITY))) static void regist...

FILE: poptorch/source/popart_canonicalization/SoftmaxOps.cpp
  type poptorch (line 10) | namespace poptorch {
    function registration (line 60) | __attribute__((constructor(HANDLER_INIT_PRIORITY))) static void regist...

FILE: poptorch/source/popart_canonicalization/TensorOps.cpp
  type poptorch (line 17) | namespace poptorch {
    function registration (line 517) | __attribute__((constructor(HANDLER_INIT_PRIORITY))) static void regist...

FILE: poptorch/source/popart_canonicalization/pyg_torch_cluster/FpsOp.cpp
  type poptorch (line 15) | namespace poptorch {
    function calcDeg (line 115) | std::vector<std::int64_t> calcDeg(const std::vector<std::int64_t> &ptr,
    function registration (line 190) | __attribute__((constructor(HANDLER_INIT_PRIORITY))) static void regist...

FILE: poptorch/source/popart_canonicalization/pyg_torch_cluster/GridOp.cpp
  type poptorch (line 13) | namespace poptorch {
    function registration (line 87) | __attribute__((constructor(HANDLER_INIT_PRIORITY))) static void regist...

FILE: poptorch/source/popart_canonicalization/pyg_torch_cluster/NearestOp.cpp
  type poptorch (line 15) | namespace poptorch {
    function batchSizes (line 18) | std::tuple<std::int64_t, std::int64_t>
    function batchShapes (line 45) | std::tuple<std::vector<std::int64_t>, std::vector<std::int64_t>>
    function prepareInputTensor (line 66) | std::vector<std::int64_t> prepareInputTensor(torch::jit::Graph *graph,
    function validateInputShapes (line 79) | void validateInputShapes(const std::vector<std::int64_t> &x_shape,
    function uniqueConsecutive (line 94) | std::vector<std::int64_t> uniqueConsecutive(std::vector<std::int64_t> ...
    function validateBatchIndices (line 100) | void validateBatchIndices(const std::vector<std::int64_t> &batch_x,
    function validateSizes (line 111) | void validateSizes(std::int64_t x_size, std::int64_t y_size,
    function validateShapes (line 121) | void validateShapes(const std::vector<std::int64_t> &x_shape,
    function rescaleInputs (line 133) | void rescaleInputs(torch::jit::Graph *graph, torch::jit::Value *&x,
    function concatFeatures (line 162) | void concatFeatures(torch::jit::Graph *graph, torch::jit::Value *&input,
    function concatFeatures (line 178) | void concatFeatures(torch::jit::Graph *graph, torch::jit::Value *&input,
    function registration (line 263) | __attribute__((constructor(HANDLER_INIT_PRIORITY))) static void regist...

FILE: poptorch/source/type_and_constant_canonicalization/AddListNumElements.cpp
  type poptorch (line 11) | namespace poptorch {
    type type_and_constant_canonicalization (line 12) | namespace type_and_constant_canonicalization {
      function recursivelySwitchType (line 15) | void recursivelySwitchType(torch::jit::Node *node,
      function addListNumElements (line 46) | void addListNumElements(torch::jit::Graph *graph, bool revert) {

FILE: poptorch/source/type_and_constant_canonicalization/CanonicaliseConstants.cpp
  type poptorch (line 24) | namespace poptorch {
    type type_and_constant_canonicalization (line 25) | namespace type_and_constant_canonicalization {
      function compilerStateChangingKind (line 31) | bool compilerStateChangingKind(const torch::jit::NodeKind &kind) {
      function popartOnlyNode (line 39) | bool popartOnlyNode(const torch::jit::NodeKind &kind) {
      function UseOfNode (line 47) | UseOfNode getUseOfNode(torch::jit::Node *n,
      function replaceWithConstantTensor (line 102) | void replaceWithConstantTensor(torch::jit::Graph *graph, torch::jit:...
      function warnDoubleOutOfRange (line 118) | void warnDoubleOutOfRange(double val, torch::jit::Node *n) {
      function warnLongOutOfRange (line 129) | void warnLongOutOfRange(int64_t val, torch::jit::Node *n) {
      function handleNumberConstant (line 140) | void handleNumberConstant(torch::jit::Graph *graph, torch::jit::Node...
      function handleTensorConstant (line 178) | void handleTensorConstant(torch::jit::Graph *graph, torch::jit::Node...
      function handleStringConstant (line 217) | void handleStringConstant(torch::jit::Graph *graph, torch::jit::Node...
      class ListTupleVisitor (line 232) | class ListTupleVisitor {
        type State (line 233) | enum class State { IN_TUPLE, IN_LIST }
        type ListOrTupleInfo (line 236) | struct ListOrTupleInfo {
          method ListOrTupleInfo (line 237) | ListOrTupleInfo(State state_, size_t elements_left_,
        method ListTupleVisitor (line 257) | explicit ListTupleVisitor(torch::jit::Graph *graph)
        method handleListOrTuple (line 311) | void handleListOrTuple(const c10::IValue &i_value) {
        method handleConstant (line 326) | void handleConstant(const c10::IValue &i_value) {
        method handleTupleOrListConstruction (line 361) | void handleTupleOrListConstruction() {
      function handleListOrTuple (line 401) | void handleListOrTuple(torch::jit::Graph *graph, torch::jit::Node *n,
      function recursivelySelectHostAndIPUSideConstants (line 438) | void recursivelySelectHostAndIPUSideConstants(
      function rectifyHostAndIPUSideConstants (line 492) | void rectifyHostAndIPUSideConstants(
      function removeStateChangingNodesFromHostSideBranch (line 525) | void removeStateChangingNodesFromHostSideBranch(
      function canonicaliseIfConstant (line 566) | void canonicaliseIfConstant(torch::jit::Graph *graph, torch::jit::No...
      function canonicaliseConstants (line 625) | void canonicaliseConstants(torch::jit::Graph *graph) {

FILE: poptorch/source/type_and_constant_canonicalization/CastUnsupportedInputs.cpp
  type poptorch (line 14) | namespace poptorch {
    type type_and_constant_canonicalization (line 15) | namespace type_and_constant_canonicalization {
      function processInputTensor (line 17) | void processInputTensor(torch::jit::Graph *graph, torch::jit::Value ...
      function castUnsupportedInputs (line 49) | void castUnsupportedInputs(torch::jit::Graph *graph) {

FILE: poptorch/source/type_and_constant_canonicalization/CheckAndChangeOutputTypes.cpp
  type poptorch (line 16) | namespace poptorch {
    type type_and_constant_canonicalization (line 17) | namespace type_and_constant_canonicalization {
      function supportedType (line 20) | constexpr bool supportedType(const at::ScalarType type) {
      function isBeforeHostSideCast (line 28) | bool isBeforeHostSideCast(const torch::jit::Node *n) {
      function warnNonNativeSupport (line 48) | void warnNonNativeSupport(torch::jit::Node *node,
      function maybeReplaceOutputType (line 86) | void maybeReplaceOutputType(torch::jit::Node *node, torch::jit::Valu...
      function checkAndChangeOutputTypesForOutput (line 146) | void checkAndChangeOutputTypesForOutput(torch::jit::Node *node,
      function checkAndChangeOutputTypes (line 173) | void checkAndChangeOutputTypes(torch::jit::Graph *graph) {

FILE: poptorch/source/type_and_constant_canonicalization/EvaluateConstexprs.cpp
  type poptorch (line 21) | namespace poptorch {
    type type_and_constant_canonicalization (line 22) | namespace type_and_constant_canonicalization {
      function numNodesInGraph (line 25) | size_t numNodesInGraph(const torch::jit::Graph *g) {
      function numValuesInGraph (line 29) | size_t numValuesInGraph(const torch::jit::Graph *g) {
      function markForExclusion (line 39) | void markForExclusion(torch::jit::Node *node) {
      function recursivelyMarkInputsForExclusion (line 43) | void recursivelyMarkInputsForExclusion(torch::jit::Node *node) {
      function isMarkedForExclusion (line 58) | bool isMarkedForExclusion(torch::jit::Node *node) {
      function unmarkForExclusion (line 63) | void unmarkForExclusion(torch::jit::Node *node) {
      class ConstExprEvaluator (line 67) | class ConstExprEvaluator {
        method ConstExprEvaluator (line 69) | explicit ConstExprEvaluator(torch::jit::Graph *g)
      function getUpcastIndexArg (line 212) | std::optional<size_t> getUpcastIndexArg(torch::jit::Node *new_node) {
      function addInputUpcast (line 231) | void addInputUpcast(torch::jit::Graph *graph, torch::jit::Node *new_...
      function evaluateConstexprs (line 396) | void evaluateConstexprs(torch::jit::Graph *graph) {

FILE: poptorch/source/type_and_constant_canonicalization/MakeConstantIntParams.cpp
  type poptorch (line 13) | namespace poptorch {
    type type_and_constant_canonicalization (line 14) | namespace type_and_constant_canonicalization {
      function makeConstantIntParams (line 16) | void makeConstantIntParams(torch::jit::Graph *graph,

FILE: poptorch_compiler/pytorch_bridge/IpuSession.cpp
  type poptorch_ir (line 13) | namespace poptorch_ir {
    function dataSize (line 17) | std::size_t dataSize(Type element_type) {
    class StaticIpuSession (line 39) | class StaticIpuSession : public IIpuSession {
      method Buffer (line 41) | Buffer allocate(const TensorType &type) override {
      method copyDataFromCpuSource (line 45) | void copyDataFromCpuSource(Buffer &ipu_dest, const char *cpu_data) o...
      method copyDataToCpu (line 50) | void copyDataToCpu(char *cpu_dest, Buffer &ipu_src) override {
      method copyDataOnDevice (line 55) | void copyDataOnDevice(Buffer &dest, const Buffer &src) override {
    function Buffer (line 66) | Buffer &Buffer::operator=(CpuBuffer buf) noexcept {
    function CpuBuffer (line 70) | const CpuBuffer &Buffer::getCpuData() {
    function CpuBuffer (line 74) | const CpuBuffer &Buffer::getCpuData() const {
    function createStaticSession (line 82) | std::shared_ptr<IIpuSession> createStaticSession() {

FILE: poptorch_compiler/pytorch_bridge/include/pytorch_bridge/CompilerOptions.hpp
  type poptorch (line 7) | namespace poptorch {
    type CompilerOptions (line 9) | struct CompilerOptions {
      type Dispatcher (line 10) | struct Dispatcher {

FILE: poptorch_compiler/pytorch_bridge/include/pytorch_bridge/CompilerTypes.hpp
  type poptorch_ir (line 12) | namespace poptorch_ir {
    type RequiresGradType (line 34) | enum class RequiresGradType {
    type ODSTensorResult (line 39) | struct ODSTensorResult {
    type Type (line 49) | enum class Type : std::uint8_t {
    type TensorType (line 64) | struct TensorType {
      method getNumElements (line 68) | std::int64_t getNumElements() const {
    type StreamInfo (line 74) | struct StreamInfo {
      method nameStringView (line 80) | std::string_view nameStringView() const {

FILE: poptorch_compiler/pytorch_bridge/include/pytorch_bridge/DebugInfo.hpp
  type poptorch_ir (line 8) | namespace poptorch_ir {
    type GraphDebugInfo (line 10) | struct GraphDebugInfo {
    type TensorDebugInfo (line 16) | struct TensorDebugInfo {

FILE: poptorch_compiler/pytorch_bridge/include/pytorch_bridge/IpuSession.hpp
  type poptorch_ir (line 14) | namespace poptorch_ir {
    type FunctionIO (line 16) | struct FunctionIO {
    class Buffer (line 21) | class Buffer {
      method Buffer (line 27) | Buffer() = default;
    class IIpuSession (line 38) | class IIpuSession {

FILE: poptorch_err/exception_info/poptorch_err/ExceptionInfo.hpp
  type poptorch (line 6) | namespace poptorch {
    type ErrorCategory (line 8) | enum class ErrorCategory { RuntimeRecoverable, RuntimeUnrecoverable, O...
    class ExceptionInfo (line 16) | class ExceptionInfo {

FILE: poptorch_err/include/poptorch_err/ExceptionHandling.hpp
  type poptorch (line 10) | namespace poptorch {
    type PoptorchErrorInfo (line 17) | struct PoptorchErrorInfo {
  type PoptorchCatchWrapperImpl (line 47) | struct PoptorchCatchWrapperImpl
  type PoptorchCatchWrapperImpl<g, catch_all, R (*)(Args...), f> (line 50) | struct PoptorchCatchWrapperImpl<g, catch_all, R (*)(Args...), f> {
    method R (line 51) | static R wrap(Args... args) {

FILE: poptorch_err/source/ExceptionHandling.cpp
  type poptorch (line 14) | namespace poptorch {
    function PoptorchErrorInfo (line 20) | PoptorchErrorInfo convertToPoptorchExceptionOrRethrow(

FILE: poptorch_geometric/python/__init__.py
  function registerOverrideManager (line 23) | def registerOverrideManager():

FILE: poptorch_geometric/python/cluster_loader.py
  class FixedSizeClusterLoader (line 16) | class FixedSizeClusterLoader(PyGFixedSizeClusterLoader, poptorch.DataLoa...
    method __init__ (line 57) | def __init__(
    method _create_collater (line 82) | def _create_collater(self, **collater_args):

FILE: poptorch_geometric/python/collate.py
  function make_exclude_keys (line 29) | def make_exclude_keys(include_keys: Union[List[str], Tuple[str, ...]],
  function _divide_evenly_formula (line 34) | def _divide_evenly_formula(amount: int, pieces: int) -> List[int]:
  function _divide_evenly (line 41) | def _divide_evenly(data, num_pad_graphs, num_pad_nodes, num_pad_edges): ...
  function _ (line 46) | def _(_, num_pad_graphs: int, num_pad_nodes: int,
  function _ (line 54) | def _(_, num_pad_graphs: int, num_pad_nodes: Dict[NodeType, int],
  function _generate_data_to_pad (line 71) | def _generate_data_to_pad(data_to_pad_dict):
  function _ (line 76) | def _(data_to_pad_dict: dict) -> Data:
  function _ (line 81) | def _(data_to_pad_dict: dict) -> HeteroData:
  function _reset_dim (line 85) | def _reset_dim(shape: torch.Size, key: str = None) -> List[int]:
  function _reset_attr (line 94) | def _reset_attr(value: Any, key: str = None) -> Any:
  function _create_preserve_mask (line 107) | def _create_preserve_mask(num_elems: int, num_elems_to_trim: int,
  function data_slice_gen (line 126) | def data_slice_gen(num_list: List[int]) -> Generator[slice, None, None]:
  function create_slices_and_preserve_mask (line 135) | def create_slices_and_preserve_mask(
  function _any_negative (line 155) | def _any_negative(value: int) -> bool:
  function _ (line 160) | def _(value: dict) -> bool:
  function _any_positive (line 165) | def _any_positive(value: int) -> bool:
  function _ (line 170) | def _(value: dict) -> bool:
  function _check_if_over_size (line 175) | def _check_if_over_size(num_pad: int, num_total: int, type_str: str,
  function _ (line 185) | def _(num_pad: dict, num_total: dict, type_str: str, oversize_error: str):
  class FixedSizeCollater (line 194) | class FixedSizeCollater(Collater):
    method __init__ (line 236) | def __init__(
    class LabelsType (line 252) | class LabelsType(Enum):
    method __call__ (line 256) | def __call__(self, data_list: List[BaseData]) -> Batch:
    method _add_masks (line 355) | def _add_masks(self, batch, num_all_graphs, num_real_graphs, **kwargs):
    method _ (line 359) | def _(self, batch: DataBatch, num_all_graphs: int, num_real_graphs: int,
    method _ (line 371) | def _(self, batch: HeteroDataBatch, num_all_graphs: int,
    method _calc_pad_limits (line 397) | def _calc_pad_limits(
    method _calc_pad_limits_body (line 410) | def _calc_pad_limits_body(self, data, data_list):  # pylint: disable=u...
    method _ (line 414) | def _(self, _, data_list: List[Data]) -> Tuple[int, int, int, int]:
    method _ (line 428) | def _(self, _, data_list: List[HeteroData]
    method _create_padded_data (line 472) | def _create_padded_data(
    method _prune_edges (line 496) | def _prune_edges(self, data_list):
    method _prune_edges_body (line 500) | def _prune_edges_body(self, data, data_list):  # pylint: disable=unuse...
    method _ (line 504) | def _(self, _, data_list: List[Data]) -> List[Data]:
    method _ (line 519) | def _(self, data: HeteroData,
    method _prune_nodes (line 541) | def _prune_nodes(self, data_list):
    method _prune_nodes_body (line 545) | def _prune_nodes_body(self, data, data_list):  # pylint: disable=unuse...
    method _ (line 549) | def _(self, _, data_list: List[BaseData]) -> List[BaseData]:
    method _ (line 572) | def _(self, data: HeteroData,
    method _create_structure_dict (line 602) | def _create_structure_dict(self, data):
    method _ (line 609) | def _(self, data: Data) -> Dict[NodeType, Any]:
    method _ (line 625) | def _(self, data: HeteroData) -> Dict[Union[NodeType, EdgeType], Any]:
    method _pad_graph_values (line 639) | def _pad_graph_values(self, padded_data, original_data):
    method _ (line 645) | def _(self, padded_data: Data, original_data: Data) -> None:
    method _ (line 663) | def _(self, padded_data: HeteroData, original_data: HeteroData) -> None:
    method _pad_graph_values_body (line 669) | def _pad_graph_values_body(self, padded_data: BaseData,
  class CombinedBatchingCollater (line 681) | class CombinedBatchingCollater:
    method __init__ (line 697) | def __init__(
    method __call__ (line 707) | def __call__(self, batch: List[BaseData]) -> Batch:

FILE: poptorch_geometric/python/common.py
  function call_once (line 9) | def call_once(f):

FILE: poptorch_geometric/python/dataloader.py
  class DataLoader (line 16) | class DataLoader(PyGDataLoader, poptorch.DataLoader):
    method __init__ (line 39) | def __init__(
    method _create_collater (line 62) | def _create_collater(self, **collater_args):
  class FixedSizeDataLoader (line 68) | class FixedSizeDataLoader(PyGFixedSizeDataLoader, poptorch.DataLoader):
    method __init__ (line 123) | def __init__(
    method _create_collater (line 153) | def _create_collater(self, **collater_args):

FILE: poptorch_geometric/python/fixed_size_options.py
  function validate_num_graphs (line 10) | def validate_num_graphs(num_graphs):
  class FixedSizeOptions (line 18) | class FixedSizeOptions:
    method __init__ (line 52) | def __init__(self,
    method is_hetero (line 83) | def is_hetero(self):
    method to_hetero (line 89) | def to_hetero(self, node_types: List[NodeType],
    method total_num_nodes (line 100) | def total_num_nodes(self):
    method total_num_edges (line 109) | def total_num_edges(self):
    method from_dataset (line 118) | def from_dataset(cls,
    method from_loader (line 164) | def from_loader(cls, loader: DataLoader, sample_limit: int = 1000):
    method __repr__ (line 222) | def __repr__(self):

FILE: poptorch_geometric/python/masker.py
  class Masker (line 76) | class Masker(abc.ABC):
    method node_masker (line 112) | def node_masker(self, node_entries: Entries, mask: Mask = None) -> Ent...
    method edge_masker (line 116) | def edge_masker(self, edge_entries: Entries, mask: Mask = None) -> Ent...
    method graph_masker (line 120) | def graph_masker(self, graph_entries: Entries,
  class NoMasker (line 125) | class NoMasker(Masker):
    method node_masker (line 128) | def node_masker(self, node_entries: Entries, mask: Mask = None) -> Ent...
    method edge_masker (line 131) | def edge_masker(self, edge_entries: Entries, mask: Mask = None) -> Ent...
    method graph_masker (line 134) | def graph_masker(self, graph_entries: Entries,
  class LayerMasker (line 139) | class LayerMasker(abc.ABC):
    method __init__ (line 161) | def __init__(self, masker: Masker) -> None:
    method node_masker (line 166) | def node_masker(self, layer: Layer) -> DecoratedLayer:
    method edge_masker (line 173) | def edge_masker(self, layer: Layer) -> DecoratedLayer:
    method graph_masker (line 180) | def graph_masker(self, layer: Layer) -> DecoratedLayer:
  class PreLayerMasker (line 187) | class PreLayerMasker(LayerMasker):
    method node_masker (line 191) | def node_masker(self, layer: Layer) -> DecoratedLayer:
    method edge_masker (line 194) | def edge_masker(self, layer: Layer) -> DecoratedLayer:
    method graph_masker (line 197) | def graph_masker(self, layer: Layer) -> DecoratedLayer:

FILE: poptorch_geometric/python/neighbor_loader.py
  class PyGFixedSizeNeighborLoader (line 23) | class PyGFixedSizeNeighborLoader(torch.utils.data.DataLoader):
    method __init__ (line 24) | def __init__(
    method __collate__ (line 91) | def __collate__(self, index):
    method _create_collater (line 96) | def _create_collater(self, **collater_args):
    method nativeCollate (line 100) | def nativeCollate(self, index):
    method fixedSizeCollate (line 104) | def fixedSizeCollate(self, data_list: List[BaseData]):
  class FixedSizeNeighborLoader (line 125) | class FixedSizeNeighborLoader(PyGFixedSizeNeighborLoader, poptorch.DataL...
    method __init__ (line 235) | def __init__(
    method _create_collater (line 294) | def _create_collater(self, **collater_args):

FILE: poptorch_geometric/python/ops/aggregation_base.py
  class Aggregation (line 7) | class Aggregation(torch_geometric.nn.aggr.Aggregation):
    method assert_sorted_index (line 8) | def assert_sorted_index(self, index: Optional[Tensor]):

FILE: poptorch_geometric/python/ops/cluster_gcn_conv.py
  class ClusterGCNConv (line 43) | class ClusterGCNConv(MessagePassing):
    method __init__ (line 72) | def __init__(self,
    method reset_parameters (line 98) | def reset_parameters(self):
    method forward (line 103) | def forward(self, x: Tensor, edge_index: Adj) -> Tensor:
    method message (line 143) | def message(self, x_j: Tensor, edge_weight: Tensor) -> Tensor:
    method message_and_aggregate (line 146) | def message_and_aggregate(self, adj_t: SparseTensor, x: Tensor) -> Ten...
    method __repr__ (line 149) | def __repr__(self) -> str:

FILE: poptorch_geometric/python/ops/hetero_linear.py
  class HeteroLinear (line 31) | class HeteroLinear(torch_geometric.nn.dense.linear.HeteroLinear):
    method __init__ (line 62) | def __init__(self, *args, **kwargs):
    method forward (line 65) | def forward(self, x: Tensor, type_vec: Tensor) -> Tensor:

FILE: poptorch_geometric/python/ops/instance_norm.py
  class InstanceNorm (line 37) | class InstanceNorm(_InstanceNorm):
    method __init__ (line 67) | def __init__(
    method reset_parameters (line 78) | def reset_parameters(self):
    method forward (line 82) | def forward(self,
    method __repr__ (line 149) | def __repr__(self) -> str:

FILE: poptorch_geometric/python/ops/knn.py
  function knn (line 31) | def knn(x: torch.Tensor,

FILE: poptorch_geometric/python/ops/knn_graph.py
  function knn_graph (line 33) | def knn_graph(x: torch.Tensor,

FILE: poptorch_geometric/python/ops/knn_interpolate.py
  function knn_interpolate (line 34) | def knn_interpolate(x: torch.Tensor,

FILE: poptorch_geometric/python/ops/mf_conv.py
  class MFConv (line 36) | class MFConv(torch_geometric.nn.conv.MFConv):
    method __init__ (line 70) | def __init__(self, *args, **kwargs):
    method forward (line 73) | def forward(self,

FILE: poptorch_geometric/python/ops/radius.py
  function radius (line 32) | def radius(
  function radius_graph (line 114) | def radius_graph(

FILE: poptorch_geometric/python/override.py
  class _TorchGeometricOpsSubstitutionManager (line 12) | class _TorchGeometricOpsSubstitutionManager:
    method __init__ (line 53) | def __init__(self):
    method __enter__ (line 56) | def __enter__(self):
    method __exit__ (line 60) | def __exit__(self, exc_type, value, traceback):
    method replace (line 63) | def replace(self):
    method restore (line 80) | def restore(self):
  function registerOptionalOverrides (line 90) | def registerOptionalOverrides():

FILE: poptorch_geometric/python/pyg_cluster_loader.py
  class FixedSizeClusterLoader (line 12) | class FixedSizeClusterLoader(torch.utils.data.DataLoader):
    method __init__ (line 50) | def __init__(
    method _collate (line 90) | def _collate(self, batch):
    method _create_collater (line 95) | def _create_collater(self, **collater_args):

FILE: poptorch_geometric/python/pyg_collate.py
  class Collater (line 8) | class Collater(PyGCollater):
    method __init__ (line 9) | def __init__(self, follow_batch=None, exclude_keys=None):

FILE: poptorch_geometric/python/pyg_dataloader.py
  class FixedSizeStrategy (line 17) | class FixedSizeStrategy(Enum):
  class OverSizeStrategy (line 31) | class OverSizeStrategy(Enum):
  class DataLoader (line 62) | class DataLoader(torch.utils.data.DataLoader):
    method __init__ (line 82) | def __init__(
    method _create_collater (line 109) | def _create_collater(self, **collater_args):
  class FixedSizeDataLoader (line 116) | class FixedSizeDataLoader(torch.utils.data.DataLoader):
    method __init__ (line 168) | def __init__(
    method _create_collater (line 265) | def _create_collater(self, **collater_args):

FILE: poptorch_geometric/python/stream_packing_sampler.py
  class StreamPackingSampler (line 13) | class StreamPackingSampler(Sampler[List[int]]):
    method __init__ (line 41) | def __init__(
    method _validate (line 70) | def _validate(self, sampler, max_num_nodes, max_num_edges, max_num_gra...
    class _Batch (line 92) | class _Batch:
      method __init__ (line 93) | def __init__(self) -> None:
      method append (line 99) | def append(self, idx: int, data: BaseData) -> None:
      method empty (line 105) | def empty(self) -> bool:
      method __repr__ (line 108) | def __repr__(self) -> str:
    method __iter__ (line 114) | def __iter__(self) -> Iterator[List[int]]:
    method _has_space (line 147) | def _has_space(self, batch: _Batch, data: BaseData) -> bool:
    method __len__ (line 164) | def __len__(self) -> int:

FILE: poptorch_geometric/python/types.py
  class PyGArgsParser (line 19) | class PyGArgsParser(ICustomArgParser):
    method _sortedTensorKeys (line 21) | def _sortedTensorKeys(struct: Union[Data, DataBatch]) -> Iterable[str]:
    method yieldTensors (line 30) | def yieldTensors(self, struct) -> Generator[torch.Tensor, None, None]:
    method _ (line 34) | def _(self, struct: Data
    method _ (line 40) | def _(self, struct: HeteroData
    method _setup_num_fields (line 53) | def _setup_num_fields(
    method _add_next (line 83) | def _add_next(tensor_iterator: Iterable[List[Any]],
    method reconstruct (line 90) | def reconstruct(self, original_structure,
    method _ (line 95) | def _(self, original_structure: Data or DataBatch,
    method _ (line 119) | def _(self, original_structure: HeteroData or HeteroDataBatch,
  function registerCustomArgParsers (line 154) | def registerCustomArgParsers():

FILE: poptorch_geometric/python/utils.py
  function set_aggregation_dim_size (line 12) | def set_aggregation_dim_size(model: torch.nn.Module, dim_size: int):
  class TrainingStepper (line 29) | class TrainingStepper:
    method __init__ (line 42) | def __init__(self,
    method setup_cpu (line 65) | def setup_cpu(self, model, optimizer):
    method setup_ipu (line 71) | def setup_ipu(self, model, optimizer):
    method check_parameters (line 86) | def check_parameters(self):
    method cpu_step (line 93) | def cpu_step(self, batch):
    method ipu_step (line 100) | def ipu_step(self, batch, copy_weights=True):
    method run (line 106) | def run(self, *args):
    method run_inference (line 115) | def run_inference(self, batch):
    method _run_common_input (line 123) | def _run_common_input(self, num_steps, batch):
    method _run_separate_inputs (line 135) | def _run_separate_inputs(self, num_steps, cpu_batch, ipu_batch):
    method assert_close (line 149) | def assert_close(self, actual, expected, id):
    method benchmark (line 160) | def benchmark(self, num_steps, batch, devices=('ipu')):

FILE: poptorch_logging/include/poptorch_logging/Error.hpp
  type poptorch (line 12) | namespace poptorch {
    type logging (line 13) | namespace logging {
      type detail (line 15) | namespace detail {
        type LogContextImpl (line 16) | struct LogContextImpl
        type ErrorImpl (line 17) | struct ErrorImpl
    class Error (line 53) | class Error : public std::runtime_error {
    class InternalError (line 72) | class InternalError : public Error {
    class LogContext (line 80) | class LogContext {
      method LogContext (line 89) | explicit LogContext(const std::string &context)

FILE: poptorch_logging/include/poptorch_logging/Logging.hpp
  type poptorch (line 30) | namespace poptorch {
    type logging (line 31) | namespace logging {
      function log (line 38) | void log(Level l, const char *s, const Args &...args) {

FILE: poptorch_logging/include/poptorch_logging/LoggingLight.hpp
  type poptorch (line 13) | namespace poptorch {
    type logging (line 14) | namespace logging {
      type Level (line 16) | enum class Level {

FILE: poptorch_logging/include/poptorch_logging/Tracepoint.hpp
  type poptorch (line 9) | namespace poptorch {
    type logging (line 10) | namespace logging {
      type detail (line 12) | namespace detail {
        class TracepointImpl (line 13) | class TracepointImpl
      class Tracepoint (line 18) | class Tracepoint {
      function formatPrettyFunction (line 30) | inline std::string formatPrettyFunction(const char *c) {

FILE: poptorch_logging/source/Error.cpp
  type poptorch (line 11) | namespace poptorch {
    type logging (line 12) | namespace logging {
      function Context (line 17) | Context &getContext() {
      function singleLineContext (line 22) | std::string singleLineContext() {
      function getStackTrace (line 32) | std::string getStackTrace() {
      type detail (line 52) | namespace detail {
        type LogContextImpl (line 53) | struct LogContextImpl {
          method LogContextImpl (line 54) | LogContextImpl() : cleared(true) {}
        type ErrorImpl (line 67) | struct ErrorImpl {

FILE: poptorch_logging/source/Logging.cpp
  type poptorch (line 15) | namespace poptorch {
    type logging (line 16) | namespace logging {
      function translate (line 29) | spdlog::level::level_enum translate(Level l) {
      type LoggingContext (line 34) | struct LoggingContext {
      function LoggingContext (line 41) | LoggingContext &context() {
      function Level (line 48) | Level logLevelFromString(const std::string &level) {
      function setColours (line 75) | void setColours(spdlog::sinks::ansicolor_sink<Mutex> &sink) {
      function outputPopartIR (line 126) | bool outputPopartIR() {
      function repeatLimit (line 130) | std::uint64_t repeatLimit() { return context().repeat_limit; }
      function setRepeatLimit (line 132) | void setRepeatLimit(std::uint64_t limit) { context().repeat_limit = ...
      function log (line 134) | void log(Level l, const char *msg) { context().logger->log(translate...
      function shouldLog (line 136) | bool shouldLog(Level l) { return context().logger->should_log(transl...
      function setLogLevel (line 138) | void setLogLevel(Level l) { context().logger->set_level(translate(l)...
      function flush (line 140) | void flush() { context().logger->flush(); }

FILE: poptorch_logging/source/Tracepoint.cpp
  type poptorch (line 8) | namespace poptorch {
    type logging (line 10) | namespace logging {
      type detail (line 12) | namespace detail {
        class TracepointImpl (line 14) | class TracepointImpl : public pvti::Tracepoint {
          method TracepointImpl (line 16) | explicit TracepointImpl(const std::string &label_)

FILE: python/__init__.py
  function poptorchAtExit (line 67) | def poptorchAtExit():
  function load (line 71) | def load(filename: str,
  class _SubDataset (line 126) | class _SubDataset:
    method __init__ (line 139) | def __init__(self, dataset, opts, step, drop_last):
    method shuffle_global_indices (line 166) | def shuffle_global_indices(self):
    method swap_range (line 185) | def swap_range(self):
    method __len__ (line 204) | def __len__(self):
    method __getitem__ (line 207) | def __getitem__(self, index):
  function _batch_sampler_len (line 214) | def _batch_sampler_len(
  class DataLoader (line 229) | class DataLoader(torch.utils.data.DataLoader):
    method __init__ (line 239) | def __init__(
    method __len__ (line 468) | def __len__(self) -> int:
    method _profiling (line 483) | def _profiling(self):
    method combinedBatchSize (line 487) | def combinedBatchSize(self) -> Optional[int]:
    method options (line 493) | def options(self) -> 'poptorch.Options':
    method terminate (line 499) | def terminate(self) -> None:
    method __del__ (line 507) | def __del__(self) -> None:
    method __iter__ (line 510) | def __iter__(self) -> "torch.utils.data.dataloader._BaseDataLoaderIter":
  class AsynchronousDataAccessor (line 526) | class AsynchronousDataAccessor:
    method __init__ (line 544) | def __init__(
    method terminate (line 620) | def terminate(self) -> None:
    method __del__ (line 628) | def __del__(self) -> None:
    method __len__ (line 631) | def __len__(self) -> int:
    method __iter__ (line 641) | def __iter__(self) -> 'poptorch.AsynchronousDataAccessor':
    method __next__ (line 646) | def __next__(self) -> Any:
  function trainingModel (line 660) | def trainingModel(model: Union['torch.nn.Module', 'poptorch.PoplarExecut...
  function inferenceModel (line 720) | def inferenceModel(model: Union['torch.nn.Module', 'poptorch.PoplarExecu...
  function ipuHardwareIsAvailable (line 749) | def ipuHardwareIsAvailable(num_ipus: int = 1) -> bool:
  function ipuHardwareVersion (line 760) | def ipuHardwareVersion() -> int:
  function setLogLevel (line 772) | def setLogLevel(level: Union[str, int]):
  function _tensor_str (line 791) | def _tensor_str(self, indent):
  class ICustomArgParser (line 800) | class ICustomArgParser(abc.ABC):
    method yieldTensors (line 805) | def yieldTensors(self, struct) -> None:
    method reconstruct (line 818) | def reconstruct(self, original_structure, tensor_iterator) -> Any:
  function registerCustomArgParser (line 837) | def registerCustomArgParser(arg_data_type: Type,
  function registerGeometricCustomArgParsers (line 856) | def registerGeometricCustomArgParsers():

FILE: python/_args_parser.py
  class ArgsParser (line 13) | class ArgsParser:
    class Args (line 14) | class Args:
      method __init__ (line 15) | def __init__(self):
      method args (line 22) | def args(self):
      method arg_names (line 26) | def arg_names(self):
      method kwargs (line 30) | def kwargs(self):
      method appendArg (line 33) | def appendArg(self, arg, name):
      method setNamedArg (line 37) | def setNamedArg(self, name, arg):
      method popArg (line 40) | def popArg(self):
      method clone (line 44) | def clone(self):
      method _forEach (line 53) | def _forEach(self, data, fn):
      method validateInputs (line 58) | def validateInputs(self, inputs):
      method forEachTensorMatchedAtLeastOnce (line 145) | def forEachTensorMatchedAtLeastOnce(self, condition, doOnTrue=None):
      method forEach (line 158) | def forEach(self, fn):
      method asPackedFlatTuple (line 162) | def asPackedFlatTuple(self, canonical_args=None):
    method __init__ (line 171) | def __init__(self, model: Any):
    method __call__ (line 210) | def __call__(self,
    method _dictCheck (line 300) | def _dictCheck(self, data):

FILE: python/_dataloader.py
  class AsynchronousWorker (line 22) | class AsynchronousWorker:
    method __init__ (line 25) | def __init__(self, buffer_size, miss_sleep_time_in_ms, dataset,
    method terminate (line 39) | def terminate(self):
    method resetIterator (line 45) | def resetIterator(self):
    method dataIsAvailable (line 76) | def dataIsAvailable(self):
    method endOfFile (line 79) | def endOfFile(self):
    method acquireElementIfAvailable (line 82) | def acquireElementIfAvailable(self):
    method assertNoError (line 131) | def assertNoError(self):
    method releaseElement (line 136) | def releaseElement(self):
    method _requestShutdown (line 141) | def _requestShutdown(self):
  class _AsynchronousWorkerProcess (line 149) | class _AsynchronousWorkerProcess:
    method __init__ (line 152) | def __init__(self, buffer_size, miss_sleep_time_in_ms, dataset,
    method isAlive (line 165) | def isAlive(self):
    method exitCode (line 168) | def exitCode(self):
    method join (line 171) | def join(self):
    method start (line 184) | def start(self):
    method _start (line 202) | def _start(self):
    method _mainLoop (line 258) | def _mainLoop(self, conn, command_pipe):  # pylint: disable=inconsiste...
    method _mainLoopNoInterrupt (line 280) | def _mainLoopNoInterrupt(self, conn, command_pipe):  # pylint: disable...
  class _HostCommand (line 574) | class _HostCommand(enum.IntEnum):
  class _WorkerState (line 581) | class _WorkerState(enum.IntEnum):
  class _HostCommandHandler (line 587) | class _HostCommandHandler:
    method __init__ (line 588) | def __init__(self, command_pipe):
    method checkMessages (line 595) | def checkMessages(self, blocking=False, ignore_setup_complete=True):
    method priorityCommandWaiting (line 627) | def priorityCommandWaiting(self):
    method waitUntilSetupComplete (line 630) | def waitUntilSetupComplete(self):
    method startIteratingPending (line 637) | def startIteratingPending(self):
    method resetIteratorPending (line 644) | def resetIteratorPending(self):
    method waitUntilStartIteration (line 651) | def waitUntilStartIteration(self):
  class _EndOfFileFlag (line 665) | class _EndOfFileFlag:
    method __init__ (line 688) | def __init__(self, eof_mem=None):
    method setResetFlag (line 693) | def setResetFlag(self):
    method waitForReset (line 697) | def waitForReset(self):
    method isEofIndex (line 701) | def isEofIndex(self, index):
    method leftOver (line 704) | def leftOver(self, index):
    method clearFlag (line 720) | def clearFlag(self):
    method setFlag (line 724) | def setFlag(self, buffer_idx, last_batch_size=0):
  class _RingBufferIndex (line 738) | class _RingBufferIndex:
    method __init__ (line 753) | def __init__(self, buffer_size, indices_mem=None):
    method increment (line 763) | def increment(self):
    method reset (line 768) | def reset(self):
    method set (line 772) | def set(self, value):
    method value (line 775) | def value(self):
    method __call__ (line 778) | def __call__(self):
  class _IDataRingBuffer (line 782) | class _IDataRingBuffer:
    method __init__ (line 783) | def __init__(self, buffer_size, data_len, indices_mem=None):
    method setBuffer (line 798) | def setBuffer(self, buffer, data_idx):
    method current (line 810) | def current(self):
    method indices_mem (line 815) | def indices_mem(self):
    method currentIndex (line 820) | def currentIndex(self):
    method reset (line 823) | def reset(self):
  class _DataRingBufferWriter (line 829) | class _DataRingBufferWriter(_IDataRingBuffer):
    method markWriteComplete (line 843) | def markWriteComplete(self):
    method isAvailable (line 849) | def isAvailable(self):
  class _DataRingBufferReader (line 856) | class _DataRingBufferReader(_IDataRingBuffer):
    method __init__ (line 869) | def __init__(self, buffer_size, data_len, indices_mem=None):
    method isAvailable (line 873) | def isAvailable(self):
    method hasLock (line 877) | def hasLock(self):
    method lock (line 882) | def lock(self):
    method unlockIfLocked (line 889) | def unlockIfLocked(self):

FILE: python/_impl.py
  class NameScopeHook (line 38) | class NameScopeHook:
    method __init__ (line 44) | def __init__(self, module: 'torch.nn.Module'):
    method _enter_fn (line 53) | def _enter_fn(self, module, input, name):  # pylint: disable=unused-ar...
    method _exit_fn (line 56) | def _exit_fn(self, module, input, output):  # pylint: disable=unused-a...
    method remove (line 59) | def remove(self):
  function createPoptorchError (line 67) | def createPoptorchError(msg):
  function isRunningOnIpu (line 76) | def isRunningOnIpu() -> bool:
  function setIpuContext (line 95) | def setIpuContext(val: bool):
  function isDispatchTracing (line 100) | def isDispatchTracing() -> bool:
  function setDispatchTracing (line 108) | def setDispatchTracing(val: bool):
  function internal_cast (line 113) | def internal_cast(tensor, dtype):
  function applyOptimizer (line 125) | def applyOptimizer(optimizer):
  class OptimizerWrapper (line 138) | class OptimizerWrapper(torch.nn.Module):
    method __init__ (line 139) | def __init__(self, model, optimizer):
    method forward (line 144) | def forward(self, *args, **kwargs):
  function destroyDispatcherOnExit (line 150) | def destroyDispatcherOnExit(func):
  function distributedCacheLock (line 170) | def distributedCacheLock(model, opts):
  class WeakPtr (line 232) | class WeakPtr(weakref.ref):
    method __eq__ (line 235) | def __eq__(self, other):
  class WeakKeyPtrDict (line 248) | class WeakKeyPtrDict:
    method __init__ (line 249) | def __init__(self, dict=None):
    method __setitem__ (line 261) | def __setitem__(self, key, value):
    method __delitem__ (line 264) | def __delitem__(self, key):
    method __getitem__ (line 267) | def __getitem__(self, key):
    method get (line 270) | def get(self, key, default=None):
    method __contains__ (line 273) | def __contains__(self, key):
    method update (line 276) | def update(self, dict=None):
  function _restoreWrapperIfNecessary (line 303) | def _restoreWrapperIfNecessary(obj):
  function _unwrapIfWrappedAndRegister (line 310) | def _unwrapIfWrappedAndRegister(obj):
  function _pickleUnwrapObject (line 318) | def _pickleUnwrapObject(obj):
  function registerWrapperType (line 333) | def registerWrapperType(wrapper_type):
  function isWrapped (line 340) | def isWrapped(obj):
  function unwrapIfWrapped (line 345) | def unwrapIfWrapped(obj):
  function traceMethod (line 353) | def traceMethod(label):
  function forEachParameterAndBuffer (line 365) | def forEachParameterAndBuffer(model, fn):
  function unwrapModelIfNecessary (line 378) | def unwrapModelIfNecessary(model: torch.nn.Module):
  function rewrapModelIfNecessary (line 388) | def rewrapModelIfNecessary(model: torch.nn.Module):
  function getBufferAndParameterTensors (line 397) | def getBufferAndParameterTensors(model):
  function getBufferAndParameterAddresses (line 407) | def getBufferAndParameterAddresses(model):
  function errorOnBufferOrParameterAddressChanges (line 432) | def errorOnBufferOrParameterAddressChanges(old_addresses, new_addresses):

FILE: python/_logging.py
  function setPopartLogLevel (line 32) | def setPopartLogLevel(level):
  function setLogLevel (line 41) | def setLogLevel(level, update_cpp=True):
  class _PoptorchFormatter (line 81) | class _PoptorchFormatter(logging.Formatter):
    method outputToFile (line 94) | def outputToFile(self):
    method __init__ (line 97) | def __init__(self):
    method formatTime (line 105) | def formatTime(self, record, datefmt=None):
    method format (line 114) | def format(self, record):
  function _excepthook (line 120) | def _excepthook(*args):

FILE: python/_optimizer_attributes.py
  class OptimizerAttrTracker (line 11) | class OptimizerAttrTracker:
    method __init__ (line 12) | def __init__(self, opts):
    method setType (line 23) | def setType(self, optimizer_type):
    method enableChecks (line 29) | def enableChecks(self):
    method checkDefaultAttributes (line 32) | def checkDefaultAttributes(self, provided):
    method checkGroupAttributes (line 35) | def checkGroupAttributes(self, provided, group):
    method checkOptimizerAttributes (line 39) | def checkOptimizerAttributes(self, provided):
    method _check (line 42) | def _check(self, expected, provided, attr_type):
  function convertOptimizerToDict (line 55) | def convertOptimizerToDict(optimizer, attr_tracker, options, is_compiled):
  class _OptimizerType (line 273) | class _OptimizerType(enum.IntEnum):
  function _toPoptorchClass (line 285) | def _toPoptorchClass(optimizer_type):
  function _toPoptorchOptimizer (line 303) | def _toPoptorchOptimizer(optimizer):
  function _toCamelCase (line 352) | def _toCamelCase(string):
  class _GroupGetter (line 358) | class _GroupGetter:
    method __init__ (line 361) | def __init__(self, default_value=None):
    method __call__ (line 364) | def __call__(self, group, name):
  class _OptimizerGetter (line 373) | class _OptimizerGetter:
    method __init__ (line 376) | def __init__(self, default_value=None):
    method __call__ (line 379) | def __call__(self, opt, name):
  function _assertIsNumber (line 389) | def _assertIsNumber(value, name):
  class _ValueConstPairFormatter (line 394) | class _ValueConstPairFormatter:
    method __init__ (line 404) | def __init__(self, variable_attrs, const_evaluator, value_validator=No...
    method __call__ (line 413) | def __call__(self, value, name):
  class _IsEqualTo (line 422) | class _IsEqualTo:
    method __init__ (line 425) | def __init__(self, reference):
    method __call__ (line 428) | def __call__(self, value):
  class _AttrReader (line 432) | class _AttrReader:
    method __init__ (line 433) | def __init__(self, readers, name, getter, formatter=None, new_name=None):
    method __call__ (line 447) | def __call__(self, params):
  class _BetaReader (line 463) | class _BetaReader(_AttrReader):
    method __init__ (line 464) | def __init__(self, attr_readers, variable_attrs):
    method __call__ (line 480) | def __call__(self, params):

FILE: python/_options_config.py
  function parseAndSetOptions (line 8) | def parseAndSetOptions(options, filepath):

FILE: python/_options_impl.py
  class ProgressBar (line 20) | class ProgressBar:
    method __init__ (line 21) | def __init__(self):
    method __call__ (line 27) | def __call__(self, progress: int, total: int):
  class OptionsDict (line 48) | class OptionsDict:
    method __init__ (line 53) | def __init__(self, **default_values):
    method set (line 70) | def set(self, **kwargs):
    method createOrSet (line 82) | def createOrSet(self, **kwargs):
    method exists (line 90) | def exists(self, option):
    method deleteIfExists (line 93) | def deleteIfExists(self, option):
    method _hasattr (line 97) | def _hasattr(self, option):
    method _changeFreezeState (line 105) | def _changeFreezeState(self, new_state):
    method _freeze (line 115) | def _freeze(self):
    method _unfreeze (line 118) | def _unfreeze(self):
    method checkIsFrozen (line 121) | def checkIsFrozen(self, option=None):
    method __deepcopy__ (line 127) | def __deepcopy__(self, memory):
    method __getstate__ (line 137) | def __getstate__(self):
    method __setstate__ (line 140) | def __setstate__(self, state):
    method __setattr__ (line 143) | def __setattr__(self, option, value):
    method __getattr__ (line 158) | def __getattr__(self, option):
    method update (line 165) | def update(self, other):
    method toDict (line 175) | def toDict(self):
    method __call__ (line 178) | def __call__(self, option):
    method __repr__ (line 181) | def __repr__(self):
  class IStageManager (line 196) | class IStageManager(abc.ABC):
    method __init__ (line 197) | def __init__(self):
    method clearDebug (line 205) | def clearDebug(self):
    method _debug (line 208) | def _debug(self, *args):
    method printDebug (line 212) | def printDebug(self):
    method nextAutoId (line 228) | def nextAutoId(self):
    method getStage (line 234) | def getStage(self, block_id):
    method beginStage (line 238) | def beginStage(self, user_id, ipu_id_from_block):
    method resetAutoId (line 253) | def resetAutoId(self):

FILE: python/_poplar_executor.py
  class _SetDefaultDeviceType (line 36) | class _SetDefaultDeviceType:
    method __init__ (line 37) | def __init__(self):
    method replace (line 41) | def replace(self):
    method restore (line 94) | def restore(self):
  class _OverwriteContextManager (line 103) | class _OverwriteContextManager:
    method __init__ (line 107) | def __init__(self):
    method __enter__ (line 113) | def __enter__(self):
    method __exit__ (line 119) | def __exit__(self, exc_type, value, traceback):
    method registerSubsitutionManager (line 124) | def registerSubsitutionManager(cls, type):
  class PoplarExecutor (line 130) | class PoplarExecutor:
    method __init__ (line 140) | def __init__(self,
    method _install_state_hooks (line 375) | def _install_state_hooks(self):
    method _update_optimizer_if_needed (line 385) | def _update_optimizer_if_needed(self):
    method _read_optim_state_dict_if_needed (line 393) | def _read_optim_state_dict_if_needed(self):
    method _on_device_attach (line 414) | def _on_device_attach(self):
    method _get_optim_state_dict (line 434) | def _get_optim_state_dict(self):
    method _write_optim_state_dict_if_needed (line 439) | def _write_optim_state_dict_if_needed(self):
    method load_state_dict (line 458) | def load_state_dict(self,
    method __repr__ (line 476) | def __repr__(self):
    method __getattr__ (line 480) | def __getattr__(self, attr):
    method model (line 512) | def model(self) -> 'torch.nn.Module':
    method options (line 517) | def options(self) -> 'poptorch.Options':
    method _debugGetPopartIR (line 523) | def _debugGetPopartIR(self) -> str:
    method getTensorNames (line 526) | def getTensorNames(self) -> List[str]:
    method getAnchoredTensor (line 538) | def getAnchoredTensor(self, short_name: str) -> torch.Tensor:
    method copyWeightsToHostIfNeeded (line 543) | def copyWeightsToHostIfNeeded(self) -> bool:
    method copyWeightsToHost (line 555) | def copyWeightsToHost(self) -> None:
    method copyWeightsToDevice (line 577) | def copyWeightsToDevice(self) -> None:
    method copyNamedBuffersToDevice (line 600) | def copyNamedBuffersToDevice(self) -> None:
    method setOptimizer (line 631) | def setOptimizer(self, optimizer: 'torch.optim.Optimizer'):
    method _get_module_and_name (line 671) | def _get_module_and_name(self, n):
    method _compileWithDispatch (line 695) | def _compileWithDispatch(self, in_tensors, executable_filename=None):
    method _compile (line 947) | def _compile(self, in_tensors):
    method _preprocessGraph (line 1007) | def _preprocessGraph(self, in_tensors):
    method compile (line 1026) | def compile(self, *args, **kwargs) -> None:
    method loadExecutable (line 1046) | def loadExecutable(self, filename: str) -> None:
    method save (line 1069) | def save(self,
    method rng_state (line 1123) | def rng_state(self) -> List[int]:
    method rng_state (line 1136) | def rng_state(self, state: List[int]):
    method _copyRngStateToDevice (line 1146) | def _copyRngStateToDevice(self):
    method compileAndExport (line 1151) | def compileAndExport(self,
    method cycleCount (line 1177) | def cycleCount(self) -> int:
    method compilationTime (line 1200) | def compilationTime(self) -> timedelta:
    method __call__ (line 1223) | def __call__(self, *args: List['torch.Tensor'],
    method _assign_backward_error (line 1308) | def _assign_backward_error(self, input):
    method getPerfCounters (line 1323) | def getPerfCounters(self):
    method _computeLatency (line 1370) | def _computeLatency(self, from_event: str,
    method getHostIpuLatency (line 1430) | def getHostIpuLatency(self):
    method getComputeLatency (line 1443) | def getComputeLatency(self):
    method getIpuHostLatency (line 1456) | def getIpuHostLatency(self):
    method getLatency (line 1469) | def getLatency(self):
    method destroy (line 1482) | def destroy(self) -> None:
    method _narrow_tensor (line 1503) | def _narrow_tensor(self, tensor):
    method isAttachedToDevice (line 1539) | def isAttachedToDevice(self) -> bool:
    method isCompiled (line 1548) | def isCompiled(self) -> bool:
    method detachFromDevice (line 1553) | def detachFromDevice(self) -> None:
    method attachToDevice (line 1571) | def attachToDevice(self) -> None:
  function _registerHook (line 1589) | def _registerHook(hooks, new_hook) -> torch.utils.hooks.RemovableHandle:
  function registerPreCompileHook (line 1595) | def registerPreCompileHook(hook: Callable
  function registerPostCompileHook (line 1611) | def registerPostCompileHook(hook: Callable

FILE: python/_poptorch_data.py
  class PoptorchData (line 9) | class PoptorchData:
    method __init__ (line 19) | def __init__(self,
    method optimizer (line 40) | def optimizer(self):
    method optimizer (line 44) | def optimizer(self, opt):
  function parse (line 52) | def parse(serialized_data: bytes, expected_version: str):

FILE: python/_printing.py
  function module_repr (line 7) | def module_repr(m: torch.nn.Module):
  function print (line 52) | def print(m):

FILE: python/_utils.py
  function deprecated (line 18) | def deprecated(domain, since_version, reason):
  function assert_signatures_match (line 35) | def assert_signatures_match(poptorch_method, reference_method):
  function accessAttributes (line 43) | def accessAttributes(attribute_id_str):
  function isOnIpu (line 68) | def isOnIpu(x):
  function getCustomParser (line 75) | def getCustomParser(custom_type_instance):
  function flattenTensorStructure (line 94) | def flattenTensorStructure(tensors, canonical_structure=None):
  function reconstructTensorStructure (line 120) | def reconstructTensorStructure(structure, values, filter_fn=lambda t: Tr...
  function combine_batch_tensors_gen (line 140) | def combine_batch_tensors_gen(tensors: List[List[torch.Tensor]]
  function combined_batch_generator (line 151) | def combined_batch_generator(dataloader_iterator,
  function getIpuTensorId (line 178) | def getIpuTensorId(x: torch.Tensor):

FILE: python/enums.py
  class MeanReductionStrategy (line 5) | class MeanReductionStrategy(enum.IntEnum):
  class DataLoaderMode (line 26) | class DataLoaderMode(enum.IntEnum):
  class SharingStrategy (line 46) | class SharingStrategy(enum.IntEnum):
  class OutputMode (line 65) | class OutputMode(enum.IntEnum):
  class ConnectionType (line 81) | class ConnectionType(enum.IntEnum):
  class HalfFloatCastingBehavior (line 94) | class HalfFloatCastingBehavior(enum.IntEnum):
  class ReductionType (line 105) | class ReductionType(enum.IntEnum):
  class SyncPattern (line 116) | class SyncPattern(enum.IntEnum):
  class MatMulSerializationMode (line 132) | class MatMulSerializationMode(enum.Enum):
  class Liveness (line 141) | class Liveness(enum.IntEnum):
  class OverlapMode (line 159) | class OverlapMode(enum.Enum):
  class AutoStage (line 175) | class AutoStage(enum.IntEnum):
  class MultiConvPlanType (line 223) | class MultiConvPlanType(enum.IntEnum):
  class CommGroupType (line 234) | class CommGroupType(enum.IntEnum):
  class VariableRetrievalMode (line 263) | class VariableRetrievalMode(enum.IntEnum):

FILE: python/ops.py
  function ctc_beam_search_decoder (line 14) | def ctc_beam_search_decoder(probs: "torch.Tensor",
  function ipu_print_tensor (line 49) | def ipu_print_tensor(tensor: "torch.Tensor",
  function for_loop (line 158) | def for_loop(count: int,
  function cond (line 201) | def cond(condition: 'torch.Tensor',
  function nop (line 274) | def nop(tensor: "torch.Tensor") -> "torch.Tensor":
  function dynamic_slice (line 289) | def dynamic_slice(tensor: "torch.Tensor", dim: int, start: "torch.Tensor",
  function dynamic_update (line 318) | def dynamic_update(input: "torch.Tensor", src: "torch.Tensor", dim: int,
  function recomputationCheckpoint (line 358) | def recomputationCheckpoint(*tensors: List["torch.Tensor"]
  function serializedMatMul (line 388) | def serializedMatMul(lhs: "torch.Tensor",
  function set_available_memory (line 424) | def set_available_memory(tensor: "torch.Tensor",
  function set_overlap_for_input (line 481) | def set_overlap_for_input(input_tensors, mode: "poptorch.OverlapMode"):
  function set_overlap_for_output (line 514) | def set_overlap_for_output(output_tensors, mode: "poptorch.OverlapMode"):
  function _assertIdIsValid (line 547) | def _assertIdIsValid(name, value, expected_type):
  class Block (line 558) | class Block(torch.nn.Module):
    method useAutoId (line 580) | def useAutoId():
    method start (line 599) | def start(user_id: Optional[str] = None, ipu_id: Optional[int] = None):
    method __init__ (line 603) | def __init__(self,
    method __enter__ (line 622) | def __enter__(self):
    method __exit__ (line 625) | def __exit__(self, type, value, traceback):
  class LegacyBeginBlockFn (line 630) | class LegacyBeginBlockFn(torch.nn.Module):
    method __init__ (line 631) | def __init__(self, layer_to_call, user_id=None, ipu_id=None):
    method __call__ (line 637) | def __call__(self, *input, **kwargs):
  class _BlockHook (line 646) | class _BlockHook():
    method __init__ (line 660) | def __init__(self, user_id, ipu_id) -> None:
    method __call__ (line 665) | def __call__(self, module, input):
    method __repr__ (line 671) | def __repr__(self):
  function removeBlocks (line 675) | def removeBlocks(module):
  function BeginBlock (line 689) | def BeginBlock(layer_to_call: torch.nn.Module,
  function BlockFunction (line 746) | def BlockFunction(user_id: Optional[str] = None, ipu_id: Optional[int] =...
  function custom_op (line 787) | def custom_op(inputs: Tuple["torch.Tensor"],
  class CPU (line 896) | class CPU:
    method __init__ (line 919) | def __init__(self, layer_to_call: Callable, ID: str):
    method execute (line 941) | def execute(self):
    method registerPersistentData (line 951) | def registerPersistentData(self):
    method __call__ (line 960) | def __call__(self, *input, **kwargs):
  function identity_loss (line 1014) | def identity_loss(x: "torch.Tensor", reduction: "str") -> "torch.Tensor":
  function fps (line 1051) | def fps(src: "torch.Tensor",
  function nearest (line 1088) | def nearest(x: "torch.Tensor",
  class MultiConv (line 1138) | class MultiConv():
    method __init__ (line 1160) | def __init__(self):
    method _validatePerConvProperty (line 1169) | def _validatePerConvProperty(name, value, expected_scalar_type):
    method availableMemoryProportions (line 1183) | def availableMemoryProportions(self, value: Union[float, List[float]]
    method partialsTypes (line 1202) | def partialsTypes(self, value: Union[torch.dtype, List[torch.dtype]]
    method enableConvDithering (line 1229) | def enableConvDithering(self, value: Union[bool, List[bool]]
    method planType (line 1253) | def planType(self,
    method perConvReservedTiles (line 1270) | def perConvReservedTiles(self, value: int) -> "poptorch.MultiConv":
    method cycleBackOff (line 1280) | def cycleBackOff(self, value: float) -> "poptorch.MultiConv":
    method __enter__ (line 1290) | def __enter__(self):
    method __exit__ (line 1293) | def __exit__(self, type, value, traceback):
  class NameScope (line 1306) | class NameScope:
    method __init__ (line 1315) | def __init__(self, name: str):
    method __enter__ (line 1319) | def __enter__(self):
    method __exit__ (line 1322) | def __exit__(self, type, value, traceback):

FILE: python/optim.py
  class VariableAttributes (line 10) | class VariableAttributes:
    method __init__ (line 20) | def __init__(self, variable_attributes: List[str],
    method isConstant (line 29) | def isConstant(self, attr: str) -> bool:
    method markAsConstant (line 33) | def markAsConstant(self, attr: str) -> None:
    method markAsVariable (line 42) | def markAsVariable(self, attr: str) -> None:
  function _parseArgs (line 50) | def _parseArgs(all_args: Dict[str, Any],
  class Optimizer (line 67) | class Optimizer:
    method __init__ (line 68) | def __init__(self):
    method state_dict (line 78) | def state_dict(self):
    method load_state_dict (line 81) | def load_state_dict(self, state):
    method get_state_dict (line 87) | def get_state_dict(self):
    method set_state_dict (line 92) | def set_state_dict(self, state):
    method has_state (line 103) | def has_state(self):
  class SGD (line 108) | class SGD(Optimizer, torch.optim.SGD):
    method __init__ (line 196) | def __init__(self,
    method __getstate__ (line 290) | def __getstate__(self) -> Dict[str, Any]:
  class Adam (line 308) | class Adam(Optimizer, torch.optim.Adam):
    method __init__ (line 328) | def __init__(
    method __getstate__ (line 403) | def __getstate__(self) -> Dict[str, Any]:
  class AdamW (line 423) | class AdamW(Optimizer, torch.optim.AdamW):
    method __init__ (line 446) | def __init__(
    method __getstate__ (line 524) | def __getstate__(self) -> Dict[str, Any]:
  class RMSprop (line 545) | class RMSprop(Optimizer, torch.optim.RMSprop):
    method __init__ (line 572) | def __init__(
    method __getstate__ (line 646) | def __getstate__(self) -> Dict[str, Any]:
  class LAMB (line 666) | class LAMB(Optimizer, torch.optim.Optimizer):
    method __init__ (line 685) | def __init__(self,
    method step (line 767) | def step(self, closure: Optional[Callable] = None) -> Optional[float]:
    method __getstate__ (line 820) | def __getstate__(self) -> Dict[str, Any]:
  function _check_constructor_match_parent (line 840) | def _check_constructor_match_parent(child_class: Type[torch.optim.Optimi...

FILE: python/options.py
  class Attribute (line 14) | class Attribute():
    method __init__ (line 17) | def __init__(self, **kwargs):
    method __enter__ (line 21) | def __enter__(self):
    method __exit__ (line 31) | def __exit__(self, type, value, traceback):
  class ConfigFileError (line 44) | class ConfigFileError(Exception):
  class _JitOptions (line 48) | class _JitOptions(_options_impl.OptionsDict):
    method traceModel (line 57) | def traceModel(self, trace_model: bool) -> "poptorch.options._JitOptio...
  class _PrecisionOptions (line 71) | class _PrecisionOptions(_options_impl.OptionsDict):
    method __init__ (line 81) | def __init__(self,
    method halfFloatCasting (line 86) | def halfFloatCasting(
    method runningStatisticsAlwaysFloat (line 101) | def runningStatisticsAlwaysFloat(self, value: bool
    method enableFloatingPointExceptions (line 118) | def enableFloatingPointExceptions(
    method enableStochasticRounding (line 142) | def enableStochasticRounding(self, enabled: bool
    method setPartialsType (line 165) | def setPartialsType(self, dtype: torch.dtype
  class _TrainingOptions (line 196) | class _TrainingOptions(_options_impl.OptionsDict):
    method __init__ (line 207) | def __init__(self,
    method gradientAccumulation (line 216) | def gradientAccumulation(self, gradient_accumulation: int
    method _check_reduction_arg (line 269) | def _check_reduction_arg(self, reduction_type, name):
    method accumulationAndReplicationReductionType (line 278) | def accumulationAndReplicationReductionType(
    method setMeanAccumulationAndReplicationReductionStrategy (line 307) | def setMeanAccumulationAndReplicationReductionStrategy(
    method setAutomaticLossScaling (line 336) | def setAutomaticLossScaling(self, enabled: bool
    method setConvolutionDithering (line 359) | def setConvolutionDithering(self, enabled: bool
  class _PopartOptions (line 377) | class _PopartOptions:
    method __init__ (line 395) | def __init__(self) -> None:
    method __deepcopy__ (line 401) | def __deepcopy__(self, memory):
    method checkIsFrozen (line 410) | def checkIsFrozen(self, option=None):
    method set (line 416) | def set(self, key: str, value: Union[int, float, str, List[str], Set[s...
    method setEngineOptions (line 423) | def setEngineOptions(self, engine_options: Dict[str, str]
    method setPatterns (line 428) | def setPatterns(self, patterns: Dict[str, bool],
    method __repr__ (line 443) | def __repr__(self):
  class _DistributedOptions (line 449) | class _DistributedOptions(_options_impl.OptionsDict):
    method __init__ (line 461) | def __init__(self) -> None:
    method disable (line 468) | def disable(self) -> "poptorch.options._DistributedOptions":
    method setEnvVarNames (line 475) | def setEnvVarNames(self, var_num_processes: str, var_process_id: str
    method configureProcessId (line 492) | def configureProcessId(self, process_id: int, num_processes: int
    method processId (line 505) | def processId(self) -> int:
    method numProcesses (line 510) | def numProcesses(self) -> int:
  class TensorLocationSettings (line 515) | class TensorLocationSettings(_options_impl.OptionsDict):
    method minElementsForOffChip (line 523) | def minElementsForOffChip(self, min_elements: int
    method minElementsForReplicatedTensorSharding (line 531) | def minElementsForReplicatedTensorSharding(
    method useOnChipStorage (line 539) | def useOnChipStorage(self, use: bool = True
    method useReplicatedTensorSharding (line 555) | def useReplicatedTensorSharding(self, use: bool = True
    method useIOTilesToLoad (line 565) | def useIOTilesToLoad(self, use: bool = True
    method useIOTilesToStore (line 576) | def useIOTilesToStore(self, use: bool = True
  class _TensorLocationOptions (line 590) | class _TensorLocationOptions(_options_impl.OptionsDict):
    method numIOTiles (line 600) | def numIOTiles(self, num_tiles: int) -> "poptorch.TensorLocationSettin...
    method setActivationLocation (line 627) | def setActivationLocation(self, location: "poptorch.TensorLocationSett...
    method setWeightLocation (line 637) | def setWeightLocation(self, location: "poptorch.TensorLocationSettings"
    method setOptimizerLocation (line 647) | def setOptimizerLocation(self, location: "poptorch.TensorLocationSetti...
    method setAccumulatorLocation (line 657) | def setAccumulatorLocation(self,
  class Stage (line 672) | class Stage:
    method __init__ (line 683) | def __init__(self, *block_ids: BlockId) -> None:
    method blocks (line 693) | def blocks(self) -> List[BlockId]:
    method ipu (line 697) | def ipu(self, ipu: int) -> "poptorch.Stage":
    method _setStage (line 703) | def _setStage(self, stage: int) -> "poptorch.Stage":
  class _DefaultStageManager (line 709) | class _DefaultStageManager(_options_impl.IStageManager):
    method __init__ (line 710) | def __init__(self, auto_stage: "poptorch.AutoStage") -> None:
    method getStage (line 716) | def getStage(self, block_id: BlockId) -> "poptorch.Stage":
  class _IExecutionStrategy (line 733) | class _IExecutionStrategy:
    method __init__ (line 734) | def __init__(self, stages_manager, block_map):
    method stage (line 738) | def stage(self, block_id):
    method onStartTracing (line 746) | def onStartTracing(self):
    method onEndTracing (line 750) | def onEndTracing(self):
    method backendOptions (line 754) | def backendOptions(self):
  class Phase (line 758) | class Phase:
    method __init__ (line 761) | def __init__(self, *arg: Union[BlockId, "poptorch.Stage"]):
    method stage (line 791) | def stage(self, idx):
    method ipus (line 794) | def ipus(self, *ipus):
  class PipelinedExecution (line 806) | class PipelinedExecution(_IExecutionStrategy):
    method __init__ (line 807) | def __init__(self, *args):
    method backendOptions (line 920) | def backendOptions(self):
  class ShardedExecution (line 924) | class ShardedExecution(PipelinedExecution):
    method backendOptions (line 945) | def backendOptions(self):
  class _IPhasedExecution (line 949) | class _IPhasedExecution(_IExecutionStrategy):
    method __init__ (line 952) | def __init__(self, *phases: Union["poptorch.Phase", List["poptorch.Sta...
    method phase (line 1012) | def phase(self, phase: int) -> "poptorch.Phase":
    method useSeparateBackwardPhase (line 1022) | def useSeparateBackwardPhase(self, use: bool = True):
    method backendOptions (line 1047) | def backendOptions(self) -> Dict[str, Union[int, bool]]:
  class ParallelPhasedExecution (line 1055) | class ParallelPhasedExecution(_IPhasedExecution):
    method backendOptions (line 1088) | def backendOptions(self) -> Dict[str, Union[int, bool]]:
    method sendTensorsOffChipAfterFwd (line 1091) | def sendTensorsOffChipAfterFwd(self, off_chip: bool = True
  class SerialPhasedExecution (line 1101) | class SerialPhasedExecution(_IPhasedExecution):
    method setTensorsLiveness (line 1133) | def setTensorsLiveness(self, liveness: "poptorch.Liveness"
    method backendOptions (line 1141) | def backendOptions(self) -> Dict[str, Union[int, bool]]:
  class Options (line 1146) | class Options(_options_impl.OptionsDict):
    method __init__ (line 1162) | def __init__(self) -> None:
    method from_json (line 1200) | def from_json(self, string: str):
    method sourceLocationExcludes (line 1240) | def sourceLocationExcludes(self,
    method appendToLocationExcludes (line 1255) | def appendToLocationExcludes(self, *excludes: str) -> "poptorch.Options":
    method showCompilationProgressBar (line 1268) | def showCompilationProgressBar(self,
    method loadFromFile (line 1276) | def loadFromFile(self, filepath: str) -> "poptorch.Options":
    method relaxOptimizerAttributesChecks (line 1316) | def relaxOptimizerAttributesChecks(self, relax: bool = True
    method TensorLocations (line 1337) | def TensorLocations(self) -> "poptorch.options._TensorLocationOptions":
    method Distributed (line 1344) | def Distributed(self) -> "poptorch.options._DistributedOptions":
    method Jit (line 1354) | def Jit(self) -> "poptorch.options._JitOptions":
    method Precision (line 1361) | def Precision(self) -> "poptorch.options._PrecisionOptions":
    method Training (line 1369) | def Training(self) -> "poptorch.options._TrainingOptions":
    method _Popart (line 1376) | def _Popart(self) -> "poptorch.options._PopartOptions":
    method autoRoundNumIPUs (line 1381) | def autoRoundNumIPUs(self, auto_round_num_ipus: bool = True
    method deviceIterations (line 1396) | def deviceIterations(self, device_iterations: int) -> "poptorch.Options":
    method setExecutionStrategy (line 1408) | def setExecutionStrategy(
    method setAvailableMemoryProportion (line 1426) | def setAvailableMemoryProportion(
    method replicationFactor (line 1459) | def replicationFactor(self, replication_factor: int) -> "poptorch.Opti...
    method inputReplicaGrouping (line 1474) | def inputReplicaGrouping(self, input_group_size: int,
    method broadcastBuffers (line 1508) | def broadcastBuffers(self, broadcast_buffers: bool = True):
    method logDir (line 1518) | def logDir(self, log_dir: str) -> "poptorch.Options":
    method maxRepeatLogs (line 1528) | def maxRepeatLogs(self, max_lines: Optional[int]) -> "poptorch.Options":
    method modelName (line 1541) | def modelName(self, name: str) -> "poptorch.Options":
    method enableExecutableCaching (line 1552) | def enableExecutableCaching(self, path: str) -> "poptorch.Options":
    method useIpuModel (line 1567) | def useIpuModel(self, use_model: bool) -> "poptorch.Options":
    method connectionType (line 1584) | def connectionType(self, connection_type: "poptorch.ConnectionType"
    method syncPattern (line 1605) | def syncPattern(self, sync_pattern: "poptorch.SyncPattern"
    method useIpuId (line 1633) | def useIpuId(self, ipu_id: int) -> "poptorch.Options":
    method useOfflineIpuTarget (line 1656) | def useOfflineIpuTarget(self, ipu_version: int = 2) -> "poptorch.Optio...
    method anchorTensor (line 1669) | def anchorTensor(self,
    method outputMode (line 1692) | def outputMode(self,
    method defaultOutputMode (line 1730) | def defaultOutputMode(self) -> bool:
    method randomSeed (line 1740) | def randomSeed(self, random_seed: int) -> "poptorch.Options":
    method enableStableNorm (line 1751) | def enableStableNorm(self, enabled: bool) -> "poptorch.Options":
    method enableSyntheticData (line 1763) | def enableSyntheticData(self, enabled: bool) -> "poptorch.Options":
    method logCycleCount (line 1781) | def logCycleCount(self, log_cycle_count: bool) -> "poptorch.Options":
    method enableProfiling (line 1797) | def enableProfiling(self, profile_dir: Optional[str] = None
    method disableModuleNamescope (line 1842) | def disableModuleNamescope(self) -> "poptorch.Options":
    method updatableNamedBuffers (line 1863) | def updatableNamedBuffers(self, buffers: List[str]) -> "poptorch.Optio...
    method toDict (line 1871) | def toDict(self) -> Dict[str, Any]:
    method clone (line 1895) | def clone(self) -> "poptorch.Options":
    method __repr__ (line 1900) | def __repr__(self):

FILE: python/poptorch.cpp
  type jit (line 54) | namespace jit {
    function TypePtr (line 58) | TypePtr inferType(py::handle input) {
    function Stack (line 133) | Stack toTraceableStack(const py::tuple &inputs) {
  class CallOnExit (line 139) | class CallOnExit : Func {
    method CallOnExit (line 141) | explicit CallOnExit(Func f) : Func(std::move(f)) {}
  function alreadyRegistered (line 148) | bool alreadyRegistered(const std::string &ID) {
  function registerBuffersWithCallback (line 152) | void registerBuffersWithCallback(
  function registerCPUCallBack (line 177) | void registerCPUCallBack(const py::object &obj, const std::string &ID) {
  function initCallbackBuffers (line 204) | void initCallbackBuffers() {
  class PybindValue (line 210) | class PybindValue : public IPyValue {
    method PybindValue (line 214) | explicit PybindValue(T obj) {
    method PybindValue (line 221) | explicit PybindValue(T handle) : _value(handle) {}
    method toFunction (line 223) | std::function<void(int, int)> toFunction() const override {
    method isBoolean (line 231) | bool isBoolean() const override { return py::isinstance<py::bool_>(_va...
    method toBoolean (line 233) | bool toBoolean() const override { return _value.cast<bool>(); }
    method isDouble (line 235) | bool isDouble() const override {
    method toDouble (line 241) | double toDouble() const override { return _value.cast<double>(); }
    method isInt (line 243) | bool isInt() const override { return py::isinstance<py::int_>(_value); }
    method toUInt64 (line 245) | std::uint64_t toUInt64() const override {
    method toInt64 (line 249) | std::int64_t toInt64() const override { return _value.cast<std::int64_...
    method isString (line 251) | bool isString() const override { return py::isinstance<py::str>(_value...
    method toString (line 253) | std::string toString() const override {
    method isSetListOrTuple (line 264) | bool isSetListOrTuple() const override {
    method forEachInList (line 270) | void forEachInList(std::function<void(const IPyValue &)> fn) const ove...
    method isDict (line 276) | bool isDict() const override { return py::isinstance<py::dict>(_value); }
    method forEachInDict (line 278) | void forEachInDict(std::function<void(const IPyValue &, const IPyValue...
    method getFromDict (line 285) | std::unique_ptr<IPyValue> getFromDict(const std::string &key) const ov...
    method getListSize (line 292) | std::uint64_t getListSize() const override {
    method getFromList (line 295) | std::unique_ptr<IPyValue>
    method type (line 304) | std::string type() const override { return py::str(_value.get_type()); }
  function T (line 315) | T getOptimizerValue(const py::dict &d, const std::string &key) {
  function getOptimizerValue (line 323) | void getOptimizerValue(T &value, const py::dict &d, const std::string &k...
  function copyParametersDict (line 327) | void copyParametersDict(popart_compiler::Optimizer *out, const py::dict ...
  function parseOptimizers (line 351) | std::vector<popart_compiler::Optimizer> parseOptimizers(const py::dict &...
  function getParameterBuffers (line 420) | std::map<std::string, void *>
  function remapTensors (line 440) | std::vector<at::Tensor>
  function getParameterNames (line 476) | std::vector<std::string>
  function AnchorList (line 505) | AnchorList parseAnchors(const py::list &list) {
  function parseSessionOptionsVoid (line 516) | void parseSessionOptionsVoid(const py::dict &opts) {
  function buildTensorList (line 520) | void buildTensorList(const torch::jit::IValue &value,
  function identifyZeroSizedTensors (line 548) | void identifyZeroSizedTensors(const std::vector<at::Tensor> &tensors) {
  function lowerToPopartFromDispatch (line 564) | poptorch::LowerToPopart
  function mapParamsToNames (line 589) | void mapParamsToNames(const pybind11::tuple &names,
  function setPerReplica (line 600) | void setPerReplica(const std::string &param_name, py::handle tensor,
  function convertToString (line 608) | std::string convertToString(const std::vector<char> &str) {
  function convertToCharVec (line 612) | std::vector<char> convertToCharVec(const std::string &str) {
  function toPythonList (line 616) | pybind11::list toPythonList(std::vector<at::Tensor> &&outputs) {
  class Error (line 624) | class Error : public py::object {
    method Error (line 626) | Error() = default;
    method Error (line 627) | Error(handle scope, const char *name, handle base = PyExc_Exception) {
    method setWhat (line 642) | void setWhat(const std::string &message) { _what = message; }
    method setErrorIndicator (line 646) | void setErrorIndicator() { PyErr_SetString(m_ptr, _what.c_str()); }
    method setMessage (line 648) | void setMessage(const std::string &message) {
    method setType (line 653) | void setType(const std::string &type) {
    method setLocation (line 657) | void setLocation(const std::string &location) {
  class RecoverableError (line 666) | class RecoverableError : public Error {
    method setRecoveryAction (line 670) | void setRecoveryAction(const std::string &recoveryAction) {
  type PoptorchError (line 692) | struct PoptorchError : public torch::PyTorchError {
    method PoptorchError (line 694) | explicit PoptorchError(const PoptorchErrorInfo &info)
    method PyObject (line 696) | PyObject *python_type() override { return setupPyError(false); }
    method setErrorIndicator (line 697) | void setErrorIndicator() const { setupPyError(true); }
  function PyObject (line 706) | PyObject *PoptorchError::setupPyError(bool set_indicator) const {
  function doThrowPoptorchError (line 739) | void doThrowPoptorchError(const PoptorchErrorInfo &info) {
  type bindings (line 744) | namespace bindings {
    function initialiseExceptionHandling (line 746) | void initialiseExceptionHandling(pybind11::handle m) {
    function copyWeightsToHostImpl (line 755) | void copyWeightsToHostImpl(
    function copyWeightsToDeviceImpl (line 772) | void copyWeightsToDeviceImpl(
    function copyNamedBuffersToDeviceImpl (line 789) | void copyNamedBuffersToDeviceImpl(
    function getPopartIR (line 806) | std::string
    function getTensorNames (line 812) | py::set
    function detachFromDevice (line 818) | void detachFromDevice(
    function attachToDevice (line 825) | void attachToDevice(
    function isAttachedToDevice (line 832) | bool isAttachedToDevice(
    function setLogLevel (line 838) | void setLogLevel(std::uint64_t level) {
    function loadEngineAndConnectStreams (line 844) | void loadEngineAndConnectStreams(
    function updateOptimizers (line 851) | void updateOptimizers(
    function execute (line 863) | std::vector<pybind11::object>
    function setRngState (line 934) | void setRngState(std::shared_ptr<poptorch::PoplarExecutable> &executable,
    function getRandomSeed (line 943) | std::uint64_t
    function getRngState (line 951) | std::vector<std::uint32_t>
    function readOptimizerState (line 959) | py::dict readOptimizerState(
    function writeOptimizerState (line 992) | void writeOptimizerState(
    function getTimestamps (line 1037) | std::vector<pybind11::object>
    function pyIsGraphNondeterministic (line 1065) | bool pyIsGraphNondeterministic(py::handle h) {
    function saveExecutableToFile (line 1077) | void saveExecutableToFile(
    function appendPoptorchMetadataToFile (line 1084) | void appendPoptorchMetadataToFile(const std::string &serialized_poptor...
    function cycleCount (line 1092) | uint64_t
    function importPoptorchMetadataFromFile (line 1098) | py::bytes importPoptorchMetadataFromFile(const std::string &import_fil...
    function processDispatchAndImportExecutable (line 1106) | std::shared_ptr<poptorch::PoplarExecutable> processDispatchAndImportEx...
    function compileWithManualTracing (line 1114) | std::shared_ptr<poptorch::PoplarExecutable> compileWithManualTracing(
    function setPopartLogLevelUInt (line 1125) | void setPopartLogLevelUInt(std::uint64_t level) {
  function PYBIND11_MODULE (line 1135) | PYBIND11_MODULE(poptorch_core, m) { // NOLINT

FILE: python/profiling.py
  class Channel (line 18) | class Channel:
    method __init__ (line 32) | def __init__(self, name):
    method instrument (line 37) | def instrument(self, obj, *methods):
    method tracepoint (line 47) | def tracepoint(self, name):
  class _DummyTracepoint (line 61) | class _DummyTracepoint:
    method __enter__ (line 64) | def __enter__(self):
    method __exit__ (line 67) | def __exit__(self, type, value, traceback):
  class _Channels (line 71) | class _Channels:
    method getOrCreate (line 76) | def getOrCreate(name):

FILE: python/testing.py
  function allclose (line 7) | def allclose(ref, other):

FILE: scripts/PopAtenHandlers.py
  function celu_handler (line 81) | def celu_handler(x, a):
  function hardshrink_handler (line 86) | def hardshrink_handler(x, l):
  function softshrink_handler (line 90) | def softshrink_handler(x, l):
  function hinge_embedding_loss_handler (line 123) | def hinge_embedding_loss_handler(x, y, delta, red):
  function l1_loss_handler (line 130) | def l1_loss_handler(x, y, red):
  function margin_ranking_loss_handler (line 136) | def margin_ranking_loss_handler(x1, x2, y, margin, red):
  function mse_loss_handler (line 142) | def mse_loss_handler(x, y, red):
  function smooth_l1_loss_handler (line 148) | def smooth_l1_loss_handler(x, y, red, beta):
  function soft_margin_loss_handler (line 156) | def soft_margin_loss_handler(x, y, red):

FILE: scripts/PopParse.py
  class OptionType (line 71) | class OptionType(enum.IntEnum):
  function parse_session_options (line 82) | def parse_session_options(root_node):  # pylint: disable=too-many-statem...
  function clean (line 491) | def clean(cxxType):
  function toType (line 496) | def toType(cxxType):
  function convertCxxConvert (line 528) | def convertCxxConvert(cxxType_orig):
  function attrTypeGetter (line 562) | def attrTypeGetter(ty):
  function addCastingOptStr (line 577) | def addCastingOptStr(name):
  function addOutputTypeStr (line 591) | def addOutputTypeStr(name):  # pylint: disable=too-many-return-statements

FILE: scripts/apply_linters.py
  class OutputProcessor (line 33) | class OutputProcessor:
    method __call__ (line 34) | def __call__(self, raw_output: str, returncode: int) -> Tuple[str, int]:
  class SaveOutput (line 38) | class SaveOutput(OutputProcessor):
    method __init__ (line 39) | def __init__(self):
    method __call__ (line 42) | def __call__(self, raw_output: str, returncode: int) -> Tuple[str, int]:
  class GitStrategy (line 47) | class GitStrategy(enum.Enum):
  class ILinterFamily (line 57) | class ILinterFamily:
    method __init__ (line 61) | def __init__(self, supported_extensions, linters,
    method gen_lint_commands (line 80) | def gen_lint_commands(self, filename, autofix):
  class CppLinters (line 108) | class CppLinters(ILinterFamily):
    method __init__ (line 109) | def __init__(self):
  class PyLinters (line 115) | class PyLinters(ILinterFamily):
    method __init__ (line 116) | def __init__(self):
    method is_enabled (line 119) | def is_enabled(self, filename, autofix):  # pylint: disable=unused-arg...
  class ILinter (line 124) | class ILinter:
    method gen_lint_command (line 127) | def gen_lint_command(self, filename, autofix):
    method check_version (line 131) | def check_version(self):
    method is_enabled (line 135) | def is_enabled(self, filename, autofix):  # pylint: disable=unused-arg...
  class ProcessManager (line 140) | class ProcessManager:
    method create (line 144) | def create(max_num_proc=0):
    method get (line 149) | def get():
    method __init__ (line 154) | def __init__(self, max_num_proc):
    method enqueue (line 160) | def enqueue(self, create_proc_fn):
    method update (line 168) | def update(self):
  class Command (line 191) | class Command:
    method __init__ (line 194) | def __init__(self,
    method start (line 211) | def start(self):
    method _create_proc (line 214) | def _create_proc(self):
    method is_running (line 234) | def is_running(self):
    method wait (line 237) | def wait(self):
    method run (line 256) | def run(self):
  class CondaCommand (line 261) | class CondaCommand(Command):
    method __init__ (line 265) | def __init__(self, *cmd, name=None, **kwargs):
  class ClangTools (line 277) | class ClangTools:
    method path (line 281) | def path():
    method clang_format (line 285) | def clang_format():
    method clang_tidy (line 289) | def clang_tidy():
    method clang_apply_replacements (line 293) | def clang_apply_replacements():
  function get_conda_activate_cmd (line 297) | def get_conda_activate_cmd():
  function offset_to_line (line 317) | def offset_to_line(filename, offsets):
  class DiffCreator (line 342) | class DiffCreator:
    method __init__ (line 352) | def __init__(self, filename, linter, autofix):
    method __call__ (line 359) | def __call__(self, output, errcode):
  class VersionParseCommandBase (line 385) | class VersionParseCommandBase(CondaCommand):
    method __init__ (line 386) | def __init__(self, *cmd, **kwargs):
    method _parse_version (line 390) | def _parse_version(self, output, return_code):
    method run_and_compare_versions (line 393) | def run_and_compare_versions(self, expected):
  class VersionJSONParseCommand (line 404) | class VersionJSONParseCommand(VersionParseCommandBase):
    method __init__ (line 405) | def __init__(self, command_name):
    method _parse_version (line 412) | def _parse_version(self, output, return_code):
  class VersionParseCommand (line 420) | class VersionParseCommand(VersionParseCommandBase):
    method __init__ (line 421) | def __init__(self, version_re_prefix, command_name):
    method _parse_version (line 429) | def _parse_version(self, output, return_code):
  function compare_versions_from_conda (line 443) | def compare_versions_from_conda(command_name, expected):
  function compare_versions_from_output (line 448) | def compare_versions_from_output(command_name,
  class ClangFormat (line 458) | class ClangFormat(ILinter):
    method gen_lint_command (line 459) | def gen_lint_command(self, filename, autofix):
    method check_version (line 473) | def check_version(self):
  class ClangTidy (line 478) | class ClangTidy(ILinter):
    class ResultsProcessor (line 479) | class ResultsProcessor(OutputProcessor):
      method __init__ (line 484) | def __init__(self, num_jobs, autofix):
      method __call__ (line 490) | def __call__(self, raw_output, returncode):
    method __init__ (line 552) | def __init__(self):
    method get_compile_commands_flags (line 557) | def get_compile_commands_flags(self, filename):
    method gen_lint_command (line 603) | def gen_lint_command(self, filename, autofix):
    method process_compile_commands (line 636) | def process_compile_commands(self, commands):
    method check_version (line 659) | def check_version(self):
    method is_enabled (line 745) | def is_enabled(self, filename, autofix):
  class Pylint (line 752) | class Pylint(ILinter):
    method pylint (line 753) | def pylint(self):
    method gen_lint_command (line 756) | def gen_lint_command(self, filename, autofix):
    method check_version (line 762) | def check_version(self):
    method is_enabled (line 765) | def is_enabled(self, filename, autofix):  # pylint: disable=unused-arg...
  class Yapf (line 770) | class Yapf(ILinter):
    method yapf (line 771) | def yapf(self):
    method gen_lint_command (line 774) | def gen_lint_command(self, filename, autofix):
    method check_version (line 788) | def check_version(self):
  class Executor (line 792) | class Executor:
    method __init__ (line 793) | def __init__(self, filename, cmd):
    method _next_step (line 799) | def _next_step(self):
    method update (line 803) | def update(self):
    method execution_complete (line 817) | def execution_complete(self):
  class Linters (line 821) | class Linters:
    method __init__ (line 824) | def __init__(self):
    method _get_git_files (line 827) | def _get_git_files(self, strategy):
    method lint_git (line 863) | def lint_git(self, strategy, autofix, add_trailer_on_success):
    method _read_head_trailer (line 867) | def _read_head_trailer(self):
    method _unstaged_diff (line 875) | def _unstaged_diff(self, files):
    method _compute_git_trailer (line 883) | def _compute_git_trailer(self, files):
    method check_git_trailer (line 891) | def check_git_trailer(self, strategy):
    method _check_trailer (line 895) | def _check_trailer(self, files, add_if_missing):
    method lint_files (line 921) | def lint_files(self, files, autofix, add_trailer_on_success):
    method _gen_lint_commands (line 972) | def _gen_lint_commands(self, filename, autofix):
  function main (line 979) | def main():

FILE: scripts/check_spelling.py
  function getChar (line 33) | def getChar():
  class DocStr (line 45) | class DocStr():
    method __init__ (line 46) | def __init__(self, doc_str, source_file, line_num):
    method doc_str (line 52) | def doc_str(self):
    method line_num (line 56) | def line_num(self):
    method source_file (line 60) | def source_file(self):
    method __str__ (line 63) | def __str__(self):
  function start_hunspell_process (line 68) | def start_hunspell_process():
  function strip_code_blocks (line 105) | def strip_code_blocks(s):
  function should_skip (line 116) | def should_skip(line):
  function remove_exclusions (line 132) | def remove_exclusions(line):
  function get_doc_str_line_number (line 141) | def get_doc_str_line_number(element):
  function recursive_add_doc_str (line 157) | def recursive_add_doc_str(source_file, element, doc_str_list):
  function print_context (line 178) | def print_context(doc_str, line_offset, unknown_spelling):
  function process_incorrect_word (line 208) | def process_incorrect_word(hunspell, result, doc_str, line_offset):
  function process_doc_str (line 250) | def process_doc_str(hunspell, doc_str):
  function check_source_file (line 281) | def check_source_file(source_dir, source_file):

FILE: scripts/create_buildenv.py
  class Version (line 26) | class Version:
    method __init__ (line 27) | def __init__(self, version_str):
    method __lt__ (line 30) | def __lt__(self, other):
    method __eq__ (line 33) | def __eq__(self, other):
    method __hash__ (line 36) | def __hash__(self):
    method __str__ (line 39) | def __str__(self):
    method __repr__ (line 42) | def __repr__(self):
  function _default_cache_dir (line 46) | def _default_cache_dir():
  function _system_conda_path (line 51) | def _system_conda_path():
  class Installer (line 64) | class Installer:
    method install (line 67) | def install(self, env):
    method hashString (line 70) | def hashString(self):
  class CondaPackages (line 75) | class CondaPackages(Installer):
    method __init__ (line 78) | def __init__(self, *packages):
  class CondaChannels (line 83) | class CondaChannels(Installer):
    method __init__ (line 86) | def __init__(self, *channels):
  class PipPackages (line 91) | class PipPackages(Installer):
    method __init__ (line 94) | def __init__(self, *packages):
    method install (line 98) | def install(self, env):
    method hashString (line 101) | def hashString(self):
  class PipRequirements (line 105) | class PipRequirements(Installer):
    method __init__ (line 108) | def __init__(self, filename="requirements.txt"):
    method install (line 113) | def install(self, env):
    method hashString (line 117) | def hashString(self):
  class Installers (line 122) | class Installers:
    method __init__ (line 125) | def __init__(self):
    method add (line 128) | def add(self, installer):
    method __call__ (line 134) | def __call__(self):
  class Config (line 138) | class Config:
    method __init__ (line 141) | def __init__(self, install_linters, **opts):
    method setDefault (line 145) | def setDefault(self, **opts):
  class Environment (line 151) | class Environment:
    method __init__ (line 152) | def __init__(self, buildenv_dir, activate_filename):
    method prefix (line 157) | def prefix(self):
    method run_commands (line 160) | def run_commands(self,
    method rmdir_if_exists (line 173) | def rmdir_if_exists(self, path):
  class BuildenvManager (line 177) | class BuildenvManager:
    method __init__ (line 178) | def __init__(self,
    method add_project (line 237) | def add_project(self, project, project_dir):
    method _collect_installers (line 241) | def _collect_installers(self):
    method create (line 320) | def create(self, create_template_if_needed=False):
    method _create_new_env (line 380) | def _create_new_env(self, installers, is_retry=False):
    method _clear_activate_buildenv (line 429) | def _clear_activate_buildenv(self):
    method _append_to_activate_buildenv (line 475) | def _append_to_activate_buildenv(self, *lines):
    method cache_lock (line 481) | def cache_lock(self):
    method _install_conda_if_needed (line 498) | def _install_conda_if_needed(self, force_reinstall=False):
    method _compute_environment_hash (line 550) | def _compute_environment_hash(self, installers):

FILE: scripts/docs_build.py
  class DocumentationBuilder (line 18) | class DocumentationBuilder:
    method __init__ (line 19) | def __init__(self, pkg_info, install_dir=None, poptorch_geometric=False):
    method assert_poptorch_in_path (line 51) | def assert_poptorch_in_path(self):
    method cleanup (line 62) | def cleanup(self):
    method build_html (line 67) | def build_html(self):
    method package_html (line 79) | def package_html(self):
    method build_pdf (line 101) | def build_pdf(self):

FILE: scripts/generate_poppyg_package.py
  function find_requirement (line 40) | def find_requirement(package):
  function get_pyg_hosted_dependency (line 49) | def get_pyg_hosted_dependency(pkg_name):
  function configure (line 78) | def configure(src_filename, dst_filename):

FILE: scripts/generate_python_package.py
  function get_version_from_requirements (line 42) | def get_version_from_requirements(package):
  function get_torch_dependency (line 52) | def get_torch_dependency(package, version):
  function get_poptorch_version (line 64) | def get_poptorch_version():
  class ExtOnly (line 94) | class ExtOnly:
    method __init__ (line 95) | def __init__(self, *ext):
    method _is_ignored (line 98) | def _is_ignored(self, file):
    method __call__ (line 101) | def __call__(self, adir, filenames):
  function configure (line 114) | def configure(src_filename, dst_filename):

FILE: scripts/popgen/__init__.py
  class PtrOrRef (line 10) | class PtrOrRef(enum.Enum):
  class Value (line 17) | class Value:
    method __init__ (line 18) | def __init__(self, op, args, const=False, ptr_or_ref=None):
    method __add__ (line 40) | def __add__(self, other):
    method __ge__ (line 43) | def __ge__(self, other):
    method __gt__ (line 46) | def __gt__(self, other):
    method __le__ (line 49) | def __le__(self, other):
    method __lt__ (line 52) | def __lt__(self, other):
    method __mul__ (line 55) | def __mul__(self, other):
    method __ne__ (line 58) | def __ne__(self, other):
    method __neg__ (line 61) | def __neg__(self):
    method __sub__ (line 64) | def __sub__(self, other):
    method __truediv__ (line 67) | def __truediv__(self, other):
    method __radd__ (line 70) | def __radd__(self, other):
    method __rmul__ (line 73) | def __rmul__(self, other):
    method __rsub__ (line 76) | def __rsub__(self, other):
    method __rtruediv__ (line 79) | def __rtruediv__(self, other):
    method equal (line 82) | def equal(self, other):
    method set_graph_arity (line 85) | def set_graph_arity(self, arity):
    method annotate (line 88) | def annotate(self, annot):
    method emit (line 101) | def emit(self, values, val_id, tabs, f=sys.stdout, root=False):
    method emit_arguments (line 151) | def emit_arguments(self, values, val_id, tabs, f):
    method emit_annotations (line 162) | def emit_annotations(self, tabs, f):
    method emit_assign_return (line 175) | def emit_assign_return(self,
    method emit_call (line 214) | def emit_call(self, fname, args, suffix, f):
    method vn (line 227) | def vn(self):
    method same (line 233) | def same(self, other):
    method render (line 239) | def render(self):
  class ConstantFloat (line 255) | class ConstantFloat(Value):
    method __init__ (line 256) | def __init__(self, val):
    method emit (line 260) | def emit(self, values, val_id, tabs, f=sys.stdout, root=False):
    method vn (line 292) | def vn(self):
    method same (line 295) | def same(self, other):
    method render (line 298) | def render(self):
  class NonTensorValue (line 308) | class NonTensorValue(Value):
    method __init__ (line 309) | def __init__(self, op, args):

FILE: scripts/popgen/api.py
  function convert (line 15) | def convert(aten, arity, popop=None, swizzles=None):
  function expand (line 38) | def expand(aten, fn):
  function forward (line 49) | def forward(source, dest):
  function generate (line 63) | def generate(script, namespace, filename, global_symbols=globals()):
  function simplify (line 76) | def simplify(name, fn):

FILE: scripts/popgen/generator.py
  function emit_handlers (line 18) | def emit_handlers(namespace, aten, handlers, f=sys.stdout):
  function generate (line 87) | def generate(script, namespace, filename, global_symbols):
  function get_op_name (line 141) | def get_op_name(aten):
  function snake_to_camel_case (line 146) | def snake_to_camel_case(snake_case):
  function get_camel_case_op_name (line 151) | def get_camel_case_op_name(aten):

FILE: scripts/popgen/helpers.py
  function alpha (line 11) | def alpha(m, a):
  function as_ir (line 20) | def as_ir(v):
  function cint (line 32) | def cint(n):
  function clong (line 41) | def clong(n):
  function clong_list (line 50) | def clong_list(l):
  function cfloat (line 61) | def cfloat(f):
  function cstr (line 70) | def cstr(s):
  function dimension (line 80) | def dimension(v, t):
  function dimension_list (line 91) | def dimension_list(t, a=None):
  function empty_initializer (line 100) | def empty_initializer():
  function output_shape (line 109) | def output_shape(idx=0):
  function output_type (line 118) | def output_type(idx=0):
  function reduction (line 127) | def reduction(r):
  function tensor_list (line 136) | def tensor_list(l):
  function tensor_long (line 145) | def tensor_long(t):
  function tensor_shape (line 155) | def tensor_shape(t):
  function tensor_type (line 164) | def tensor_type(t):
  function scalar_type (line 173) | def scalar_type(t):

FILE: scripts/popgen/onnx.py
  function find_popart_includes (line 25) | def find_popart_includes():
  function find_poplar_includes (line 48) | def find_poplar_includes():
  function init (line 78) | def init(popart_path=None, poplar_path=None, clang_path=None, debug=False):
  function find_functions (line 126) | def find_functions(jsonOutput, node, namespace=""):
  function parse (line 179) | def parse():
  function parse_signatures (line 225) | def parse_signatures():

FILE: scripts/popgen/operatorfactory.py
  function no_tensor_braces (line 11) | def no_tensor_braces(v):
  function check_operator_signature (line 22) | def check_operator_signature(value, signatures):
  class OperatorFactory (line 66) | class OperatorFactory:
    method __getattr__ (line 67) | def __getattr__(self, name):
    method cast (line 78) | def cast(self, t, ty):
    method internalCast (line 83) | def internalCast(self, t, ty):
    method constantPad (line 88) | def constantPad(self, x, l, c):
    method edgePad (line 93) | def edgePad(self, t, l):
    method printIpuTensor (line 98) | def printIpuTensor(self, t, s):
    method callCpuOp (line 103) | def callCpuOp(self, t, s, n):
    method transpose (line 108) | def transpose(self, t):
    method randomNormal (line 113) | def randomNormal(self, x, shape, high, low, scalar_type=None):
    method randomUniform (line 122) | def randomUniform(self, x, shape, high, low, scalar_type=None):
    method recomputationCheckpoint (line 131) | def recomputationCheckpoint(self, x):
    method reflectionPad (line 136) | def reflectionPad(self, t, l):
    method setAvailableMemory (line 141) | def setAvailableMemory(self, x, y):
    method setMatMulSerialization (line 146) | def setMatMulSerialization(self, x, s, a, b):
    method startForLoop (line 151) | def startForLoop(self, inputs):
    method endForLoop (line 156) | def endForLoop(self, output, inputs, trip_count):
    method startIfBlock (line 162) | def startIfBlock(self, condition):
    method startElseBlock (line 166) | def startElseBlock(self, outputs_then):
    method endIfBlock (line 170) | def endIfBlock(self, outputs_else, condition):
    method passThrough (line 176) | def passThrough(self):

FILE: scripts/popgen/registry.py
  function add_handler (line 23) | def add_handler(aten, value, arity):
  function add_implicit_handlers (line 35) | def add_implicit_handlers(global_symbols):
  function clear (line 51) | def clear(clear_complex_ops=False):
  function expand (line 64) | def expand(aten, fn):

FILE: scripts/po
Condensed preview — 537 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (3,759K chars).
[
  {
    "path": ".ci/view_component_trigger/Jenkinsfile",
    "chars": 134,
    "preview": "@Library('sw-jenkins-library@view-component-trigger') _\n\nviewComponentTrigger(jobsFilepath: '.ci/view_component_trigger/"
  },
  {
    "path": ".ci/view_component_trigger/jobs.groovy",
    "chars": 150,
    "preview": "[\n    [\n         job: '/poptorch/poptorch_pr',\n         parameters: [\n             string(name: 'GCCI_BRANCH', value: 'm"
  },
  {
    "path": ".clang-format",
    "chars": 33,
    "preview": "Language: Cpp\nBasedOnStyle: llvm\n"
  },
  {
    "path": ".clang-tidy",
    "chars": 1937,
    "preview": "Checks: '*, -abseil*, -altera*, -android*, -cppcoreguidelines*, -cert*, -modernize*, -boost*, -google*, -fuchsia*, -hicp"
  },
  {
    "path": ".github/CODEOWNERS",
    "chars": 26,
    "preview": "* @Software-GCAI/poptorch\n"
  },
  {
    "path": ".github/workflows/apply_linters.yml",
    "chars": 779,
    "preview": "name: apply_linters.py git trailer check\n\non:\n  push:\n    branches: [mk2-main]\n  pull_request:\n    branches: [mk2-main]\n"
  },
  {
    "path": ".gitignore",
    "chars": 52,
    "preview": "build\n__pycache__\n.linters\n.cache\n.vscode\ntest_data\n"
  },
  {
    "path": ".pre-commit-config.yaml",
    "chars": 616,
    "preview": "repos:\n-   repo: https://github.com/pre-commit/pre-commit-hooks\n    rev: v2.3.0\n    hooks:\n    -   id: check-yaml\n    - "
  },
  {
    "path": ".pylintrc",
    "chars": 11614,
    "preview": "[MASTER]\n# Prevent pylint from incorrectly reporting 'has no member' for C modules\n# by allowing them to be loaded (does"
  },
  {
    "path": ".style.yapf",
    "chars": 7648,
    "preview": "[style]\n# Align closing bracket with visual indentation.\nalign_closing_bracket_with_visual_indent=True\n\n# Allow dictiona"
  },
  {
    "path": "CMakeLists.txt",
    "chars": 10117,
    "preview": "cmake_minimum_required(VERSION 3.14 FATAL_ERROR)\nproject(poptorch)\ninclude(GNUInstallDirs)\n\nset(CMAKE_EXPORT_COMPILE_COM"
  },
  {
    "path": "License.txt",
    "chars": 1084,
    "preview": "The MIT License (MIT)\n\nCopyright (c) 2020 Graphcore Limited\n\nPermission is hereby granted, free of charge, to any person"
  },
  {
    "path": "MANIFEST.in",
    "chars": 217,
    "preview": "recursive-include include *.hpp\ninclude poptorch/lib/*\ninclude poptorch/lib/poplar_rt/*\ninclude poptorch/lib/graphcore/l"
  },
  {
    "path": "README.md",
    "chars": 5648,
    "preview": "# PopTorch and PopTorch Geometric.\n\n## PopTorch - PyTorch integration for the Graphcore IPU\n\nPopTorch is a set of extens"
  },
  {
    "path": "config.buildenv.py",
    "chars": 2438,
    "preview": "# Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n\n_llvm_version = \"13.0.1\"\n\nconfig.setDefault(build_documentatio"
  },
  {
    "path": "docs/common/_static/css/custom_rtd.css",
    "chars": 4632,
    "preview": "/* Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n   Override the sphinx-readthedocs-theme settings */\n\n/*  impr"
  },
  {
    "path": "docs/common/conf.py",
    "chars": 12276,
    "preview": "# Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n# Configuration file for the Sphinx documentation builder.\n#\n# "
  },
  {
    "path": "docs/common/custom_dic",
    "chars": 586,
    "preview": "accessor\nAdamW\nAMSGrad\nAsyncRebatched\nautograd\nbackend\nbooleans\nbwd\ncheckpointed\ncheckpointing\ncodepaths\nconfig\nconnecti"
  },
  {
    "path": "docs/poptorch_geometric/common/conf.py",
    "chars": 13895,
    "preview": "# Copyright (c) 2023 Graphcore Ltd. All rights reserved.\n# Configuration file for the Sphinx documentation builder.\n#\n# "
  },
  {
    "path": "docs/poptorch_geometric/user_guide/index.rst",
    "chars": 239,
    "preview": "PyTorch Geometric for the IPU: User Guide\n=========================================\n\n.. toctree::\n    :maxdepth: 4\n    :"
  },
  {
    "path": "docs/poptorch_geometric/user_guide/installation.rst",
    "chars": 4512,
    "preview": ".. _installation:\n\n============\nInstallation\n============\n\nPopTorch Geometric is included as part of the Poplar SDK (see"
  },
  {
    "path": "docs/poptorch_geometric/user_guide/intro.rst",
    "chars": 1188,
    "preview": "============\nIntroduction\n============\n\n.. admonition:: Experimental Release\n\n    This is an experimental release of Pop"
  },
  {
    "path": "docs/poptorch_geometric/user_guide/legal.rst",
    "chars": 116,
    "preview": "Legal notices\n=============\n\n|LEGAL:TRADEMARKS|\n\n|LEGAL:EULA|\n\n© Copyright 2023 Graphcore Ltd. All rights reserved.\n"
  },
  {
    "path": "docs/poptorch_geometric/user_guide/performance.rst",
    "chars": 5022,
    "preview": "======================\nOptimizing performance\n======================\n\nPopTorch Geometric is an extension of PyTorch Geom"
  },
  {
    "path": "docs/poptorch_geometric/user_guide/reference.rst",
    "chars": 779,
    "preview": ".. _reference:\n\n=============\nAPI reference\n=============\n\n.. _api_options:\n\nData loaders\n============\n\n.. autoclass:: p"
  },
  {
    "path": "docs/poptorch_geometric/user_guide/supported_operations.rst",
    "chars": 40581,
    "preview": ".. _supported_operations:\n\n====================\nSupported operations\n====================\n\nThis chapter contains a list "
  },
  {
    "path": "docs/poptorch_geometric/user_guide/tutorials.rst",
    "chars": 566,
    "preview": ".. _examples_and_tutorials:\n\n======================\nExamples and tutorials\n======================\n\nExamples demonstratin"
  },
  {
    "path": "docs/user_guide/CMakeLists.txt",
    "chars": 1397,
    "preview": "set(LONG_TESTS mnist inferenceModel)\n\nfunction(add_poptorch_py_user_guide_example name path)\n  message(STATUS \"Adding py"
  },
  {
    "path": "docs/user_guide/api.py",
    "chars": 5034,
    "preview": "# Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n\nimport tempfile\nimport os\nimport torch\nimport poptorch\n\n\n# ctc"
  },
  {
    "path": "docs/user_guide/batching.rst",
    "chars": 12877,
    "preview": ".. _efficient_data_batching:\n\n=======================\nEfficient data batching\n=======================\n\nBy default, PopTo"
  },
  {
    "path": "docs/user_guide/buffers.py",
    "chars": 1286,
    "preview": "# Copyright (c) 2021 Graphcore Ltd. All rights reserved.\nimport torch\nimport poptorch\n\n\n# counter_model_wrong_start\nclas"
  },
  {
    "path": "docs/user_guide/debugging.py",
    "chars": 1481,
    "preview": "#!/usr/bin/env python3\n# Copyright (c) 2021 Graphcore Ltd. All rights reserved.\nimport torch\nimport poptorch\n\n\nclass Mod"
  },
  {
    "path": "docs/user_guide/debugging.rst",
    "chars": 3227,
    "preview": "=====================\nDebugging your model\n=====================\n\nInspecting tensors\n==================\n\nPopTorch allows"
  },
  {
    "path": "docs/user_guide/device_iterations.py",
    "chars": 9516,
    "preview": "# Copyright (c) 2020 Graphcore Ltd. All rights reserved.\nimport sys\nimport poptorch\n\nif not poptorch.ipuHardwareIsAvaila"
  },
  {
    "path": "docs/user_guide/error_handling.py",
    "chars": 2088,
    "preview": "# Copyright (c) 2021 Graphcore Ltd. All rights reserved.\nimport torch\nimport poptorch\nfrom poptorch.poptorch_core import"
  },
  {
    "path": "docs/user_guide/example.rst",
    "chars": 1387,
    "preview": "Examples\n========\n\nYou can find PyTorch examples and tutorials in the Graphcore GitHub `examples repository <https://git"
  },
  {
    "path": "docs/user_guide/experimental.rst",
    "chars": 1397,
    "preview": "=====================\nExperimental features\n=====================\n\nDistributed execution without PopRun\n================"
  },
  {
    "path": "docs/user_guide/hostio_optimisation.rst",
    "chars": 4015,
    "preview": "=====================\nEfficient IPU I/O\n=====================\n\nWhen developing applications for the IPU, maximising I/O "
  },
  {
    "path": "docs/user_guide/index.rst",
    "chars": 299,
    "preview": "PyTorch for the IPU: User Guide\n===============================\n\n.. toctree::\n    :maxdepth: 4\n    :numbered: 3\n\n    int"
  },
  {
    "path": "docs/user_guide/inferenceModel.py",
    "chars": 1708,
    "preview": "# Copyright (c) 2020 Graphcore Ltd. All rights reserved.\nimport os\nimport poptorch\n# If running on the model then make s"
  },
  {
    "path": "docs/user_guide/installation.rst",
    "chars": 5508,
    "preview": ".. _installation:\n\n============\nInstallation\n============\n\n.. contents::\n  :local:\n\nPopTorch is included with the Poplar"
  },
  {
    "path": "docs/user_guide/intro.rst",
    "chars": 7444,
    "preview": "============\nIntroduction\n============\n\nPopTorch is a set of extensions for PyTorch to enable PyTorch models to run dire"
  },
  {
    "path": "docs/user_guide/legal.rst",
    "chars": 141,
    "preview": "Trademarks & copyright\n======================\n\n|LEGAL:TRADEMARKS|\n\n|LEGAL:EULA|\n\nCopyright © 2020-|YEAR| Graphcore Ltd. "
  },
  {
    "path": "docs/user_guide/mnist.py",
    "chars": 8464,
    "preview": "#!/usr/bin/env python3\n# Copyright (c) 2020 Graphcore Ltd. All rights reserved.\nimport argparse\nimport sys\nimport torch\n"
  },
  {
    "path": "docs/user_guide/overview.rst",
    "chars": 56171,
    "preview": "========\nFeatures\n========\n\n.. contents::\n  :local:\n  :depth: 3\n\nOptions\n=======\n\nYou can change how PopTorch compiles a"
  },
  {
    "path": "docs/user_guide/phased_execution.py",
    "chars": 4529,
    "preview": "#!/usr/bin/env python3\n# Copyright (c) 2020 Graphcore Ltd. All rights reserved.\nimport torch\nimport torch.nn.functional "
  },
  {
    "path": "docs/user_guide/pipeline_simple.py",
    "chars": 6000,
    "preview": "# Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n# annotations_start\nimport transformers\nimport torch\nimport pop"
  },
  {
    "path": "docs/user_guide/poptorch.conf",
    "chars": 117,
    "preview": "deviceIterations(1)\nsetExecutionStrategy(poptorch.ShardedExecution())\nreplicationFactor(1)\nenableSyntheticData(True)\n"
  },
  {
    "path": "docs/user_guide/poptorch_training_simple.py",
    "chars": 4248,
    "preview": "# Copyright (c) 2020 Graphcore Ltd. All rights reserved.\nimport torch\nimport poptorch\n\n\nclass ExampleModel(torch.nn.Modu"
  },
  {
    "path": "docs/user_guide/precompilation.py",
    "chars": 4463,
    "preview": "# Copyright (c) 2021 Graphcore Ltd. All rights reserved.\nimport sys\nimport poptorch\n\nif not poptorch.ipuHardwareIsAvaila"
  },
  {
    "path": "docs/user_guide/pytorch_to_poptorch.rst",
    "chars": 9789,
    "preview": "========================\nFrom PyTorch to PopTorch\n========================\n\nThis page will introduce the key features th"
  },
  {
    "path": "docs/user_guide/reference.rst",
    "chars": 4841,
    "preview": ".. _reference:\n\n=============\nAPI reference\n=============\n\n.. _api_options:\n\nOptions\n=======\n\n.. autoclass:: poptorch.Op"
  },
  {
    "path": "docs/user_guide/replica_grouped_weights.py",
    "chars": 2096,
    "preview": "# Copyright (c) 2022 Graphcore Ltd. All rights reserved.\n\nimport numpy\nimport torch\nimport poptorch\n\n\n# groupedweights_s"
  },
  {
    "path": "docs/user_guide/sumAnchorReturnType.py",
    "chars": 4203,
    "preview": "# Copyright (c) 2021 Graphcore Ltd. All rights reserved.\n\nimport random\nimport torch\nimport poptorch\n\nRAND_SEED = 8549\n\n"
  },
  {
    "path": "docs/user_guide/supported_ops.rst",
    "chars": 11780,
    "preview": ".. _supported_ops:\n\nIPU supported operations\n************************\n\nBelow is a list of currently supported operations"
  },
  {
    "path": "docs/user_guide/trainingModel.py",
    "chars": 2399,
    "preview": "# Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n# training_model_start\nimport torch\nimport poptorch\n\n\nclass Exa"
  },
  {
    "path": "examples/CMakeLists.txt",
    "chars": 881,
    "preview": "function(add_poptorch_py_example name path)\n  message(STATUS \"Adding python example '${name}'\")\n\n  set(extra_labels \"\")\n"
  },
  {
    "path": "examples/bert_ipu.py",
    "chars": 3676,
    "preview": "#!/usr/bin/env python3\n# Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n\nimport os\nimport transformers\nimport to"
  },
  {
    "path": "examples/lstm.py",
    "chars": 719,
    "preview": "#!/usr/bin/env python3\n# Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n\nimport torch\nimport torch.nn as nn\nimpo"
  },
  {
    "path": "examples/mnist.py",
    "chars": 6564,
    "preview": "#!/usr/bin/env python3\n# Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n\n\n# pylint: disable=too-many-statements\n"
  },
  {
    "path": "examples/simple_adder.py",
    "chars": 491,
    "preview": "#!/usr/bin/env python3\n# Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n\nimport torch\nimport torch.nn as nn\nimpo"
  },
  {
    "path": "popart_compiler/CMakeLists.txt",
    "chars": 2402,
    "preview": "cmake_minimum_required(VERSION 3.14 FATAL_ERROR)\nproject(popart_compiler)\n\nfind_package(popef REQUIRED)\n\nadd_library(pop"
  },
  {
    "path": "popart_compiler/include/popart_compiler/CodeletsCompilation.hpp",
    "chars": 919,
    "preview": "// Copyright (c) 2022 Graphcore Ltd. All rights reserved.\n#ifndef POPART_COMPILER_CODELETS_COMPILATION_HPP\n#define POPAR"
  },
  {
    "path": "popart_compiler/include/popart_compiler/Compiler.hpp",
    "chars": 15997,
    "preview": "// Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n#pragma once\n\n#include <map>\n#include <memory>\n#include <set>\n"
  },
  {
    "path": "popart_compiler/include/popart_compiler/CompilerOperationMacros.inc.hpp",
    "chars": 26379,
    "preview": "// Copyright (c) 2022 Graphcore Ltd. All rights reserved.\n// Auto generated file, do not modify\n// Run `python3 scripts/"
  },
  {
    "path": "popart_compiler/include/popart_compiler/ManuallyAddedOperations.inc.hpp",
    "chars": 4008,
    "preview": "// Copyright (c) 2020 Graphcore Ltd. All rights reserved.\nOP_DECL(popart, reshape_static_shape, reshape, _impl->reshape,"
  },
  {
    "path": "popart_compiler/include/popart_compiler/SupportedOperations.inc.hpp",
    "chars": 778,
    "preview": "// Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n/*\n    OP_DECLS are in the following form:\n    OP_DECL(namespa"
  },
  {
    "path": "popart_compiler/include/popart_compiler/Utils.hpp",
    "chars": 1486,
    "preview": "// Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n#ifndef POPART_COMPILER_UTILS_HPP\n#define POPART_COMPILER_UTIL"
  },
  {
    "path": "popart_compiler/source/CodeletsCompilation.cpp",
    "chars": 8929,
    "preview": "// Copyright (c) 2022 Graphcore Ltd. All rights reserved.\n#include <sys/file.h>\n#include <sys/wait.h>\n#include <unistd.h"
  },
  {
    "path": "popart_compiler/source/Compiler.cpp",
    "chars": 74617,
    "preview": "// Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n#include <atomic>\n#include <chrono>\n#include <cstring>\n#includ"
  },
  {
    "path": "popart_compiler/source/CompilerImpl.cpp",
    "chars": 48054,
    "preview": "// Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n#include <chrono>\n#include <memory>\n#include <numeric>\n#includ"
  },
  {
    "path": "popart_compiler/source/SessionOptions.cpp",
    "chars": 23127,
    "preview": "// Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n#include <chrono>\n#include <fstream>\n#include <iostream>\n#incl"
  },
  {
    "path": "popart_compiler/source/Utils.cpp",
    "chars": 6823,
    "preview": "// Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n#include <chrono>\n#include <thread>\n\n#include <popart/popx/dev"
  },
  {
    "path": "popart_compiler/source/custom_operations/Embedding.cpp",
    "chars": 12804,
    "preview": "// Copyright (c) 2021, Graphcore Ltd, All rights reserved.\n\n#include <map>\n#include <memory>\n#include <set>\n#include <tu"
  },
  {
    "path": "popart_compiler/source/custom_operations/FastGatherLastDim.cpp",
    "chars": 13811,
    "preview": "// Copyright (c) 2022 Graphcore Ltd. All rights reserved.\n#include <functional>\n\n#include <ostream>\n#include <popart/pop"
  },
  {
    "path": "popart_compiler/source/custom_operations/FastGatherLastDim.hpp",
    "chars": 4032,
    "preview": "// Copyright (c) 2022 Graphcore Ltd. All rights reserved.\n#ifndef GUARD_POPTORCH_STATICGATHER_HPP\n#define GUARD_POPTORCH"
  },
  {
    "path": "popart_compiler/source/custom_operations/FastGatherLastDimBwdCodelets.inc.cpp",
    "chars": 6542,
    "preview": "// Copyright (c) 2022, Graphcore Ltd, All rights reserved.\n#ifdef __IPU__\n#include <ipu_vector_math>\n#else\n  #error Not "
  },
  {
    "path": "popart_compiler/source/custom_operations/FastGatherLastDimFwdCodelets.inc.cpp",
    "chars": 5433,
    "preview": "// Copyright (c) 2022, Graphcore Ltd, All rights reserved.\n#ifdef __IPU__\n#include <ipu_vector_math>\n#else\n  #error Not "
  },
  {
    "path": "popart_compiler/source/custom_operations/HostOp.cpp",
    "chars": 6957,
    "preview": "// Copyright (c) 2021 Graphcore Ltd. All rights reserved.\n\n#include <memory>\n#include <popart/builder.hpp>\n#include <pop"
  },
  {
    "path": "popart_compiler/source/custom_operations/TorchSoftplus.cpp",
    "chars": 9412,
    "preview": "// Copyright (c) 2021 Graphcore Ltd. All rights reserved.\n\n#include \"TorchSoftplus.hpp\"\n#include \"popart_compiler/Custom"
  },
  {
    "path": "popart_compiler/source/custom_operations/TorchSoftplus.hpp",
    "chars": 3140,
    "preview": "// Copyright (c) 2021 Graphcore Ltd. All rights reserved.\n#ifndef GUARD_POPTORCH_SOFTPLUS_HPP\n#define GUARD_POPTORCH_SOF"
  },
  {
    "path": "popart_compiler/source/custom_operations/UpsampleBilinear2d.cpp",
    "chars": 31934,
    "preview": "// Copyright (c) 2021, Graphcore Ltd, All rights reserved.\n#include <popart/builder.hpp>\n#include <popart/ndarraywrapper"
  },
  {
    "path": "popart_compiler/source/custom_operations/UpsampleBilinear2dCodelets.inc.cpp",
    "chars": 2456,
    "preview": "// Copyright (c) 2021, Graphcore Ltd, All rights reserved.\n#include <algorithm>\n#include <cassert>\n#include <cmath>\n#inc"
  },
  {
    "path": "popart_compiler/source/include/popart_compiler/CompilerImpl.hpp",
    "chars": 15588,
    "preview": "// Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n#pragma once\n\n#include <algorithm>\n#include <atomic>\n#include "
  },
  {
    "path": "popart_compiler/source/include/popart_compiler/CompilerOptions.hpp",
    "chars": 5335,
    "preview": "// Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n#pragma once\n\n#include <cstdint>\n#include <limits>\n#include <s"
  },
  {
    "path": "popart_compiler/source/include/popart_compiler/CustomOps.hpp",
    "chars": 2034,
    "preview": "// Copyright (c) 2021 Graphcore Ltd. All rights reserved.\n\n/*\n * Host op represents an operation executed on the CPU. It"
  },
  {
    "path": "popart_compiler/source/include/popart_compiler/MultiConvBuilder.hpp",
    "chars": 2807,
    "preview": "// Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n#pragma once\n\n#include <cstdint>\n#include <string>\n#include <v"
  },
  {
    "path": "popart_compiler/source/include/popart_compiler/SessionOptionsImpl.hpp",
    "chars": 1496,
    "preview": "// Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n#pragma once\n\n#include <functional>\n#include <map>\n#include <s"
  },
  {
    "path": "popart_compiler/types/include/popart_compiler/CompilerTypes.hpp",
    "chars": 3355,
    "preview": "// Copyright (c) 2022 Graphcore Ltd. All rights reserved.\n#pragma once\n\n#include <functional>\n#include <utility>\n#includ"
  },
  {
    "path": "popart_compiler/types/include/popart_compiler/PopartEnums.hpp",
    "chars": 4499,
    "preview": "// Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n#ifndef POPART_COMPILER_POPART_ENUMS_HPP\n#define POPART_COMPIL"
  },
  {
    "path": "poptorch/CMakeLists.txt",
    "chars": 4270,
    "preview": "cmake_minimum_required(VERSION 3.14 FATAL_ERROR)\nproject(poptorch)\n\nadd_library(poptorch_internal_headers INTERFACE)\ntar"
  },
  {
    "path": "poptorch/include/poptorch/DispatchTracer.hpp",
    "chars": 4044,
    "preview": "// Copyright (c) 2021 Graphcore Ltd. All rights reserved.\n#ifndef INCLUDE_POPTORCH_DISPATCH_TRACER_HPP_\n#define INCLUDE_"
  },
  {
    "path": "poptorch/include/poptorch/InplaceOps.hpp",
    "chars": 2630,
    "preview": "// Copyright (c) 2021 Graphcore Ltd. All rights reserved.\n#ifndef INCLUDE_POPTORCH_INPLACE_OPS_H\n#define INCLUDE_POPTORC"
  },
  {
    "path": "poptorch/include/poptorch/LowerToPopart.hpp",
    "chars": 1906,
    "preview": "// Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n#ifndef INCLUDE_POPTORCH_LOWER_TO_POPART_H\n#define INCLUDE_POP"
  },
  {
    "path": "poptorch/include/poptorch/LowerToPopartFactories.hpp",
    "chars": 757,
    "preview": "// Copyright (c) 2022 Graphcore Ltd. All rights reserved.\n#ifndef INCLUDE_POPTORCH_LOWER_TO_POPART_FACTORIES_H\n#define I"
  },
  {
    "path": "poptorch/include/poptorch/PoplarExecutable.hpp",
    "chars": 2882,
    "preview": "// Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n#ifndef INCLUDE_POPTORCH_POPLAR_EXECUTABLE_HPP\n#define INCLUDE"
  },
  {
    "path": "poptorch/include/poptorch/SessionOptionsParser.hpp",
    "chars": 2182,
    "preview": "// Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n#ifndef INCLUDE_POPTORCH_SESSION_OPTIONS_PARSER_HPP\n#define IN"
  },
  {
    "path": "poptorch/include/poptorch/Utils.hpp",
    "chars": 4530,
    "preview": "// Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n#ifndef INCLUDE_POPTORCH_UTILS_HPP\n#define INCLUDE_POPTORCH_UT"
  },
  {
    "path": "poptorch/source/AddDetachOperations.cpp",
    "chars": 3371,
    "preview": "// Copyright (c) 2021 Graphcore Ltd. All rights reserved.\n\n#include <torch/csrc/jit/ir/ir.h>\n\n#include \"PoptorchSymbols."
  },
  {
    "path": "poptorch/source/AddSubgraphConnectionNodes.cpp",
    "chars": 13617,
    "preview": "// Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n\n#include <torch/csrc/jit/ir/ir.h>\n\n#include <functional>\n#inc"
  },
  {
    "path": "poptorch/source/AliasProcessing.cpp",
    "chars": 603,
    "preview": "// Copyright (c) 2021 Graphcore Ltd. All rights reserved.\n\n#include <torch/csrc/jit/ir/ir.h>\n#include <vector>\n\n#include"
  },
  {
    "path": "poptorch/source/CPUOffloadingCleanUp.cpp",
    "chars": 4054,
    "preview": "// Copyright (c) 2021 Graphcore Ltd. All rights reserved.\n\n#include <torch/csrc/jit/ir/ir.h>\n\n#include \"PoptorchSymbols."
  },
  {
    "path": "poptorch/source/CompilerOps.cpp.inc",
    "chars": 62840,
    "preview": "// Copyright (c) 2022 Graphcore Ltd. All rights reserved.\n// Auto generated file, do not modify\n// Run `python3 scripts/"
  },
  {
    "path": "poptorch/source/ErrorOnUnsupportedAten.cpp",
    "chars": 1106,
    "preview": "// Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n\n#include <torch/csrc/jit/ir/ir.h>\n\n#include \"poptorch/PopartC"
  },
  {
    "path": "poptorch/source/FixupSetAvailableMemory.cpp",
    "chars": 4418,
    "preview": "// Copyright (c) 2022 Graphcore Ltd. All rights reserved.\n\n#include <torch/csrc/jit/ir/graph_node_list.h>\n#include <torc"
  },
  {
    "path": "poptorch/source/GNNOptimizations.cpp",
    "chars": 22236,
    "preview": "// Copyright (c) 2022 Graphcore Ltd. All rights reserved.\n#include <algorithm>\n#include <array>\n#include <map>\n#include "
  },
  {
    "path": "poptorch/source/GatherWithExpandedIndicesOptimization.cpp",
    "chars": 4475,
    "preview": "// Copyright (c) 2022 Graphcore Ltd. All rights reserved.\n#include <torch/csrc/jit/ir/ir.h>\n#include <unordered_set>\n\n#i"
  },
  {
    "path": "poptorch/source/ImplicitCasting.cpp",
    "chars": 4730,
    "preview": "// Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n#include <ATen/ATen.h>\n#include <ATen/native/TypeProperties.h>"
  },
  {
    "path": "poptorch/source/InplaceOps.cpp",
    "chars": 11766,
    "preview": "// Copyright (c) 2021 Graphcore Ltd. All rights reserved.\n\n#include <torch/csrc/jit/ir/ir.h>\n\n#include <algorithm>\n#incl"
  },
  {
    "path": "poptorch/source/LowerToPopart.cpp",
    "chars": 53001,
    "preview": "// Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n#include \"poptorch/LowerToPopart.hpp\"\n\n#include <experimental/"
  },
  {
    "path": "poptorch/source/LowerToPopartFactories.cpp",
    "chars": 4221,
    "preview": "// Copyright (c) 2022 Graphcore Ltd. All rights reserved.\n#include \"poptorch/LowerToPopartFactories.hpp\"\n\n#include <torc"
  },
  {
    "path": "poptorch/source/OpBuilder.cpp",
    "chars": 29991,
    "preview": "// Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n\n#include \"popart_compiler/PopartEnums.hpp\"\n#include \"popart_c"
  },
  {
    "path": "poptorch/source/OverlappedIO.cpp",
    "chars": 5826,
    "preview": "// Copyright (c) 2021 Graphcore Ltd. All rights reserved.\n\n#include <torch/csrc/jit/ir/ir.h>\n\n#include <algorithm>\n\n#inc"
  },
  {
    "path": "poptorch/source/PopartCanonicalization.cpp",
    "chars": 10827,
    "preview": "// Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n#include <torch/csrc/jit/ir/ir.h>\n\n#include <optional>\n#includ"
  },
  {
    "path": "poptorch/source/PopartLateCanonicalization.cpp",
    "chars": 10037,
    "preview": "// Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n\n#include <torch/csrc/jit/ir/ir.h>\n\n#include <functional>\n#inc"
  },
  {
    "path": "poptorch/source/PoplarExecutable.cpp",
    "chars": 8601,
    "preview": "// Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n\n#include <ATen/ATen.h>\n\n#include <iostream>\n#include <sstream"
  },
  {
    "path": "poptorch/source/PoptorchStaticInit.hpp",
    "chars": 562,
    "preview": "// Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n#ifndef SOURCE_POPTORCH_STATIC_INIT_H\n#define SOURCE_POPTORCH_"
  },
  {
    "path": "poptorch/source/PoptorchSymbols.cpp",
    "chars": 6295,
    "preview": "// Copyright (c) 2020 Graphcore Ltd. All rights reserved\n#include <spdlog/fmt/fmt.h>\n#include <spdlog/fmt/ostr.h>\n\n#incl"
  },
  {
    "path": "poptorch/source/PoptorchSymbols.hpp",
    "chars": 3661,
    "preview": "// Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n#ifndef SOURCE_POPTORCH_SYMBOLS_H\n#define SOURCE_POPTORCH_SYMB"
  },
  {
    "path": "poptorch/source/RemoveSurplusIdentityLosses.cpp",
    "chars": 3453,
    "preview": "// Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n\n#include <torch/csrc/jit/ir/ir.h>\n\n#include \"PoptorchSymbols."
  },
  {
    "path": "poptorch/source/RequiresGrad.cpp",
    "chars": 1565,
    "preview": "// Copyright (c) 2022 Graphcore Ltd. All rights reserved.\n\n#include <torch/csrc/jit/ir/graph_node_list.h>\n#include <torc"
  },
  {
    "path": "poptorch/source/SessionOptionsParser.cpp",
    "chars": 4285,
    "preview": "// Copyright (c) 2022 Graphcore Ltd. All rights reserved.\n#include \"poptorch/SessionOptionsParser.hpp\"\n\n#include \"popart"
  },
  {
    "path": "poptorch/source/Utils.cpp",
    "chars": 13060,
    "preview": "// Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n#include <torch/csrc/jit/ir/ir.h>\n\n#include <spdlog/fmt/fmt.h>"
  },
  {
    "path": "poptorch/source/dispatch_tracer/CMakeLists.txt",
    "chars": 519,
    "preview": "\nset(CMAKE_POSITION_INDEPENDENT_CODE ON)\n\nadd_library(dispatch_tracer STATIC\n  RegisterAtenOverloads.cpp\n  CommonHelperF"
  },
  {
    "path": "poptorch/source/dispatch_tracer/CommonHelperFunctions.cpp",
    "chars": 9225,
    "preview": "// Copyright (c) 2021 Graphcore Ltd. All rights reserved.\n#include \"CommonHelperFunctions.hpp\"\n\n#include <spdlog/fmt/fmt"
  },
  {
    "path": "poptorch/source/dispatch_tracer/CommonHelperFunctions.hpp",
    "chars": 1954,
    "preview": "// Copyright (c) 2021 Graphcore Ltd. All rights reserved.\n#ifndef POPTORCH_DISPATCH_COMMON_HELPERS_HPP_\n#define POPTORCH"
  },
  {
    "path": "poptorch/source/dispatch_tracer/InplaceAliasMapper.cpp",
    "chars": 1625,
    "preview": "// Copyright (c) 2023 Graphcore Ltd. All rights reserved.\n#include <spdlog/fmt/fmt.h>\n\n#include \"InplaceAliasMapper.hpp\""
  },
  {
    "path": "poptorch/source/dispatch_tracer/InplaceAliasMapper.hpp",
    "chars": 2000,
    "preview": "// Copyright (c) 2023 Graphcore Ltd. All rights reserved.\n#ifndef POPTORCH_DISPATCH_INPLACE_ALIAS_MAPPER_HPP_\n#define PO"
  },
  {
    "path": "poptorch/source/dispatch_tracer/README.md",
    "chars": 3559,
    "preview": "## Dispatch tracing\n\nDispatch tracing is our own implementation of torch::jit::trace which allows us\nto sidestep some of"
  },
  {
    "path": "poptorch/source/dispatch_tracer/RegisterAtenOverloads.cpp",
    "chars": 40558,
    "preview": "// Copyright (c) 2021 Graphcore Ltd. All rights reserved.\n#include <ATen/Operators.h>\n#include <ATen/core/List.h>\n#inclu"
  },
  {
    "path": "poptorch/source/dispatch_tracer/RegisterMetaOps.cpp.inc",
    "chars": 25919,
    "preview": "// Copyright (c) 2022 Graphcore Ltd. All rights reserved.\n#include <cmath>\n#include <ATen/MetaFunctions.h>\n\nnamespace po"
  },
  {
    "path": "poptorch/source/dispatch_tracer/RegisterOptionalAtenOps.cpp.inc",
    "chars": 8835,
    "preview": "// Copyright (c) 2022 Graphcore Ltd. All rights reserved.\n\nTORCH_LIBRARY_IMPL(aten, IPU, m) {\n  // These ops otherwise r"
  },
  {
    "path": "poptorch/source/dispatch_tracer/Tensor.cpp",
    "chars": 17594,
    "preview": "// Copyright (c) 2022 Graphcore Ltd. All rights reserved.\n#include \"Tensor.hpp\"\n\n#include <ATen/ATen.h>\n#include <ATen/O"
  },
  {
    "path": "poptorch/source/dispatch_tracer/Tensor.hpp",
    "chars": 5223,
    "preview": "// Copyright (c) 2022 Graphcore Ltd. All rights reserved.\n#ifndef POPTORCH_DISPATCH_TENSOR_HPP_\n#define POPTORCH_DISPATC"
  },
  {
    "path": "poptorch/source/dispatch_tracer/TypeInferenceHandler.cpp",
    "chars": 13230,
    "preview": "// Copyright (c) 2022 Graphcore Ltd. All rights reserved.\n#include <ATen/MetaFunctions.h>\n#include <algorithm>\n\n#include"
  },
  {
    "path": "poptorch/source/dispatch_tracer/TypeInferenceHandler.hpp",
    "chars": 2283,
    "preview": "// Copyright (c) 2022 Graphcore Ltd. All rights reserved.\n#ifndef POPTORCH_DISPATCH_TYPE_INFERENCE_HANDLER_HPP_\n#define "
  },
  {
    "path": "poptorch/source/dispatch_tracer/ValueMapper.cpp",
    "chars": 9699,
    "preview": "// Copyright (c) 2021 Graphcore Ltd. All rights reserved.\n#include \"ValueMapper.hpp\"\n\n#include <memory>\n#include <utilit"
  },
  {
    "path": "poptorch/source/dispatch_tracer/ValueMapper.hpp",
    "chars": 6117,
    "preview": "// Copyright (c) 2021 Graphcore Ltd. All rights reserved.\n#ifndef POPTORCH_DISPATCH_VALUE_MAPPER_HPP_\n#define POPTORCH_D"
  },
  {
    "path": "poptorch/source/dispatch_tracer/dispatchers/IDispatch.cpp",
    "chars": 4382,
    "preview": "// Copyright (c) 2022 Graphcore Ltd. All rights reserved.\n#include \"IDispatch.hpp\"\n\n#include <memory>\n\n#include \"poptorc"
  },
  {
    "path": "poptorch/source/dispatch_tracer/dispatchers/IDispatch.hpp",
    "chars": 3431,
    "preview": "// Copyright (c) 2021 Graphcore Ltd. All rights reserved.\n#ifndef POPTORCH_IDISPATCH_H_\n#define POPTORCH_IDISPATCH_H_\n\n#"
  },
  {
    "path": "poptorch/source/dispatch_tracer/dispatchers/JitDispatch.cpp",
    "chars": 17190,
    "preview": "// Copyright (c) 2021 Graphcore Ltd. All rights reserved.\n#include \"JitDispatch.hpp\"\n\n#include <memory>\n#include <string"
  },
  {
    "path": "poptorch/source/dispatch_tracer/dispatchers/JitDispatch.hpp",
    "chars": 2136,
    "preview": "// Copyright (c) 2021 Graphcore Ltd. All rights reserved.\n#ifndef POPTORCH_DISPATCH_JIT_DISPATCH_HPP_\n#define POPTORCH_D"
  },
  {
    "path": "poptorch/source/include/poptorch/AliasProcessing.hpp",
    "chars": 686,
    "preview": "// Copyright (c) 2021 Graphcore Ltd. All rights reserved.\n#ifndef INCLUDE_POPTORCH_ALIAS_PROCESSING_H\n#define INCLUDE_PO"
  },
  {
    "path": "poptorch/source/include/poptorch/CompilerOps.inc.hpp",
    "chars": 23482,
    "preview": "// Copyright (c) 2022 Graphcore Ltd. All rights reserved.\n// Auto generated file, do not modify\n// Run `python3 scripts/"
  },
  {
    "path": "poptorch/source/include/poptorch/ImplicitCasting.hpp",
    "chars": 1347,
    "preview": "// Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n#ifndef INCLUDE_POPTORCH_IMPLICIT_CASTING_HPP\n#define INCLUDE_"
  },
  {
    "path": "poptorch/source/include/poptorch/InplaceOpsPyTorch.hpp_nolint",
    "chars": 4386,
    "preview": "// Copyright (c) 2021 Graphcore Ltd. All rights reserved.\n// Any Modifications to code from PyTorch\n\n// From PyTorch:\n\n/"
  },
  {
    "path": "poptorch/source/include/poptorch/OpBuilder.hpp",
    "chars": 13161,
    "preview": "// Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n#ifndef INCLUDE_POPTORCH_OP_BUILDER_HPP\n#define INCLUDE_POPTOR"
  },
  {
    "path": "poptorch/source/include/poptorch/OverlappedIO.hpp",
    "chars": 544,
    "preview": "// Copyright (c) 2021 Graphcore Ltd. All rights reserved.\n#ifndef INCLUDE_POPTORCH_OVERLAPPED_IO_H\n#define INCLUDE_POPTO"
  },
  {
    "path": "poptorch/source/include/poptorch/PopartCanonicalization.hpp",
    "chars": 2940,
    "preview": "// Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n#ifndef INCLUDE_POPTORCH_TRANSFORM_ATEN_TO_POPART_HPP_\n#define"
  },
  {
    "path": "poptorch/source/include/poptorch/RequiresGrad.hpp",
    "chars": 677,
    "preview": "// Copyright (c) 2022 Graphcore Ltd. All rights reserved.\n#ifndef INCLUDE_POPTORCH_REQUIRES_GRAD_H\n#define INCLUDE_POPTO"
  },
  {
    "path": "poptorch/source/include/poptorch/TypeAndConstantCanonicalization.hpp",
    "chars": 2157,
    "preview": "// Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n#ifndef INCLUDE_POPTORCH_TYPE_AND_CONSTANT_CANONICALIZATION_H\n"
  },
  {
    "path": "poptorch/source/popart_canonicalization/ActivationOps.cpp",
    "chars": 7730,
    "preview": "// Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n#include <spdlog/fmt/fmt.h>\n#include <spdlog/fmt/ostr.h>\n\n#inc"
  },
  {
    "path": "poptorch/source/popart_canonicalization/ArithmeticOps.cpp",
    "chars": 12732,
    "preview": "// Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n#include <ATen/core/jit_type.h>\n#include <c10/core/ScalarType."
  },
  {
    "path": "poptorch/source/popart_canonicalization/AtenHandlers.gen.cpp",
    "chars": 30779,
    "preview": "// DO NOT EDIT! Generated by PopAtenHandlers.py\n// Copyright (c) 2022 Graphcore Ltd. All rights reserved.\n\n#include \"../"
  },
  {
    "path": "poptorch/source/popart_canonicalization/BilinearOps.cpp",
    "chars": 2963,
    "preview": "// Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n#include \"../PoptorchStaticInit.hpp\"\n#include \"PopartCanonical"
  },
  {
    "path": "poptorch/source/popart_canonicalization/BitwiseOps.cpp",
    "chars": 3411,
    "preview": "// Copyright (c) 2021 Graphcore Ltd. All rights reserved.\n#include \"../PoptorchStaticInit.hpp\"\n#include \"PopartCanonical"
  },
  {
    "path": "poptorch/source/popart_canonicalization/BlasOps.cpp",
    "chars": 6051,
    "preview": "// Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n#include \"../PoptorchStaticInit.hpp\"\n#include \"PopartCanonical"
  },
  {
    "path": "poptorch/source/popart_canonicalization/ConstantOps.cpp",
    "chars": 5262,
    "preview": "// Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n#include <algorithm>\n#include <random>\n\n#include \"../PoptorchS"
  },
  {
    "path": "poptorch/source/popart_canonicalization/ConvolutionOps.cpp",
    "chars": 10159,
    "preview": "// Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n#include \"../PoptorchStaticInit.hpp\"\n#include \"PopartCanonical"
  },
  {
    "path": "poptorch/source/popart_canonicalization/CustomOps.cpp",
    "chars": 1684,
    "preview": "// Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n#include <torch/csrc/jit/ir/ir.h>\n\n#include \"../PoptorchStatic"
  },
  {
    "path": "poptorch/source/popart_canonicalization/DistanceOps.cpp",
    "chars": 7323,
    "preview": "// Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n#include <ATen/ExpandUtils.h>\n\n#include \"../PoptorchStaticInit"
  },
  {
    "path": "poptorch/source/popart_canonicalization/DropoutOps.cpp",
    "chars": 1868,
    "preview": "// Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n#include \"../PoptorchStaticInit.hpp\"\n#include \"../PoptorchSymb"
  },
  {
    "path": "poptorch/source/popart_canonicalization/EinsumOp.cpp",
    "chars": 9355,
    "preview": "// Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n#include \"EinsumOp.hpp\"\n#include \"PopartCanonicalizationUtils."
  },
  {
    "path": "poptorch/source/popart_canonicalization/EinsumOp.hpp",
    "chars": 3436,
    "preview": "// Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n#include <torch/csrc/jit/ir/ir.h>\n\n#include <algorithm>\n#inclu"
  },
  {
    "path": "poptorch/source/popart_canonicalization/EmbeddingOps.cpp",
    "chars": 5658,
    "preview": "// Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n#include <spdlog/fmt/fmt.h>\n#include <spdlog/fmt/ostr.h>\n\n#inc"
  },
  {
    "path": "poptorch/source/popart_canonicalization/IndexOps.cpp",
    "chars": 12643,
    "preview": "// Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n\n#include <ATen/InferSize.h>\n#include <torch/csrc/jit/ir/ir.h>"
  },
  {
    "path": "poptorch/source/popart_canonicalization/LossOps.cpp",
    "chars": 24639,
    "preview": "// Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n#include \"../PoptorchStaticInit.hpp\"\n#include \"PopartCanonical"
  },
  {
    "path": "poptorch/source/popart_canonicalization/NormalizationOps.cpp",
    "chars": 12803,
    "preview": "// Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n#include \"../PoptorchStaticInit.hpp\"\n#include \"../PoptorchSymb"
  },
  {
    "path": "poptorch/source/popart_canonicalization/OtherOps.cpp",
    "chars": 19375,
    "preview": "// Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n#include <c10/core/ScalarType.h>\n\n#include \"../PoptorchStaticI"
  },
  {
    "path": "poptorch/source/popart_canonicalization/PoolingOps.cpp",
    "chars": 7106,
    "preview": "// Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n#include <spdlog/fmt/fmt.h>\n#include <spdlog/fmt/ostr.h>\n\n#inc"
  },
  {
    "path": "poptorch/source/popart_canonicalization/PopartCanonicalizationUtils.cpp",
    "chars": 13435,
    "preview": "// Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n\n#include <functional>\n#include <numeric>\n#include <unordered_"
  },
  {
    "path": "poptorch/source/popart_canonicalization/PopartCanonicalizationUtils.hpp",
    "chars": 6684,
    "preview": "// Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n#ifndef SOURCE_POPART_CANONICALIZATION_UTILS_H\n#define SOURCE_"
  },
  {
    "path": "poptorch/source/popart_canonicalization/PoptorchHandlers.gen.cpp",
    "chars": 7142,
    "preview": "// DO NOT EDIT! Generated by PopTorchHandlers.py\n// Copyright (c) 2022 Graphcore Ltd. All rights reserved.\n\n#include \".."
  },
  {
    "path": "poptorch/source/popart_canonicalization/PyGTorchScatterOps.cpp",
    "chars": 4567,
    "preview": "// Copyright (c) 2022 Graphcore Ltd. All rights reserved.\n#include \"../PoptorchStaticInit.hpp\"\n#include \"../PoptorchSymb"
  },
  {
    "path": "poptorch/source/popart_canonicalization/PyGTorchSplineConvOps.cpp",
    "chars": 1669,
    "preview": "// Copyright (c) 2023 Graphcore Ltd. All rights reserved.\n#include \"../PoptorchStaticInit.hpp\"\n#include \"../PoptorchSymb"
  },
  {
    "path": "poptorch/source/popart_canonicalization/RNNOps.cpp",
    "chars": 12647,
    "preview": "// Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n#include \"../PoptorchStaticInit.hpp\"\n#include \"PopartCanonical"
  },
  {
    "path": "poptorch/source/popart_canonicalization/RandomSamplingOps.cpp",
    "chars": 4479,
    "preview": "// Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n#include <limits>\n\n#include \"PopartCanonicalizationUtils.hpp\"\n"
  },
  {
    "path": "poptorch/source/popart_canonicalization/ReduceOps.cpp",
    "chars": 20014,
    "preview": "// Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n#include <limits>\n\n#include \"../PoptorchStaticInit.hpp\"\n#inclu"
  },
  {
    "path": "poptorch/source/popart_canonicalization/ReshapeOps.cpp",
    "chars": 39317,
    "preview": "// Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n\n#include <torch/csrc/jit/ir/ir.h>\n\n#include \"../PoptorchStati"
  },
  {
    "path": "poptorch/source/popart_canonicalization/ScatterReduction.cpp",
    "chars": 1547,
    "preview": "// Copyright (c) 2023 Graphcore Ltd. All rights reserved.\n\n#include \"ScatterReduction.hpp\"\n#include \"PopartCanonicalizat"
  },
  {
    "path": "poptorch/source/popart_canonicalization/ScatterReduction.hpp",
    "chars": 453,
    "preview": "// Copyright (c) 2023 Graphcore Ltd. All rights reserved.\n#ifndef SCATTER_REDUCTION_H\n#define SCATTER_REDUCTION_H\n\n#incl"
  },
  {
    "path": "poptorch/source/popart_canonicalization/SliceOps.cpp",
    "chars": 18705,
    "preview": "// Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n\n#include <torch/csrc/jit/ir/ir.h>\n\n#include <algorithm>\n#incl"
  },
  {
    "path": "poptorch/source/popart_canonicalization/SoftmaxOps.cpp",
    "chars": 2579,
    "preview": "// Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n#include \"../PoptorchStaticInit.hpp\"\n#include \"PopartCanonical"
  },
  {
    "path": "poptorch/source/popart_canonicalization/TensorOps.cpp",
    "chars": 21037,
    "preview": "// Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n#include \"../PoptorchStaticInit.hpp\"\n#include \"PopartCanonical"
  },
  {
    "path": "poptorch/source/popart_canonicalization/pyg_torch_cluster/FpsOp.cpp",
    "chars": 7951,
    "preview": "// Copyright (c) 2023 Graphcore Ltd. All rights reserved.\n\n#include <random>\n\n#include <ATen/ExpandUtils.h>\n\n#include \"."
  },
  {
    "path": "poptorch/source/popart_canonicalization/pyg_torch_cluster/GridOp.cpp",
    "chars": 3105,
    "preview": "// Copyright (c) 2022 Graphcore Ltd. All rights reserved.\n#include \"../PopartCanonicalizationUtils.hpp\"\n#include \"../Pop"
  },
  {
    "path": "poptorch/source/popart_canonicalization/pyg_torch_cluster/NearestOp.cpp",
    "chars": 10541,
    "preview": "// Copyright (c) 2023 Graphcore Ltd. All rights reserved.\n\n#include <random>\n\n#include <ATen/ExpandUtils.h>\n\n#include \"."
  },
  {
    "path": "poptorch/source/type_and_constant_canonicalization/AddListNumElements.cpp",
    "chars": 2693,
    "preview": "// Copyright (c) 2021 Graphcore Ltd. All rights reserved.\n\n#include <torch/csrc/jit/ir/ir.h>\n\n#include <memory>\n#include"
  },
  {
    "path": "poptorch/source/type_and_constant_canonicalization/CanonicaliseConstants.cpp",
    "chars": 23595,
    "preview": "// Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n\n#include <ATen/ATen.h>\n#include <torch/csrc/jit/ir/ir.h>\n#inc"
  },
  {
    "path": "poptorch/source/type_and_constant_canonicalization/CastUnsupportedInputs.cpp",
    "chars": 1790,
    "preview": "// Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n\n#include \"torch/csrc/jit/ir/ir.h\"\n\n#include \"poptorch_logging"
  },
  {
    "path": "poptorch/source/type_and_constant_canonicalization/CheckAndChangeOutputTypes.cpp",
    "chars": 7391,
    "preview": "// Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n\n#include <torch/csrc/jit/ir/ir.h>\n\n#include <sstream>\n\n#inclu"
  },
  {
    "path": "poptorch/source/type_and_constant_canonicalization/EvaluateConstexprs.cpp",
    "chars": 12231,
    "preview": "// Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n\n#include <torch/csrc/jit/ir/ir.h>\n#include <torch/csrc/jit/ru"
  },
  {
    "path": "poptorch/source/type_and_constant_canonicalization/MakeConstantIntParams.cpp",
    "chars": 3336,
    "preview": "// Copyright (c) 2020 Graphcore Ltd. All rights reserved.\n#include <torch/csrc/jit/ir/ir.h>\n\n#include <algorithm>\n\n#incl"
  },
  {
    "path": "poptorch_compiler/pytorch_bridge/CMakeLists.txt",
    "chars": 812,
    "preview": "file(GLOB_RECURSE poptorch_compiler_public_headers \"${CMAKE_CURRENT_SOURCE_DIR}/include/*.hpp*\")\n\nadd_library(poptorch_c"
  },
  {
    "path": "poptorch_compiler/pytorch_bridge/IpuSession.cpp",
    "chars": 2415,
    "preview": "// Copyright (c) 2022 Graphcore Ltd. All rights reserved.\n#include \"pytorch_bridge/IpuSession.hpp\"\n\n#include <chrono>\n#i"
  },
  {
    "path": "poptorch_compiler/pytorch_bridge/include/pytorch_bridge/CompilerOptions.hpp",
    "chars": 495,
    "preview": "// Copyright (c) 2022 Graphcore Ltd. All rights reserved.\n#ifndef POPTORCH_COMPILER_PYTORCH_BRIDGE_COMPILER_OPTIONS_HPP_"
  },
  {
    "path": "poptorch_compiler/pytorch_bridge/include/pytorch_bridge/CompilerTypes.hpp",
    "chars": 2455,
    "preview": "// Copyright (c) 2021 Graphcore Ltd. All rights reserved.\n#ifndef POPTORCH_COMPILER_PYTORCH_BRIDGE_COMPILER_TYPES_HPP_\n#"
  },
  {
    "path": "poptorch_compiler/pytorch_bridge/include/pytorch_bridge/DebugInfo.hpp",
    "chars": 592,
    "preview": "// Copyright (c) 2022 Graphcore Ltd. All rights reserved.\n#ifndef POPTORCH_COMPILER_PYTORCH_BRIDGE_DEBUG_INFO_HPP_\n#defi"
  },
  {
    "path": "poptorch_compiler/pytorch_bridge/include/pytorch_bridge/IpuSession.hpp",
    "chars": 1414,
    "preview": "// Copyright (c) 2022 Graphcore Ltd. All rights reserved.\n#ifndef POPTORCH_COMPILER_PYTORCH_BRIDGE_IPU_SESSION_HPP_\n#def"
  },
  {
    "path": "poptorch_err/CMakeLists.txt",
    "chars": 1210,
    "preview": "cmake_minimum_required(VERSION 3.14 FATAL_ERROR)\nproject(poptorch_err)\n\nset(CMAKE_POSITION_INDEPENDENT_CODE ON)\n\nadd_lib"
  }
]

// ... and 337 more files (download for full content)

About this extraction

This page contains the full source code of the graphcore/poptorch GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 537 files (3.4 MB), approximately 926.8k tokens, and a symbol index with 3940 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.

Copied to clipboard!