repo
stringlengths
1
152
file
stringlengths
14
221
code
stringlengths
501
25k
file_length
int64
501
25k
avg_line_length
float64
20
99.5
max_line_length
int64
21
134
extension_type
stringclasses
2 values
null
pytorch-main/third_party/nvfuser/csrc/lower_trivial_reductions.h
#pragma once #include <c10/macros/Export.h> #include <dispatch.h> #include <ir_all_nodes.h> #include <kernel_ir.h> #include <unordered_set> namespace torch { namespace jit { namespace fuser { namespace cuda { //! Detect almost all IterDomains that are derived from trivial //! reductons. class TORCH_CUDA_CU_API Tri...
1,385
28.489362
71
h
null
pytorch-main/third_party/nvfuser/csrc/lower_unroll.h
#pragma once #include <c10/macros/Export.h> #include <kernel_ir.h> #include <kernel_ir_dispatch.h> #include <lower_thread_predicate.h> #include <lower_utils.h> #include <root_domain_map.h> #include <bitset> #include <unordered_map> namespace torch { namespace jit { namespace fuser { namespace cuda { //! Unroll pass...
2,868
27.69
80
h
null
pytorch-main/third_party/nvfuser/csrc/lower_utils.h
#pragma once #include <c10/macros/Export.h> #include <compute_at_map.h> #include <ir_all_nodes.h> #include <kernel_ir.h> #include <parallel_type_bitmap.h> #include <bitset> #include <map> // Provides utilities for dealing with nested ForLoop and IfThenElse scopes namespace torch { namespace jit { namespace fuser ...
10,069
35.353791
80
h
null
pytorch-main/third_party/nvfuser/csrc/lower_validation.h
#pragma once #include <c10/macros/Export.h> #include <ir_all_nodes.h> namespace torch { namespace jit { namespace fuser { namespace cuda { class ContigIDs; void validateIr(Fusion* fusion); //! Validate vectorization and collect information on vectorization //! used in code generation as well as runtime validation...
2,888
36.519481
70
h
null
pytorch-main/third_party/nvfuser/csrc/manager.h
#pragma once #include <c10/macros/Export.h> #include <torch/csrc/jit/ir/ir.h> /* * This file handles compilation and execution of a CudaFusionGroup; * * A CudaFusionGroup node comes with `attr::Subgraph` containing the computation * graph. We compile the graph to generate CUDA function and cache them in a * regi...
1,266
29.902439
80
h
null
pytorch-main/third_party/nvfuser/csrc/maxinfo_propagator.h
#pragma once #include <ir_interface_nodes.h> #include <ir_utils.h> namespace torch { namespace jit { namespace fuser { namespace cuda { /* * MaxInfoSpanningTree is class that generates a path to visit TensorViews in a * DAG. The generated path is a maximum spanning tree of the DAG with the root * at the reference...
10,992
37.98227
80
h
null
pytorch-main/third_party/nvfuser/csrc/mma_type.h
#pragma once #include <c10/macros/Export.h> #include <fusion.h> namespace torch { namespace jit { namespace fuser { namespace cuda { //! Utility data structure for recording gemm tiles struct GemmTile { int m, n, k; GemmTile(int m_, int n_, int k_) : m(m_), n(n_), k(k_) {} bool operator==(const GemmTile& other...
6,999
35.082474
78
h
null
pytorch-main/third_party/nvfuser/csrc/mutator.h
#pragma once #include <c10/macros/Export.h> #include <dispatch.h> #include <ir_base_nodes.h> #include <unordered_map> namespace torch { namespace jit { namespace fuser { namespace cuda { /* * Mutators are the mechanism used to modify IR nodes. Since most nodes are * immutable or at least partially immutable chan...
828
27.586207
80
h
null
pytorch-main/third_party/nvfuser/csrc/non_divisible_split.h
#pragma once #include <c10/macros/Export.h> #include <ir_all_nodes.h> #include <iter_visitor.h> namespace torch { namespace jit { namespace fuser { namespace cuda { //! If an IterDomain is split and its inner output domain is //! eventually split too, the second split must be divisible or the //! inner domain must ...
2,484
29.679012
76
h
null
pytorch-main/third_party/nvfuser/csrc/parallel_dimension_map.h
#pragma once #include <ir_all_nodes.h> #include <kernel_ir.h> #include <deque> #include <unordered_map> namespace torch { namespace jit { namespace fuser { namespace cuda { //! Maps TID/BID to its dimension. It is by default blockDim/gridDim, //! but if use of a ParallelType is mapped to a unique constant //! exten...
2,426
29.721519
77
h
null
pytorch-main/third_party/nvfuser/csrc/parallel_type_bitmap.h
#pragma once #include <c10/macros/Export.h> #include <type.h> #include <array> #include <bitset> #include <map> #include <unordered_map> namespace torch { namespace jit { namespace fuser { namespace cuda { constexpr int getParallelTypeBitMapOffset(ParallelType pt) { switch (pt) { case ParallelType::BIDx: ...
7,887
22.268437
79
h
null
pytorch-main/third_party/nvfuser/csrc/parser.h
#pragma once #include <c10/macros/Export.h> #include <torch/csrc/jit/ir/ir.h> #include <torch/csrc/jit/runtime/profiling_record.h> #include <fusion.h> /* * This file handles Parsing PyTorch jit ir; * * It is used in two places: * 1. When partitioning PyTorch jit ir to create prim::CudaFusionGroup, each * ...
1,882
30.915254
79
h
null
pytorch-main/third_party/nvfuser/csrc/partial_split_map.h
#pragma once #include <c10/macros/Export.h> #include <dispatch.h> #include <ir_all_nodes.h> #include <kernel_ir.h> #include <vector> namespace torch { namespace jit { namespace fuser { namespace cuda { //! Collects start and stop offsets of all split root domains. Offsets //! are zero unless partially split. class...
717
20.117647
70
h
null
pytorch-main/third_party/nvfuser/csrc/partition.h
#pragma once #include <c10/macros/Export.h> #include <torch/csrc/jit/ir/ir.h> /* * API for query node-compatibility in CudaCodeGen * * It is used in the optimization passes, where the graph is traversed and parts * that could be handled by CudaCodegen is partitioned and stuffed in * `attr::Subgraph` of `prim::Cu...
859
25.060606
80
h
null
pytorch-main/third_party/nvfuser/csrc/predicate_compute.h
#pragma once #include <index_compute.h> #include <kernel_ir.h> #include <lower_thread_predicate.h> #include <lower_utils.h> #include <root_domain_map.h> namespace torch { namespace jit { namespace fuser { namespace cuda { class PredicateCompute { public: // ignore_internal_syncthread_ops will prevent creation of ...
5,873
28.517588
75
h
null
pytorch-main/third_party/nvfuser/csrc/register_interface.h
#pragma once #include <manager.h> #include <transform_view.h> #include <c10/macros/Export.h> #include <torch/csrc/jit/codegen/cuda/interface.h> #include <torch/csrc/jit/ir/ir.h> #include <torch/csrc/jit/passes/pass_manager.h> #include <torch/csrc/jit/runtime/profiling_record.h> /* * This file contains APIs for cuda ...
1,225
24.020408
77
h
null
pytorch-main/third_party/nvfuser/csrc/root_domain_map.h
#pragma once #include <disjoint_set.h> #include <ir_all_nodes.h> #include <iter_visitor.h> #include <utils.h> #include <c10/macros/Export.h> namespace torch { namespace jit { namespace fuser { namespace cuda { //! Generic interface for mapping root domains of a producer-consumer pair. class TORCH_CUDA_CU_API RootDo...
17,494
33.781312
80
h
null
pytorch-main/third_party/nvfuser/csrc/transform_iter.h
#pragma once #include <c10/macros/Export.h> #include <disjoint_set.h> #include <ir_all_nodes.h> #include <ir_iostream.h> #include <iter_visitor.h> #include <root_domain_map.h> #include <unordered_map> #include <vector> namespace torch { namespace jit { namespace fuser { namespace cuda { namespace { // Enable pair<...
12,427
35.339181
80
h
null
pytorch-main/third_party/nvfuser/csrc/transform_replay.h
#pragma once #include <c10/macros/Export.h> #include <c10/util/Exception.h> #include <ir_internal_nodes.h> #include <maxinfo_propagator.h> #include <algorithm> #include <unordered_map> #include <unordered_set> #include <vector> namespace torch { namespace jit { namespace fuser { namespace cuda { /* * compute_at is...
6,775
31.266667
80
h
null
pytorch-main/third_party/nvfuser/csrc/transform_rfactor.h
#pragma once #include <c10/macros/Export.h> #include <ir_all_nodes.h> #include <transform_iter.h> #include <algorithm> #include <vector> namespace torch { namespace jit { namespace fuser { namespace cuda { // TODO: Only replay dispatch is really borrowed from TransformIter, we should // reevaluate the reuse of dis...
884
25.818182
80
h
null
pytorch-main/third_party/nvfuser/csrc/transform_view.h
#pragma once #include <c10/macros/Export.h> #include <ir_all_nodes.h> #include <memory> #include <vector> namespace torch { namespace jit { namespace fuser { namespace cuda { class ViewTransform; //! //! The goal of analyzeView is to find the minimum number of transformations //! to convert from the original size...
4,244
32.96
79
h
null
pytorch-main/third_party/nvfuser/csrc/type.h
#pragma once #include <c10/core/ScalarType.h> #include <c10/util/Exception.h> #include <c10/util/Optional.h> #include <c10/macros/Export.h> #include <array> #include <cstdint> #include <iostream> #include <string> #include <unordered_set> namespace torch { namespace jit { namespace fuser { namespace cuda { // http...
11,815
25.915718
88
h
null
pytorch-main/third_party/nvfuser/csrc/type_promotion.h
#pragma once #include <ATen/Context.h> #include <ATen/native/TypeProperties.h> #include <c10/core/ScalarType.h> #include <ir_interface_nodes.h> #include <torch/csrc/jit/ir/ir.h> namespace torch { namespace jit { namespace fuser { namespace cuda { //! //! The TypePromotionConfig flags are derived from Aten/TensorIter...
2,087
28
77
h
null
pytorch-main/third_party/nvfuser/csrc/utils.h
#pragma once #include <ATen/ATen.h> #include <c10/util/Exception.h> #include <type.h> #include <torch/csrc/jit/ir/ir.h> namespace torch { namespace jit { namespace fuser { namespace cuda { void debugPrint(const c10::TensorTypePtr& type); bool is_zero_dim_tensor(const std::shared_ptr<c10::TensorType>& tensor_type); ...
5,978
32.033149
80
h
null
pytorch-main/third_party/nvfuser/csrc/vectorization_info.h
#pragma once #include <c10/macros/Export.h> #include <ir_all_nodes.h> namespace torch { namespace jit { namespace fuser { namespace cuda { struct VectorizedSetInfo { //! Producer of a vectorized set TensorView* producer_tv = nullptr; //! Consumer of a vectorized set TensorView* consumer_tv = nullptr; //! ...
749
23.193548
68
h
null
pytorch-main/third_party/nvfuser/csrc/docs/documentation.h
#error This is used exclusively for generating the documentation (not a real header) //! \namespace torch::jit::fuser //! \brief Main PyTorch JIT Fuser namespace //! \namespace torch::jit::fuser::cuda //! \brief CUDA specific components //! \namespace torch::jit::fuser::cuda::executor_utils //! \brief Fuser executo...
627
25.166667
84
h
null
pytorch-main/third_party/nvfuser/csrc/ops/alias.h
#pragma once #include <c10/macros/Export.h> #include <ir_interface_nodes.h> #include <type.h> // // The operations defined in this header is intended as user facing functions. // The user will provide the necessary input TensorViews and the function will // create the correct intermediate nodes and return the output...
1,738
24.955224
78
h
null
pytorch-main/third_party/nvfuser/csrc/ops/composite.h
#pragma once #include <c10/macros/Export.h> #include <ir_interface_nodes.h> #include <type.h> // // The operations defined in this header is intended as user facing functions. // The user will provide the necessary input TensorViews and the function will // create the correct intermediate nodes and return the output...
1,767
26.2
80
h
null
pytorch-main/third_party/nvfuser/csrc/ops/normalization.h
#pragma once #include <c10/macros/Export.h> #include <ir_interface_nodes.h> #include <type.h> // // The operations defined in this header is intended as user facing functions. // The user will provide the necessary input TensorViews and the function will // create the correct intermediate nodes and return the output...
4,460
23.113514
78
h
null
pytorch-main/third_party/nvfuser/csrc/python_frontend/fusion_cache.h
#pragma once #include <c10/macros/Export.h> #include <kernel_cache.h> #include <python_frontend/fusion_record.h> #include <memory> //! nvFuser Fusion IR namespace abbreviation namespace Nvf = torch::jit::fuser::cuda; namespace nvfuser { struct RecordFunctor; //! \struct FusionCacheEntry //! \brief Is the containe...
3,944
34.223214
77
h
null
pytorch-main/third_party/nvfuser/csrc/python_frontend/fusion_definition.h
#pragma once #include <c10/macros/Export.h> #include <kernel_cache.h> //! nvFuser Fusion IR namespace abbreviation namespace Nvf = torch::jit::fuser::cuda; namespace nvfuser { class FusionCache; class FusionInterface; struct RecordFunctor; //! This is helper function used to print a python formated //! Fusion IR D...
5,395
31.311377
80
h
null
pytorch-main/third_party/nvfuser/csrc/python_frontend/fusion_interface.h
#pragma once #include <c10/macros/Export.h> #include <kernel_cache.h> //! nvFuser Fusion IR namespace abbreviation namespace Nvf = torch::jit::fuser::cuda; namespace nvfuser { //! \class FusionInterface //! \brief Implements an Interface that represents an nvFuser IR object in //! in python. //! //! Example 1 - Def...
2,193
29.054795
79
h
null
pytorch-main/third_party/nvfuser/csrc/scheduler/compile_time_info.h
#pragma once #include <fusion.h> #include <scheduler/all_schedulers.h> #include <scheduler/pointwise_utils.h> #include <scheduler/utils.h> namespace torch { namespace jit { namespace fuser { namespace cuda { //! namespace for hosting catalog of possible compile time //! info that can be cached. Each possible entry ...
10,882
35.276667
80
h
null
pytorch-main/third_party/nvfuser/csrc/scheduler/debug_utils.h
#pragma once namespace torch { namespace jit { namespace fuser { namespace cuda { namespace scheduler_debug_utils { // Basic logging utility for any messages in scheduler or segmenter template <typename... Args> void canScheduleMessage(const Args&... args) { // Using builtin expect to reduce the overhead slightly,...
1,062
29.371429
78
h
null
pytorch-main/third_party/nvfuser/csrc/scheduler/matmul.h
#pragma once #include <ATen/core/ivalue.h> #include <fusion.h> #include <mma_type.h> namespace torch { namespace jit { namespace fuser { namespace cuda { //! Starting point for a matmul scheduler parameters: class MatmulParam { public: MatmulParam(MmaBuilder builder) : mma_builder(builder) {} struct DoubleBuf...
1,316
22.517857
59
h
null
pytorch-main/third_party/nvfuser/csrc/scheduler/mma_utils.h
#pragma once #include <fusion.h> #include <mma_type.h> namespace torch { namespace jit { namespace fuser { namespace cuda { namespace mma_util { //! [WarpMmaSwizzler]: //! This class is used to implement the thread swizzle format //! required for the mma macros, cf. PTX ISA 9.7.13.4. //! //! The mma instruc...
7,042
42.475309
80
h
null
pytorch-main/third_party/nvfuser/csrc/scheduler/normalization.h
#pragma once #include <ATen/core/ivalue.h> #include <fusion.h> #include <scheduler/reduction_heuristic.h> // TODO: If caching inputs would require persistence we are sending it to the // persistent kerenl scheduler. This isn't necessary if the only persistent // buffers are inputs as we could re-read them from globa...
1,070
26.461538
77
h
null
pytorch-main/third_party/nvfuser/csrc/scheduler/pointwise.h
#pragma once #include <ATen/core/ivalue.h> #include <fusion.h> #include <scheduler/pointwise_heuristic.h> namespace torch { namespace jit { namespace fuser { namespace cuda { /* * The 2D pointwise scheduling logic is a bit interesting. We'll start by giving * motivation for what the scheduling is attempting to do...
8,430
45.58011
80
h
null
pytorch-main/third_party/nvfuser/csrc/scheduler/pointwise_heuristic.h
#pragma once #include <scheduler/heuristic.h> #include <sstream> namespace torch { namespace jit { namespace fuser { namespace cuda { // Parameters of the pointwise heuristic to describe the optimial schedule. // Warning: equal operator is intended for use in caching the kernel associated // with these pointwise pa...
3,639
32.090909
80
h
null
pytorch-main/third_party/nvfuser/csrc/scheduler/pointwise_utils.h
#pragma once #include <compute_at_map.h> #include <ir_all_nodes.h> #include <ir_utils.h> #include <scheduler/utils.h> namespace torch { namespace jit { namespace fuser { namespace cuda { namespace pointwise_utils { // DomainMap uses the ComputeAtMap to find a reference TensorView // that maps to all IterDomains in t...
2,018
26.657534
76
h
null
pytorch-main/third_party/nvfuser/csrc/scheduler/reduction.h
#pragma once #include <ATen/core/ivalue.h> #include <fusion.h> #include <scheduler/reduction_heuristic.h> namespace torch { namespace jit { namespace fuser { namespace cuda { class SchedulerRuntimeInfo; class HeuristicSummary; TORCH_CUDA_CU_API std::shared_ptr<ReductionParams> getReductionHeuristics( Fusion* f...
787
22.878788
74
h
null
pytorch-main/third_party/nvfuser/csrc/scheduler/reduction_heuristic.h
#pragma once #include <scheduler/heuristic.h> #include <sstream> namespace torch { namespace jit { namespace fuser { namespace cuda { // Parameters of the reduction heuristic to describe the optimial schedule. // Warning: equal operator is intended for use in caching the kernel associated // with these reduction pa...
11,263
42.323077
80
h
null
pytorch-main/third_party/nvfuser/csrc/scheduler/reduction_utils.h
#pragma once #include <fusion.h> #include <ir_all_nodes.h> #include <scheduler/reduction_heuristic.h> namespace torch { namespace jit { namespace fuser { namespace cuda { namespace reduction_scheduler_utils { // Consistent parallelization based on provided reduction parameters. Provided // tensor is expected to be ...
1,924
34.648148
80
h
null
pytorch-main/third_party/nvfuser/csrc/scheduler/registry.h
#pragma once #include <executor_kernel_arg.h> #include <fusion.h> #include <scheduler/all_schedulers.h> #include <scheduler/compile_time_info.h> #include <scheduler/heuristic.h> #include <scheduler/pointwise_heuristic.h> #include <scheduler/reduction_heuristic.h> #include <scheduler/utils.h> #include <utils.h> namespa...
8,229
32.729508
80
h
null
pytorch-main/third_party/nvfuser/csrc/scheduler/transpose.h
#pragma once #include <ATen/core/ivalue.h> #include <fusion.h> #include <scheduler/transpose_heuristic.h> #define SUPPORT_SPLITTING_INNERMOST_DIM 0 namespace torch { namespace jit { namespace fuser { namespace cuda { // Note [Transpose scheduling] // // The target of transpose scheduling is to get coalesced global...
5,628
47.525862
80
h
null
pytorch-main/third_party/nvfuser/csrc/scheduler/transpose_heuristic.h
#pragma once #include <c10/util/hash.h> #include <scheduler/heuristic.h> #include <utils.h> #include <sstream> namespace torch { namespace jit { namespace fuser { namespace cuda { // Parameters of the transpose heuristic to describe the optimial schedule. // Warning: equal operator is intended for use in caching th...
5,296
31.29878
80
h
null
pytorch-main/third_party/nvfuser/csrc/scheduler/utils.h
#pragma once #include <disjoint_set.h> #include <fusion.h> #include <ir_all_nodes.h> #include <maxinfo_propagator.h> #include <scheduler/reduction_heuristic.h> namespace torch { namespace jit { namespace fuser { namespace cuda { class SchedulerRuntimeInfo; class ExpressionEvaluator; class HeuristicSummary; namespac...
22,068
39.568015
80
h
null
pytorch-main/third_party/nvfuser/csrc/scheduler/vectorize_helper.h
#pragma once #include <fusion.h> #include <ir_all_nodes.h> #include <scheduler/registry.h> #include <vector> namespace torch { namespace jit { namespace fuser { namespace cuda { namespace vectorize_helper { // Grab all values and expressions used to make the merged_domain and remove // them from the fusion void cle...
1,442
30.369565
80
h
null
pytorch-main/third_party/nvfuser/test/test_gpu_validator.h
#pragma once #include <executor_utils.h> #include <expr_evaluator.h> #include <fusion.h> #include <ir_iostream.h> #include <lower_utils.h> #include <ATen/cuda/CUDAContext.h> #include <unordered_map> // Tests go in torch::jit namespace torch { namespace jit { using namespace torch::jit::fuser::cuda; namespace { s...
15,187
33.439909
104
h
null
pytorch-main/third_party/nvfuser/test/test_utils.h
#pragma once #include <executor.h> #include <expr_evaluator.h> #include <ir_all_nodes.h> #include <kernel_ir_dispatch.h> #include <lower2device.h> #include <lower_magic_zero.h> #include <transform_replay.h> #include <ATen/Context.h> #include <ATen/cuda/CUDAContext.h> #include <c10/cuda/CUDACachingAllocator.h> #includ...
11,675
30.219251
80
h
null
pytorch-main/third_party/valgrind-headers/callgrind.h
/* ---------------------------------------------------------------- Notice that the following BSD-style license applies to this one file (callgrind.h) only. The rest of Valgrind is licensed under the terms of the GNU General Public License, version 2, unless otherwise indicated. See the COPYING file ...
5,744
43.192308
74
h
null
pytorch-main/tools/autograd/templates/Functions.h
#pragma once // ${generated_comment} #include <ATen/ATen.h> #include <ATen/core/functional.h> #include <ATen/TensorGeometry.h> #include "torch/csrc/autograd/function.h" #include "torch/csrc/autograd/variable.h" #include "torch/csrc/autograd/saved_variable.h" #include <torch/csrc/Export.h> #include <c10/core/SymIntA...
1,350
25.490196
89
h
null
pytorch-main/tools/autograd/templates/VariableType.h
#pragma once // ${generated_comment} #include <ATen/core/Tensor.h> #include <ATen/Context.h> #include <c10/util/intrusive_ptr.h> #include <torch/csrc/Export.h> #include <torch/csrc/autograd/autograd_not_implemented_fallback.h> #include <cstdint> // for size_t #include <functional> // for function #include <memory>...
1,606
26.237288
83
h
null
pytorch-main/tools/autograd/templates/variable_factories.h
#pragma once // ${generated_comment} #include <ATen/core/Tensor.h> #include <ATen/TracerMode.h> #include <ATen/core/grad_mode.h> #include <c10/util/ArrayRef.h> #include <c10/core/MemoryFormat.h> #include <torch/csrc/api/include/torch/detail/TensorDataContainer.h> #include <torch/csrc/autograd/variable.h> #ifndef AT_...
5,627
40.382353
116
h
null
pytorch-main/torch/custom_class.h
#pragma once #include <ATen/core/builtin_function.h> #include <ATen/core/function_schema.h> #include <ATen/core/ivalue.h> #include <ATen/core/class_type.h> #include <ATen/core/op_registration/infer_schema.h> #include <ATen/core/stack.h> #include <c10/util/C++17.h> #include <c10/util/Metaprogramming.h> #include <c10/ut...
19,826
37.350097
97
h
null
pytorch-main/torch/custom_class_detail.h
#pragma once #include <ATen/core/boxing/impl/make_boxed_from_unboxed_functor.h> #include <ATen/core/function.h> #include <c10/util/Metaprogramming.h> #include <c10/util/TypeTraits.h> #include <c10/util/irange.h> namespace torch { namespace detail { /** * In the Facebook internal build (using BUCK), this macro is en...
7,771
31.383333
80
h
null
pytorch-main/torch/_inductor/codegen/cpp_prefix.h
#pragma once #include <algorithm> #include <atomic> #include <cmath> #include <cstdlib> #include <limits> #include <omp.h> #include <ATen/NumericUtils.h> #include <ATen/core/PhiloxRNGEngine.h> #include <ATen/native/BinaryOps.h> #include <ATen/native/Math.h> #include <c10/util/BFloat16.h> #include <c10/util/Half.h> ...
9,020
27.729299
98
h
null
pytorch-main/torch/csrc/CudaIPCTypes.h
#pragma once #ifdef USE_CUDA #include <c10/core/Allocator.h> #include <c10/cuda/CUDACachingAllocator.h> #include <c10/cuda/CUDAException.h> #include <c10/cuda/CUDAGuard.h> #include <c10/cuda/CUDAStream.h> #include <c10/util/Logging.h> #include <cuda_runtime_api.h> #include <torch/csrc/Export.h> #include <cstddef> names...
3,474
22.639456
80
h
null
pytorch-main/torch/csrc/Dtype.h
#pragma once #include <c10/core/ScalarType.h> #include <torch/csrc/Export.h> #include <torch/csrc/python_headers.h> const int DTYPE_NAME_LEN = 64; struct TORCH_API THPDtype { PyObject_HEAD at::ScalarType scalar_type; // NOLINTNEXTLINE(cppcoreguidelines-avoid-c-arrays,modernize-avoid-c-arrays) char name[DTYPE_N...
785
24.354839
78
h
null
pytorch-main/torch/csrc/DynamicTypes.h
#pragma once // Provides conversions between Python tensor objects and at::Tensor. #include <torch/csrc/python_headers.h> #include <ATen/Device.h> #include <c10/core/Backend.h> #include <c10/core/Layout.h> #include <c10/core/ScalarType.h> #include <c10/core/ScalarTypeToTypeMeta.h> #include <torch/csrc/Export.h> #in...
975
24.025641
70
h
null
pytorch-main/torch/csrc/Exceptions.h
#pragma once #include <exception> #include <memory> #include <mutex> #include <queue> #include <string> #include <system_error> #include <ATen/detail/FunctionTraits.h> #include <c10/util/C++17.h> #include <c10/util/Exception.h> #include <c10/util/StringUtil.h> #include <pybind11/pybind11.h> #include <torch/csrc/Expor...
16,101
36.621495
80
h
null
pytorch-main/torch/csrc/Generator.h
#pragma once #include <ATen/core/Generator.h> #include <torch/csrc/Export.h> #include <torch/csrc/python_headers.h> // NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init) struct THPGenerator { PyObject_HEAD at::Generator cdata; }; // Creates a new Python object wrapping the default at::Generator. The reference ...
970
32.482759
80
h
null
pytorch-main/torch/csrc/MemoryFormat.h
#pragma once #include <torch/csrc/python_headers.h> #include <c10/core/MemoryFormat.h> #include <string> const int MEMORY_FORMAT_NAME_LEN = 64; struct THPMemoryFormat { PyObject_HEAD at::MemoryFormat memory_format; // NOLINTNEXTLINE(cppcoreguidelines-avoid-c-arrays,modernize-avoid-c-arrays) char name[MEMORY_...
632
21.607143
78
h
null
pytorch-main/torch/csrc/QScheme.h
#pragma once #include <torch/csrc/python_headers.h> #include <c10/core/QScheme.h> #include <string> constexpr int QSCHEME_NAME_LEN = 64; struct THPQScheme { PyObject_HEAD at::QScheme qscheme; // NOLINTNEXTLINE(cppcoreguidelines-avoid-c-arrays,modernize-avoid-c-arrays) char name[QSCHEME_NAME_LEN + 1]; }; ext...
558
20.5
78
h
null
pytorch-main/torch/csrc/Storage.h
#ifndef THP_STORAGE_INC #define THP_STORAGE_INC #include <torch/csrc/Types.h> #define THPStorageStr "torch.UntypedStorage" namespace c10 { template <> struct MaybeOwnedTraits<c10::Storage> { using owned_type = c10::Storage; using borrow_type = c10::Storage; static borrow_type createBorrow(const owned_type& f...
2,170
21.381443
78
h
null
pytorch-main/torch/csrc/Stream.h
#ifndef THP_STREAM_INC #define THP_STREAM_INC #include <c10/core/Stream.h> #include <c10/macros/Export.h> #include <torch/csrc/python_headers.h> struct THPStream { PyObject_HEAD int64_t stream_id; int64_t device_type; int64_t device_index; }; extern TORCH_API PyTypeObject* THPStreamClass; void THPStream_init(P...
546
21.791667
79
h
null
pytorch-main/torch/csrc/THConcat.h
#pragma once #define TH_CONCAT_STRING_2(x, y) TH_CONCAT_STRING_2_EXPAND(x, y) #define TH_CONCAT_STRING_2_EXPAND(x, y) #x #y #define TH_CONCAT_STRING_3(x, y, z) TH_CONCAT_STRING_3_EXPAND(x, y, z) #define TH_CONCAT_STRING_3_EXPAND(x, y, z) #x #y #z #define TH_CONCAT_STRING_4(x, y, z, w) TH_CONCAT_STRING_4_EXPAND(x, y,...
691
33.6
76
h
null
pytorch-main/torch/csrc/THP.h
#ifndef THP_H #define THP_H #include <torch/csrc/Export.h> #include <torch/csrc/python_headers.h> // Back-compatibility macros, Thanks to http://cx-oracle.sourceforge.net/ // define PyInt_* macros for Python 3.x. NB: We must include Python.h first, // otherwise we'll incorrectly conclude PyInt_Check isn't defined! #...
894
27.870968
79
h
null
pytorch-main/torch/csrc/copy_utils.h
#pragma once #include <torch/csrc/Types.h> #include <functional> #include <vector> typedef std::function<void(PyObject*, PyObject*, bool)> THPCopyFunction; // NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init) struct THPCopyInfo { PyTypeObject* srcType; // Python type of src tensor/storage THPCopyFunction cop...
1,351
25.509804
73
h
null
pytorch-main/torch/csrc/python_headers.h
#pragma once // workaround for https://github.com/python/cpython/pull/23326 #include <cmath> #include <complex> // workaround for Python 2 issue: https://bugs.python.org/issue17120 // NOTE: It looks like this affects Python 3 as well. #pragma push_macro("_XOPEN_SOURCE") #pragma push_macro("_POSIX_C_SOURCE") #undef _XOP...
649
24
80
h
null
pytorch-main/torch/csrc/serialization.h
#ifndef THP_SERIALIZATION_INC #define THP_SERIALIZATION_INC template <class io> void doRead(io fildes, void* buf, size_t nbytes); template <class io> void doWrite(io fildes, void* buf, size_t nbytes); // Note that this takes a mutable storage because it may pass through // to at::from_blob. template <class io> void ...
611
22.538462
69
h
null
pytorch-main/torch/csrc/utils.h
#ifndef THP_UTILS_H #define THP_UTILS_H #include <ATen/ATen.h> #include <torch/csrc/Storage.h> #include <torch/csrc/THConcat.h> #include <torch/csrc/utils/object_ptr.h> #include <torch/csrc/utils/python_compat.h> #include <torch/csrc/utils/python_numbers.h> #include <string> #include <type_traits> #include <vector> #...
9,668
41.407895
80
h
null
pytorch-main/torch/csrc/api/include/torch/all.h
#pragma once #if !defined(_MSC_VER) && __cplusplus < 201703L #error C++17 or later compatible compiler is required to use PyTorch. #endif #include <torch/autograd.h> #include <torch/cuda.h> #include <torch/data.h> #include <torch/enum.h> #include <torch/fft.h> #include <torch/jit.h> #include <torch/linalg.h> #include...
567
22.666667
69
h
null
pytorch-main/torch/csrc/api/include/torch/arg.h
#pragma once #include <utility> #define TORCH_ARG(T, name) \ public: \ inline auto name(const T& new_##name)->decltype(*this) { /* NOLINT */ \ this->name##_ = new_##name; ...
1,391
57
73
h
null
pytorch-main/torch/csrc/api/include/torch/cuda.h
#pragma once #include <torch/csrc/Export.h> #include <cstddef> #include <cstdint> namespace torch { namespace cuda { /// Returns the number of CUDA devices available. size_t TORCH_API device_count(); /// Returns true if at least one CUDA device is available. bool TORCH_API is_available(); /// Returns true if CUDA...
738
22.83871
70
h
null
pytorch-main/torch/csrc/api/include/torch/enum.h
#pragma once #include <string> #include <ATen/core/Reduction.h> #include <c10/util/Exception.h> #include <c10/util/variant.h> #include <torch/csrc/Export.h> #define TORCH_ENUM_DECLARE(name) \ namespace torch { \ namespace enum...
7,388
33.690141
80
h
null
pytorch-main/torch/csrc/api/include/torch/expanding_array.h
#pragma once #include <c10/util/ArrayRef.h> #include <c10/util/Exception.h> #include <c10/util/Optional.h> #include <c10/util/irange.h> #include <algorithm> #include <array> #include <cstdint> #include <initializer_list> #include <string> #include <vector> namespace torch { /// A utility class that accepts either a...
6,673
35.469945
80
h
null
pytorch-main/torch/csrc/api/include/torch/fft.h
#pragma once #include <ATen/ATen.h> namespace torch { namespace fft { /// Computes the 1 dimensional fast Fourier transform over a given dimension. /// See https://pytorch.org/docs/master/fft.html#torch.fft.fft. /// /// Example: /// ``` /// auto t = torch::randn(128, dtype=kComplexDouble); /// torch::fft::fft(t); //...
12,062
29.930769
80
h
null
pytorch-main/torch/csrc/api/include/torch/imethod.h
#pragma once #include <ATen/core/ivalue.h> #include <vector> namespace torch { class TORCH_API IMethod { /* IMethod provides a portable interface for torch methods, whether they are backed by torchscript or python/deploy. This is helpful since torchscript methods provide additional information (e.g. Functi...
1,539
30.428571
77
h
null
pytorch-main/torch/csrc/api/include/torch/jit.h
#pragma once #include <torch/csrc/Export.h> #include <torch/csrc/jit/api/module.h> #include <memory> #include <string> namespace torch { namespace jit { /// Compiles script code into an executable graph. /// /// Takes a string containing functions in script syntax and compiles them into /// a module (graph). The re...
913
23.702703
79
h
null
pytorch-main/torch/csrc/api/include/torch/mps.h
#pragma once #include <torch/csrc/Export.h> #include <cstddef> #include <cstdint> #ifdef __OBJC__ #include <Foundation/Foundation.h> #include <Metal/Metal.h> using MTLCommandBuffer_t = id<MTLCommandBuffer>; using DispatchQueue_t = dispatch_queue_t; #else using MTLCommandBuffer_t = void*; using DispatchQueue_t = void...
1,219
26.111111
74
h
null
pytorch-main/torch/csrc/api/include/torch/nested.h
#pragma once #include <ATen/ATen.h> #include <ATen/core/ATen_fwd.h> #include <torch/csrc/api/include/torch/detail/TensorDataContainer.h> #include <algorithm> namespace torch { namespace nested { /// Nested tensor /// /// See /// https://pytorch.org/docs/master/nested.html#torch.nested.nested_tensor /// /// ``` // im...
2,804
28.21875
79
h
null
pytorch-main/torch/csrc/api/include/torch/ordered_dict.h
#pragma once #include <cstdint> #include <initializer_list> #include <string> #include <unordered_map> #include <utility> #include <vector> namespace torch { /// An ordered dictionary implementation, akin to Python's `OrderedDict`. template <typename Key, typename Value> class OrderedDict { public: /// A (key, val...
16,218
30.371373
80
h
null
pytorch-main/torch/csrc/api/include/torch/python.h
#pragma once #include <torch/detail/static.h> #include <torch/nn/module.h> #include <torch/ordered_dict.h> #include <torch/types.h> #include <torch/csrc/Device.h> #include <torch/csrc/Dtype.h> #include <torch/csrc/DynamicTypes.h> #include <torch/csrc/Exceptions.h> #include <torch/csrc/autograd/python_variable.h> #inc...
9,916
36.707224
116
h
null
pytorch-main/torch/csrc/api/include/torch/serialize.h
#pragma once #include <c10/util/irange.h> #include <torch/csrc/Export.h> #include <torch/serialize/archive.h> #include <torch/serialize/tensor.h> #include <utility> namespace torch { /// Serializes the given `value`. /// There must be an overload of `operator<<` between `serialize::OutputArchive` /// and `Value` fo...
5,168
34.648276
80
h
null
pytorch-main/torch/csrc/api/include/torch/types.h
#pragma once #include <ATen/ATen.h> #include <c10/util/Optional.h> #include <torch/csrc/autograd/generated/variable_factories.h> #include <torch/csrc/autograd/variable.h> // TODO: These don't really belong here but torchvision builds in CI need them // Remove once the torchvision version being compiled in CI is upd...
2,300
33.863636
80
h
null
pytorch-main/torch/csrc/api/include/torch/utils.h
#pragma once #include <ATen/Parallel.h> #include <ATen/record_function.h> #include <torch/csrc/api/include/torch/types.h> #include <torch/csrc/autograd/grad_mode.h> #include <torch/csrc/autograd/profiler.h> #include <cstdint> namespace torch { /// A RAII, thread-local guard that disabled gradient calculation. /// //...
3,512
29.025641
78
h
null
pytorch-main/torch/csrc/api/include/torch/data/dataloader.h
#pragma once #include <torch/data/dataloader/stateful.h> #include <torch/data/dataloader/stateless.h> #include <torch/csrc/utils/memory.h> #include <torch/csrc/utils/variadic.h> #include <c10/util/Exception.h> #include <cstddef> #include <memory> #include <type_traits> #include <utility> namespace torch { namespac...
2,010
33.084746
80
h
null
pytorch-main/torch/csrc/api/include/torch/data/dataloader_options.h
#pragma once #include <torch/arg.h> #include <torch/types.h> #include <chrono> #include <cstddef> namespace torch { namespace data { /// Options to configure a `DataLoader`. struct DataLoaderOptions { DataLoaderOptions() = default; /* implicit */ DataLoaderOptions(size_t batch_size) : batch_size_(batch_si...
2,207
32.454545
80
h
null
pytorch-main/torch/csrc/api/include/torch/data/example.h
#pragma once #include <torch/types.h> namespace torch { namespace data { /// An `Example` from a dataset. /// /// A dataset consists of data and an associated target (label). template <typename Data = at::Tensor, typename Target = at::Tensor> struct Example { using DataType = Data; using TargetType = Target; ...
1,314
22.482143
75
h
null
pytorch-main/torch/csrc/api/include/torch/data/iterator.h
#pragma once #include <torch/csrc/utils/variadic.h> #include <torch/types.h> #include <c10/util/Exception.h> #include <functional> #include <iterator> #include <memory> #include <type_traits> #include <utility> namespace torch { namespace data { namespace detail { // For increased safety and more separated logic, t...
5,284
28.52514
80
h
null
pytorch-main/torch/csrc/api/include/torch/data/worker_exception.h
#pragma once #include <exception> #include <string> #include <utility> namespace torch { namespace data { /// An exception thrown when a DataLoader's worker thread throws an exception, /// which is caught. A `WorkerException` stores an `exception_ptr` to the /// original exception thrown in the worker thread. struct...
1,088
26.923077
78
h
null
pytorch-main/torch/csrc/api/include/torch/data/dataloader/base.h
#pragma once #include <torch/data/dataloader_options.h> #include <torch/data/detail/data_shuttle.h> #include <torch/data/detail/sequencers.h> #include <torch/data/iterator.h> #include <torch/data/samplers/random.h> #include <torch/data/worker_exception.h> #include <torch/types.h> #include <torch/csrc/utils/memory.h> ...
9,145
34.449612
80
h
null
pytorch-main/torch/csrc/api/include/torch/data/dataloader/stateful.h
#pragma once #include <c10/util/irange.h> #include <torch/data/dataloader/base.h> #include <cstddef> #include <thread> #include <utility> namespace torch { namespace data { /// A dataloader for stateful datasets. /// /// A dataloader for stateful datatasets differs from one for stateless /// datasets one in that th...
2,376
35.015152
79
h
null
pytorch-main/torch/csrc/api/include/torch/data/dataloader/stateless.h
#pragma once #include <torch/data/dataloader/base.h> #include <torch/data/worker_exception.h> #include <torch/csrc/utils/memory.h> #include <c10/util/Exception.h> #include <c10/util/irange.h> #include <cstddef> #include <thread> #include <utility> namespace torch { namespace data { /// A dataloader for stateless ...
2,813
32.105882
80
h
null
pytorch-main/torch/csrc/api/include/torch/data/datasets/base.h
#pragma once #include <torch/data/example.h> #include <torch/types.h> #include <c10/util/ArrayRef.h> #include <cstddef> #include <cstdint> #include <type_traits> #include <utility> #include <vector> namespace torch { namespace data { namespace datasets { template <typename S, typename T> class MapDataset; template ...
3,255
30.307692
80
h
null
pytorch-main/torch/csrc/api/include/torch/data/datasets/chunk.h
#pragma once #include <c10/util/irange.h> #include <torch/arg.h> #include <torch/csrc/utils/memory.h> #include <torch/data/datasets/stateful.h> #include <torch/data/samplers.h> #include <queue> #include <thread> #include <torch/serialize.h> namespace torch { namespace data { namespace datasets { /// Interface for c...
19,205
35.169492
84
h
null
pytorch-main/torch/csrc/api/include/torch/data/datasets/map.h
#pragma once #include <torch/data/datasets/base.h> #include <torch/types.h> #include <c10/util/ArrayRef.h> #include <cstddef> #include <type_traits> #include <utility> namespace torch { namespace data { namespace datasets { namespace detail { template <bool C, typename T> using optional_if_t = typename std::conditi...
4,149
33.87395
80
h
null
pytorch-main/torch/csrc/api/include/torch/data/datasets/mnist.h
#pragma once #include <torch/data/datasets/base.h> #include <torch/data/example.h> #include <torch/types.h> #include <torch/csrc/Export.h> #include <cstddef> #include <string> namespace torch { namespace data { namespace datasets { /// The MNIST dataset. class TORCH_API MNIST : public Dataset<MNIST> { public: //...
1,274
25.020408
75
h
null
pytorch-main/torch/csrc/api/include/torch/data/datasets/shared.h
#pragma once #include <torch/data/datasets/base.h> #include <memory> #include <utility> namespace torch { namespace data { namespace datasets { /// A dataset that wraps another dataset in a shared pointer and implements the /// `BatchDataset` API, delegating all calls to the shared instance. This is /// useful when...
2,640
30.440476
80
h