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/torch/csrc/dynamo/cpython_defs.h
#pragma once #include <Python.h> #include <torch/csrc/utils/python_compat.h> // Functions that need to be copied from the CPython source // should go in cpython_defs.c. Copying is required when, e.g., // we need to call internal CPython functions that are not exposed. #if IS_PYTHON_3_11_PLUS #include <internal/pyco...
559
23.347826
67
h
null
pytorch-main/torch/csrc/inductor/aot_inductor_interface.h
#pragma once #include <stddef.h> #include <stdint.h> #ifdef __GNUC__ #define AOT_INDUCTOR_EXPORT __attribute__((__visibility__("default"))) #else // !__GNUC__ #ifdef _WIN32 #define AOT_INDUCTOR_EXPORT __declspec(dllexport) #else // !_WIN32 #define AOT_INDUCTOR_EXPORT #endif // _WIN32 #endif // __GNUC__ enum class AO...
3,485
32.84466
80
h
null
pytorch-main/torch/csrc/inductor/aot_inductor_model.h
#pragma once #include <stdexcept> #include <string> #include <vector> #include <ATen/ATen.h> #include <c10/cuda/CUDAGuard.h> #define AOT_VECTOR_SIZE_CHECK(vec, expected_size) \ { \ auto actual_size = vec.size(); \ TORCH_CHECK( ...
5,156
27.491713
76
h
null
pytorch-main/torch/csrc/inductor/aot_inductor_model_container.h
#pragma once #include <future> #include <mutex> #include <shared_mutex> #include <torch/csrc/inductor/aot_inductor_model.h> namespace torch { namespace aot_inductor { class AOTInductorModelContainer { public: AOTInductorModelContainer(size_t num_models) { LOG(INFO) << "Constructing an AOTInductorModelContain...
5,562
30.429379
80
h
null
pytorch-main/torch/csrc/jit/jit_log.h
#pragma once #include <torch/csrc/Export.h> #include <memory> #include <ostream> #include <string> #include <unordered_map> // `TorchScript` offers a simple logging facility that can enabled by setting an // environment variable `PYTORCH_JIT_LOG_LEVEL`. // Logging is enabled on a per file basis. To enable logging in ...
4,798
36.20155
80
h
null
pytorch-main/torch/csrc/jit/jit_opt_limit.h
#pragma once #include <torch/csrc/Export.h> #include <string> #include <unordered_map> // `TorchScript` offers a simple optimization limit checker // that can be configured through environment variable `PYTORCH_JIT_OPT_LIMIT`. // The purpose is to limit how many optimization you can make per pass. // This is useful fo...
1,405
34.15
95
h
null
pytorch-main/torch/csrc/jit/api/compilation_unit.h
#pragma once #include <ATen/core/function.h> #include <c10/util/Exception.h> #include <torch/csrc/jit/api/function_impl.h> #include <torch/csrc/jit/frontend/name_mangler.h> #include <torch/csrc/jit/frontend/source_range.h> #include <torch/csrc/jit/ir/ir.h> #include <torch/csrc/jit/runtime/graph_executor.h> #include <t...
11,773
32.166197
81
h
null
pytorch-main/torch/csrc/jit/api/function_impl.h
#pragma once #include <ATen/core/function.h> #include <torch/csrc/jit/ir/ir.h> #include <torch/csrc/jit/runtime/graph_executor.h> #include <torch/csrc/utils/memory.h> namespace torch { namespace jit { struct TORCH_API GraphFunction : public Function { // NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init) Gra...
6,167
30.151515
106
h
null
pytorch-main/torch/csrc/jit/api/method.h
#pragma once #include <ATen/core/function.h> #include <ATen/core/ivalue.h> #include <ATen/core/stack.h> #include <torch/csrc/api/include/torch/imethod.h> #include <torch/csrc/jit/api/function_impl.h> namespace torch { namespace jit { using ObjectPtr = c10::intrusive_ptr<c10::ivalue::Object>; // A method in a module...
2,261
25.928571
78
h
null
pytorch-main/torch/csrc/jit/api/module.h
#pragma once #include <c10/util/Exception.h> #include <torch/csrc/autograd/variable.h> #include <torch/csrc/jit/api/object.h> #include <torch/csrc/jit/frontend/source_range.h> #include <torch/csrc/jit/ir/ir.h> #include <torch/csrc/jit/ir/named_value.h> #include <torch/csrc/jit/runtime/argument_spec.h> #include <torch/c...
23,166
33.119293
102
h
null
pytorch-main/torch/csrc/jit/api/object.h
#pragma once #include <ATen/core/functional.h> #include <ATen/core/ivalue.h> #include <c10/util/Optional.h> #include <torch/csrc/jit/api/method.h> #include <utility> namespace torch { namespace jit { struct Resolver; using ResolverPtr = std::shared_ptr<Resolver>; using ObjectPtr = c10::intrusive_ptr<c10::ivalue::O...
6,016
29.236181
80
h
null
pytorch-main/torch/csrc/jit/backends/backend.h
#pragma once #include <ATen/core/builtin_function.h> #include <ATen/core/stack.h> #include <torch/csrc/jit/backends/backend_interface.h> #include <torch/custom_class.h> namespace torch { namespace jit { namespace { // NOLINTNEXTLINE(clang-diagnostic-unneeded-internal-declaration) inline c10::FunctionSchema getIsAvail...
4,060
32.841667
83
h
null
pytorch-main/torch/csrc/jit/backends/backend_debug_handler.h
#pragma once #include <ATen/core/ivalue.h> #include <torch/csrc/jit/backends/backend_detail.h> #include <torch/csrc/jit/ir/ir.h> #include <torch/csrc/jit/ir/scope.h> #include <atomic> namespace torch { namespace jit { /* * BackendDebugHandleManager is responsible for issuing debug handles to * backends. Debug h...
6,332
43.914894
80
h
null
pytorch-main/torch/csrc/jit/backends/backend_debug_info.h
#pragma once #ifndef BUILD_LITE_INTERPRETER #include <torch/csrc/jit/backends/backend_debug_handler.h> #endif #include <torch/custom_class.h> namespace torch { namespace jit { constexpr static auto kBackendUtilsNamespace = "backendutils"; constexpr static auto kBackendDebugInfoClass = "BackendDebugInfo"; #ifndef BU...
2,338
34.439394
80
h
null
pytorch-main/torch/csrc/jit/backends/backend_detail.h
#pragma once #include <torch/csrc/jit/api/module.h> #include <ATen/core/jit_type.h> #include <functional> namespace torch { namespace jit { using DebugHandleType = int64_t; using NodeToDebugHandle = std::unordered_map<Node*, DebugHandleType>; using BackendDebugHandleGenerator = std::function<NodeToDebugHandl...
1,104
25.309524
80
h
null
pytorch-main/torch/csrc/jit/backends/backend_exception.h
#pragma once #include <c10/util/Exception.h> namespace c10 { class TORCH_API BackendRuntimeException : public c10::Error { public: // Use debug_handle to throw exception BackendRuntimeException( SourceLocation loc, std::string msg, int64_t debug_handle) : c10::Error(loc, msg) { debug_h...
2,085
36.927273
79
h
null
pytorch-main/torch/csrc/jit/backends/backend_interface.h
#pragma once #include <torch/custom_class.h> namespace torch { namespace jit { // Interface for a JIT backend. class TORCH_API PyTorchBackendInterface : public torch::CustomClassHolder { public: PyTorchBackendInterface() noexcept; ~PyTorchBackendInterface() override; // Returns true if the backend is availab...
1,184
32.857143
79
h
null
pytorch-main/torch/csrc/jit/backends/coreml/objc/PTMCoreMLTensorSpec.h
#include <c10/core/ScalarType.h> #import <nlohmann/json.hpp> #include <string> namespace torch { namespace jit { namespace mobile { namespace coreml { struct TensorSpec { std::string name = ""; c10::ScalarType dtype = c10::ScalarType::Float; }; static inline c10::ScalarType scalar_type(const std::string& type_s...
728
21.090909
75
h
null
pytorch-main/torch/csrc/jit/backends/xnnpack/xnnpack_graph_builder.h
// Copyright (c) Meta Platforms, Inc. and affiliates. // // This source code is licensed under the BSD-style license found in the // LICENSE file in the root directory of this source tree. #include <ATen/Functions.h> #include <ATen/Utils.h> #include <torch/torch.h> #include <xnnpack.h> #include <unordered_set> #includ...
3,235
32.020408
78
h
null
pytorch-main/torch/csrc/jit/backends/xnnpack/compiler/xnn_compiler.h
// Copyright (c) Meta Platforms, Inc. and affiliates. // // This source code is licensed under the BSD-style license found in the // LICENSE file in the root directory of this source tree. #include <caffe2/torch/csrc/jit/backends/xnnpack/executor/xnn_executor.h> #include <xnnpack.h> #include <memory> #include <vector>...
857
26.677419
76
h
null
pytorch-main/torch/csrc/jit/backends/xnnpack/executor/xnn_executor.h
// Copyright (c) Meta Platforms, Inc. and affiliates. // // This source code is licensed under the BSD-style license found in the // LICENSE file in the root directory of this source tree. #pragma once #include <xnnpack.h> #include <memory> #include <vector> namespace torch { namespace jit { namespace xnnpack { names...
1,642
20.906667
80
h
null
pytorch-main/torch/csrc/jit/backends/xnnpack/serialization/serializer.h
// Copyright (c) Meta Platforms, Inc. and affiliates. // // This source code is licensed under the BSD-style license found in the // LICENSE file in the root directory of this source tree. #include <torch/csrc/jit/backends/xnnpack/serialization/schema_generated.h> #include <cstddef> #include <cstdint> #include <string...
2,779
29.888889
80
h
null
pytorch-main/torch/csrc/jit/codegen/cuda/interface.h
#pragma once #include <c10/macros/Export.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 fuser; * * We use an empty static struct to hold the function pointers, which are * registered se...
1,929
31.711864
77
h
null
pytorch-main/torch/csrc/jit/codegen/fuser/arg_spec.h
#pragma once #include <ATen/ATen.h> #include <ATen/core/functional.h> // fmap #include <c10/util/hash.h> #include <torch/csrc/Export.h> #include <torch/csrc/jit/codegen/fuser/tensor_desc.h> #include <cstdint> #include <vector> namespace torch { namespace jit { namespace fuser { // Describes the (runtime) arguments t...
1,463
23
73
h
null
pytorch-main/torch/csrc/jit/codegen/fuser/codegen.h
#pragma once #include <torch/csrc/Export.h> #include <torch/csrc/jit/codegen/fuser/arg_spec.h> #include <torch/csrc/jit/codegen/fuser/partition_desc.h> #include <torch/csrc/jit/codegen/fuser/tensor_desc.h> #include <torch/csrc/jit/ir/ir.h> #include <iostream> #include <string> #include <tuple> #include <vector> name...
832
25.870968
80
h
null
pytorch-main/torch/csrc/jit/codegen/fuser/compiler.h
#pragma once #include <ATen/core/stack.h> #include <torch/csrc/Export.h> #include <torch/csrc/jit/codegen/fuser/arg_spec.h> #include <torch/csrc/jit/codegen/fuser/fused_kernel.h> #include <torch/csrc/jit/codegen/fuser/interface.h> #include <torch/csrc/jit/codegen/fuser/kernel_spec.h> #include <torch/csrc/jit/ir/ir.h> ...
1,862
29.540984
79
h
null
pytorch-main/torch/csrc/jit/codegen/fuser/executor.h
#pragma once #include <ATen/core/stack.h> #include <torch/csrc/Export.h> #include <torch/csrc/jit/codegen/fuser/fused_kernel.h> #include <torch/csrc/jit/codegen/fuser/kernel_spec.h> #include <cstdint> namespace torch { namespace jit { namespace fuser { // Runs the fusion associated with the key (see registerFusion(...
550
21.958333
80
h
null
pytorch-main/torch/csrc/jit/codegen/fuser/fused_kernel.h
#pragma once #include <ATen/ATen.h> #include <ATen/Utils.h> #include <torch/csrc/jit/codegen/fuser/partition_desc.h> #include <torch/csrc/jit/codegen/fuser/tensor_desc.h> #include <cstdint> #include <string> #include <vector> namespace torch { namespace jit { namespace fuser { struct FusedKernel { AT_DISALLOW_COP...
3,415
31.846154
79
h
null
pytorch-main/torch/csrc/jit/codegen/fuser/interface.h
#pragma once #include <ATen/ATen.h> #include <ATen/core/stack.h> #include <torch/csrc/Export.h> #include <torch/csrc/jit/ir/ir.h> #include <cstdint> #include <memory> #include <vector> namespace torch { namespace jit { constexpr int kCPUDevice = -1; // Assigns a "key" to the given fusion_group that it can use to r...
1,747
29.666667
75
h
null
pytorch-main/torch/csrc/jit/codegen/fuser/kernel_cache.h
#pragma once #include <c10/util/Optional.h> #include <torch/csrc/Export.h> #include <torch/csrc/jit/codegen/fuser/kernel_spec.h> #include <torch/csrc/jit/ir/ir.h> #include <cstdint> #include <functional> namespace torch { namespace jit { namespace fuser { // A thread-safe cache interface. // Normalizes the graph b...
1,041
27.162162
78
h
null
pytorch-main/torch/csrc/jit/codegen/fuser/kernel_spec.h
#pragma once #include <ATen/ATen.h> #include <ATen/core/stack.h> #include <c10/util/Optional.h> #include <torch/csrc/Export.h> #include <torch/csrc/jit/codegen/fuser/arg_spec.h> #include <torch/csrc/jit/codegen/fuser/fused_kernel.h> #include <torch/csrc/jit/codegen/fuser/interface.h> #include <torch/csrc/jit/ir/ir.h> ...
4,633
29.486842
80
h
null
pytorch-main/torch/csrc/jit/codegen/fuser/partition_desc.h
#pragma once #include <c10/util/Exception.h> #include <torch/csrc/Export.h> #include <torch/csrc/jit/codegen/fuser/tensor_desc.h> #include <cstdint> #include <memory> #include <vector> namespace torch { namespace jit { namespace fuser { // Descriptor for chunk-ing an input tensor into subtensors // OR concat-ing an...
1,897
28.2
78
h
null
pytorch-main/torch/csrc/jit/codegen/fuser/tensor_desc.h
#pragma once #include <ATen/ATen.h> #include <ATen/core/jit_type.h> #include <c10/util/Exception.h> #include <c10/util/hash.h> #include <torch/csrc/Export.h> #include <algorithm> #include <iostream> #include <vector> namespace torch { namespace jit { namespace fuser { // type information needed by the compiler for ...
3,146
27.87156
78
h
null
pytorch-main/torch/csrc/jit/codegen/fuser/tensor_info.h
#pragma once #include <torch/csrc/Export.h> #include <cstdint> namespace torch { namespace jit { namespace fuser { // Host-side view of TensorInfo // Note dims[0] - we need to dynamically allocate the dims. struct TORCH_API TensorInfo { uint32_t* sizes(size_t nDim) { return &sizes_strides[0]; } uint32_t* s...
638
20.3
78
h
null
pytorch-main/torch/csrc/jit/codegen/fuser/cpu/fused_kernel.h
#pragma once #include <ATen/ATen.h> #include <torch/csrc/Export.h> #include <torch/csrc/jit/codegen/fuser/fused_kernel.h> #include <cstdint> #include <memory> #include <string> // Forward declare DynamicLibrary namespace at { struct DynamicLibrary; } namespace torch { namespace jit { namespace fuser { namespace cpu...
1,116
21.34
72
h
null
pytorch-main/torch/csrc/jit/codegen/fuser/cpu/resource_strings.h
#pragma once #include <ATen/code_template.h> namespace torch { namespace jit { namespace fuser { namespace cpu { /*with type_as not checking type of its input, a fusion group can have non-fp32 tensor as input. Correct code for this case is generated, however, nvrtc does not know how to handle int*_t integer types, s...
2,353
20.796296
79
h
null
pytorch-main/torch/csrc/jit/codegen/fuser/cuda/fused_kernel.h
#pragma once #include <ATen/ATen.h> #include <torch/csrc/Export.h> #include <torch/csrc/jit/codegen/fuser/fused_kernel.h> #include <cuda.h> #include <cuda_runtime.h> #include <nvrtc.h> #include <cstdint> #include <string> #include <vector> namespace torch { namespace jit { namespace fuser { namespace cuda { // que...
1,601
22.910448
78
h
null
pytorch-main/torch/csrc/jit/codegen/fuser/cuda/resource_strings.h
#pragma once #include <ATen/code_template.h> #include <torch/csrc/Export.h> namespace torch { namespace jit { namespace fuser { namespace cuda { /*with type_as not checking type of its input, a fusion group can have non-fp32 tensor as input. Correct code for this case is generated, however, nvrtc does not know how t...
10,777
25.223844
80
h
null
pytorch-main/torch/csrc/jit/codegen/onednn/LlgaTensorImpl.h
#pragma once #include <ATen/ATen.h> #include <ATen/Config.h> #include <oneapi/dnnl/dnnl_graph.hpp> #include <torch/csrc/jit/ir/ir.h> namespace torch { namespace jit { namespace fuser { namespace onednn { // Engine represents a device and its context. From the device kind, the engine // knows how to generate code fo...
7,689
26.761733
80
h
null
pytorch-main/torch/csrc/jit/codegen/onednn/graph_fuser.h
#pragma once #include <torch/csrc/jit/codegen/onednn/graph_helper.h> #include <torch/csrc/jit/ir/ir.h> namespace torch { namespace jit { namespace fuser { namespace onednn { struct WorkBlock : public std::pair<Node*, Node*> { using pair::pair; Node* begin() { return this->first; } Node* end() { retu...
1,291
22.925926
77
h
null
pytorch-main/torch/csrc/jit/codegen/onednn/graph_helper.h
#pragma once #include <oneapi/dnnl/dnnl_graph.hpp> #include <torch/csrc/jit/codegen/onednn/operator.h> #include <torch/csrc/jit/ir/alias_analysis.h> #include <torch/csrc/jit/ir/ir.h> namespace torch { namespace jit { namespace fuser { namespace onednn { #define STRIDED_LAYOUT 0 #define OPAQUE_LAYOUT 1 struct OpPart...
2,539
23.190476
77
h
null
pytorch-main/torch/csrc/jit/codegen/onednn/interface.h
#pragma once #include <ATen/Config.h> #include <torch/csrc/jit/ir/ir.h> #include <torch/csrc/jit/passes/pass_manager.h> namespace torch { namespace jit { namespace fuser { namespace onednn { static std::atomic<bool> onednn_enabled{false}; static std::atomic<bool>& getLlgaEnabled() { return onednn_enabled; } C10_E...
1,448
22
76
h
null
pytorch-main/torch/csrc/jit/codegen/onednn/kernel.h
#pragma once #include <unordered_map> #include <oneapi/dnnl/dnnl_graph.hpp> #include <torch/csrc/jit/codegen/onednn/LlgaTensorImpl.h> #include <torch/csrc/jit/codegen/onednn/graph_helper.h> #include <torch/csrc/jit/ir/ir.h> #include <torch/csrc/jit/runtime/interpreter.h> #include <c10/util/CallOnce.h> namespace tor...
2,769
27.854167
78
h
null
pytorch-main/torch/csrc/jit/codegen/onednn/operator.h
#pragma once #include <oneapi/dnnl/dnnl_graph.hpp> #include <torch/csrc/jit/codegen/onednn/LlgaTensorImpl.h> #include <torch/csrc/jit/ir/ir.h> namespace torch { namespace jit { namespace fuser { namespace onednn { class Operator { public: Operator(const Node* node, dnnl::graph::op::kind kind) : n(node), o(g...
3,977
25
78
h
null
pytorch-main/torch/csrc/jit/codegen/onednn/prepare_binary.h
#pragma once #include <torch/csrc/jit/ir/ir.h> namespace torch { namespace jit { namespace fuser { namespace onednn { // Prepare binary ops for LLGA // // The pass does the following: // // - Convert scalar input of aten::add and aten::mul into Float tensor with // dimension [1] // // - Decompose fused add into at...
574
20.296296
75
h
null
pytorch-main/torch/csrc/jit/cuda/cuda.h
#include <ATen/cuda/CUDAEvent.h> #include <c10/core/Device.h> #include <c10/cuda/CUDAStream.h> #include <torch/custom_class.h> namespace torch { namespace jit { class CUDAEvent; // This class is a wrapper around c10::cuda::CUDAStream. // It is needed because TorchBind does not support all of the argument types // for...
5,363
27.83871
80
h
null
pytorch-main/torch/csrc/jit/frontend/concrete_module_type.h
#pragma once #include <ATen/core/ivalue.h> #include <torch/csrc/jit/api/module.h> #include <torch/csrc/jit/python/pybind_utils.h> #include <memory> #include <string> #include <vector> namespace torch { namespace jit { enum class IterableModuleKind { NONE, LIST, DICT, PARAMLIST, PARAMDICT }; class ConcreteModuleType;...
9,062
36.450413
80
h
null
pytorch-main/torch/csrc/jit/frontend/error_report.h
#pragma once #include <c10/util/Optional.h> #include <torch/csrc/jit/frontend/tree.h> namespace torch { namespace jit { struct Call { std::string fn_name; SourceRange caller_range; }; struct TORCH_API ErrorReport : public std::exception { ErrorReport(const ErrorReport& e); explicit ErrorReport(SourceRange ...
1,485
26.018182
80
h
null
pytorch-main/torch/csrc/jit/frontend/ir_emitter.h
#pragma once #include <functional> #include <memory> #include <string> #include <torch/csrc/jit/api/module.h> #include <torch/csrc/jit/frontend/error_report.h> #include <torch/csrc/jit/frontend/resolver.h> #include <torch/csrc/jit/frontend/sugared_value.h> #include <torch/csrc/jit/frontend/tree_views.h> #include <torc...
541
23.636364
66
h
null
pytorch-main/torch/csrc/jit/frontend/lexer.h
#pragma once #include <c10/macros/Macros.h> #include <c10/util/C++17.h> #include <c10/util/Exception.h> #include <torch/csrc/Export.h> #include <torch/csrc/jit/frontend/parser_constants.h> #include <torch/csrc/jit/frontend/source_range.h> #include <torch/csrc/jit/frontend/strtod.h> #include <algorithm> #include <clocal...
19,302
32.396194
80
h
null
pytorch-main/torch/csrc/jit/frontend/mini_environment.h
#pragma once #include <ATen/core/jit_type.h> #include <torch/csrc/jit/ir/ir.h> namespace torch { namespace jit { // Simple data structure for containing a type T in nested control blocks // Should only be used after initial compilation where type checking and // loads and stores are emitted template <typename T> st...
1,400
23.155172
78
h
null
pytorch-main/torch/csrc/jit/frontend/name_mangler.h
#pragma once #include <ATen/core/qualified_name.h> #include <torch/csrc/Export.h> namespace torch { namespace jit { /** * class NameMangler * * Utility to mangle qualified names in order to make them unique. We use this * in various places where we to de-duplicate qualified names. */ class TORCH_API NameMangler...
655
22.428571
78
h
null
pytorch-main/torch/csrc/jit/frontend/parse_string_literal.h
#pragma once #include <c10/util/Optional.h> #include <torch/csrc/jit/frontend/error_report.h> #include <torch/csrc/jit/frontend/lexer.h> namespace torch { namespace jit { inline bool isCharCount(char c, const std::string& str, size_t start, int len) { // count checks from [start, start + len) return start + len <...
2,295
25.090909
80
h
null
pytorch-main/torch/csrc/jit/frontend/resolver.h
#pragma once #include <ATen/core/jit_type.h> #include <ATen/core/qualified_name.h> #include <torch/csrc/jit/frontend/sugared_value.h> namespace torch { namespace jit { struct Resolver; using ResolverPtr = std::shared_ptr<Resolver>; /** * class Resolver * * Represents an "outer environment" in which we an look up...
1,982
27.73913
80
h
null
pytorch-main/torch/csrc/jit/frontend/schema_matching.h
#pragma once #include <torch/csrc/Export.h> #include <torch/csrc/jit/ir/ir.h> #include <torch/csrc/jit/ir/named_value.h> #include <ATen/core/function_schema.h> namespace torch { namespace jit { // Try to match a list of inputs and keyword 'attributes' to this // schema. Return the flat list of positional inputs to t...
2,133
29.056338
77
h
null
pytorch-main/torch/csrc/jit/frontend/schema_type_parser.h
#pragma once #include <ATen/core/alias_info.h> #include <ATen/core/jit_type.h> #include <c10/macros/Macros.h> #include <c10/util/FunctionRef.h> #include <torch/csrc/jit/frontend/lexer.h> namespace torch { namespace jit { using TypePtr = c10::TypePtr; struct TORCH_API SchemaTypeParser { TypePtr parseBaseType(); ...
1,113
26.170732
79
h
null
pytorch-main/torch/csrc/jit/frontend/script_type_parser.h
#pragma once #include <ATen/core/jit_type.h> #include <torch/csrc/Export.h> #include <torch/csrc/jit/frontend/resolver.h> #include <torch/csrc/jit/frontend/tree_views.h> namespace torch { namespace jit { /** * class ScriptTypeParser * * Parses expressions in our typed AST format (TreeView) into types and * typena...
1,605
27.678571
76
h
null
pytorch-main/torch/csrc/jit/frontend/source_range.h
#pragma once #include <c10/util/Exception.h> #include <c10/util/Optional.h> #include <algorithm> #include <iostream> #include <iterator> #include <memory> #include <numeric> #include <unordered_map> namespace torch { namespace jit { class SourceRangeUnpickler; struct SourceRange; // A stringlike class backed by a v...
12,679
26.868132
80
h
null
pytorch-main/torch/csrc/jit/frontend/source_ref.h
#pragma once #include <functional> #include <memory> #include <ATen/core/ivalue.h> #include <c10/macros/Export.h> #include <torch/csrc/jit/frontend/source_range.h> namespace torch { namespace jit { /** * SourceRef does two things: * 1. Owns a Source object. * 2. Serves as lookup key to the owned Source in as...
1,319
26.5
79
h
null
pytorch-main/torch/csrc/jit/frontend/tracer.h
#pragma once #include <ATen/core/Dimname.h> #include <ATen/core/class_type.h> #include <ATen/core/jit_type.h> #include <ATen/core/stack.h> #include <ATen/core/symbol.h> #include <c10/util/Exception.h> #include <torch/csrc/Export.h> #include <torch/csrc/jit/frontend/source_range.h> #include <torch/csrc/utils/variadic....
12,858
29.911058
82
h
null
pytorch-main/torch/csrc/jit/frontend/tree.h
#pragma once #include <functional> #include <memory> #include <unordered_map> #include <vector> #include <c10/util/SmallVector.h> #include <c10/util/intrusive_ptr.h> #include <torch/csrc/jit/frontend/lexer.h> namespace torch { namespace jit { // Trees are used to represent all forms of TC IR, pre- and post-typechec...
6,629
29
80
h
null
pytorch-main/torch/csrc/jit/frontend/versioned_symbols.h
#pragma once #include <caffe2/serialize/versions.h> #include <torch/csrc/Export.h> #include <torch/csrc/jit/api/module.h> #include <cstdint> namespace torch { namespace jit { // Maps the given symbol into an implementation of its behavior at the // given version. // See note [Versioned Symbols] TORCH_API Symbol get_...
620
27.227273
70
h
null
pytorch-main/torch/csrc/jit/ir/alias_analysis.h
#pragma once #include <ATen/core/alias_info.h> #include <c10/util/flat_hash_map.h> #include <torch/csrc/jit/ir/ir.h> #include <torch/csrc/jit/ir/type_hashing.h> #include <torch/csrc/jit/passes/create_functional_graphs.h> #include <torch/csrc/jit/passes/utils/memory_dag.h> namespace torch { namespace jit { /** * Ali...
12,850
38.786378
80
h
null
pytorch-main/torch/csrc/jit/ir/attributes.h
#pragma once #include <ATen/core/Tensor.h> #include <string> #include <vector> #include <ATen/core/jit_type_base.h> #include <ATen/core/symbol.h> #include <torch/csrc/Export.h> namespace torch { namespace jit { using ::c10::Symbol; constexpr int max_tensor_display_size = 10; enum class AttributeKind { f, fs, ...
4,929
25.648649
78
h
null
pytorch-main/torch/csrc/jit/ir/constants.h
#pragma once #include <ATen/core/ivalue.h> #include <ATen/core/jit_type.h> #include <torch/csrc/Export.h> #include <torch/csrc/jit/frontend/source_range.h> #include <torch/csrc/jit/ir/scope.h> // helpers for handling constants in the IR // - create constant nodes from ints, floats, complex, intlist, Tensors, and // ot...
2,032
31.790323
80
h
null
pytorch-main/torch/csrc/jit/ir/graph_node_list.h
#pragma once #include <c10/util/Exception.h> namespace torch { namespace jit { // Intrusive doubly linked lists with sane reverse iterators. // The header file is named generic_graph_node_list.h because it is ONLY // used for Graph's Node lists, and if you want to use it for other // things, you will have to do some...
6,360
30.490099
80
h
null
pytorch-main/torch/csrc/jit/ir/ir_views.h
#pragma once #include <c10/util/irange.h> #include <torch/csrc/jit/ir/ir.h> namespace torch { namespace jit { struct IfView { explicit IfView(Node* node) : node_(node) { AT_ASSERT(node->kind() == ::c10::prim::If); } Value* cond() const { return node_->input(0); } Block* thenBlock() const { retu...
4,648
27.175758
80
h
null
pytorch-main/torch/csrc/jit/ir/irparser.h
#pragma once #include <torch/csrc/Export.h> #include <string> #include <unordered_map> #include <c10/util/Optional.h> #include <torch/csrc/Export.h> namespace torch { namespace jit { struct Graph; struct Value; // \brief Parse IR from \p STR constructing the corresponding IR in\ GRAPH. // if parse_tensor_constants...
1,163
27.390244
79
h
null
pytorch-main/torch/csrc/jit/ir/named_value.h
#pragma once #include <ATen/core/ivalue.h> #include <torch/csrc/jit/frontend/source_range.h> #include <torch/csrc/jit/ir/constants.h> #include <torch/csrc/utils/variadic.h> namespace torch { namespace jit { struct Value; /** * A value with optional extra name and location information. Used during * schema matching...
2,434
27.647059
80
h
null
pytorch-main/torch/csrc/jit/ir/scope.h
#pragma once #include <ATen/core/jit_type.h> #include <ATen/core/symbol.h> #include <c10/util/Optional.h> #include <c10/util/intrusive_ptr.h> #include <torch/csrc/Export.h> #include <torch/csrc/jit/frontend/source_range.h> #include <unordered_map> namespace torch { namespace jit { struct ModuleInstanceInfo; constexpr ...
6,801
31.545455
79
h
null
pytorch-main/torch/csrc/jit/ir/subgraph_matcher.h
#pragma once #include <torch/csrc/jit/ir/ir.h> #include <unordered_map> #include <vector> namespace torch { namespace jit { /** * \brief A structure describing a match of a pattern in a graph. * * The structure contains an anchor node, from which the match was found, and * match-maps for nodes and values. A mat...
3,151
41.026667
80
h
null
pytorch-main/torch/csrc/jit/mobile/code.h
#pragma once #include <vector> #include <ATen/core/ivalue.h> #include <ATen/core/operator_name.h> #include <torch/csrc/jit/runtime/instruction.h> namespace torch { namespace jit { namespace mobile { using Stack = std::vector<c10::IValue>; using DebugHandle = int64_t; class Function; // NOLINTNEXTLINE(cppcoreguide...
1,186
28.675
79
h
null
pytorch-main/torch/csrc/jit/mobile/debug_info.h
#pragma once #include <c10/util/flat_hash_map.h> #include <caffe2/serialize/inline_container.h> #include <torch/csrc/jit/api/compilation_unit.h> #include <torch/csrc/jit/ir/scope.h> #include <torch/csrc/jit/serialization/source_range_serialization.h> namespace torch { namespace jit { /* * MobileDebugTable: * Deseria...
2,230
37.465517
80
h
null
pytorch-main/torch/csrc/jit/mobile/file_format.h
#pragma once #include <array> #include <cerrno> #include <cstddef> #include <cstring> #include <fstream> #include <istream> #include <memory> #include <c10/core/CPUAllocator.h> #include <c10/core/impl/alloc_cpu.h> #include <caffe2/serialize/read_adapter_interface.h> #if defined(HAVE_MMAP) #include <fcntl.h> #include...
6,632
32.670051
80
h
null
pytorch-main/torch/csrc/jit/mobile/flatbuffer_loader.h
#pragma once #include <istream> #include <memory> #include <string> #include <unordered_map> #include <vector> #include <ATen/core/ivalue.h> #include <c10/core/Device.h> #include <c10/macros/Macros.h> #include <c10/util/Optional.h> #include <torch/csrc/jit/mobile/module.h> /** * Defines the public API for loading f...
4,999
35.49635
80
h
null
pytorch-main/torch/csrc/jit/mobile/function.h
#pragma once #include <vector> #include <ATen/core/function.h> #include <ATen/core/function_schema.h> #include <ATen/core/ivalue.h> #include <torch/csrc/jit/mobile/code.h> namespace torch { namespace jit { enum OpCode : uint8_t; struct Instruction; struct OperatorString; namespace mobile { class TORCH_API Function...
2,900
32.344828
76
h
null
pytorch-main/torch/csrc/jit/mobile/import.h
#pragma once #include <torch/csrc/jit/mobile/module.h> #include <torch/csrc/jit/mobile/parse_operators.h> #include <istream> #include <memory> #include <caffe2/serialize/file_adapter.h> namespace torch { namespace jit { using caffe2::serialize::FileAdapter; using caffe2::serialize::IStreamAdapter; using caffe2::seri...
3,930
33.787611
73
h
null
pytorch-main/torch/csrc/jit/mobile/import_data.h
#pragma once #include <ATen/core/TensorBase.h> #include <c10/core/Device.h> #include <c10/util/Optional.h> #include <torch/csrc/jit/mobile/module.h> #include <istream> #include <map> #include <string> namespace torch { namespace jit { /** * Loads named parameters from the serialized data in @p in. * * Calls #TOR...
1,031
25.461538
76
h
null
pytorch-main/torch/csrc/jit/mobile/import_export_common.h
#pragma once /** * @file * Declarations shared between import_data.cpp and export_data.cpp */ namespace torch { namespace jit { namespace mobile { namespace internal { /** * The name of the mobile::Module attribute which contains saved parameters, as * a Dict of names to Tensors. Only used for Flatbuffer serial...
554
22.125
79
h
null
pytorch-main/torch/csrc/jit/mobile/interpreter.h
#pragma once #include <vector> #include <torch/csrc/jit/mobile/code.h> #include <torch/csrc/jit/mobile/frame.h> namespace torch { namespace jit { namespace mobile { struct InterpreterState { TORCH_API explicit InterpreterState(const Code& code); TORCH_API bool run(Stack& stack); private: void enterFrame(con...
688
21.225806
71
h
null
pytorch-main/torch/csrc/jit/mobile/module.h
#pragma once #include <ATen/core/jit_type.h> #include <torch/csrc/jit/mobile/debug_info.h> #include <torch/csrc/jit/mobile/function.h> #include <torch/csrc/jit/mobile/method.h> #include <torch/csrc/jit/mobile/quantization.h> namespace torch { namespace jit { namespace mobile { using Stack = std::vector<c10::IValue>; ...
5,946
29.341837
80
h
null
pytorch-main/torch/csrc/jit/mobile/observer.h
#pragma once #include <c10/util/ThreadLocalDebugInfo.h> #include <string> #include <unordered_map> #include <vector> namespace torch { class MobileDebugInfo : public c10::DebugInfoBase { public: const std::string& getModelName() { return model_name_; } void setModelName(const std::string& model_name) { ...
3,637
31.774775
80
h
null
pytorch-main/torch/csrc/jit/mobile/parse_bytecode.h
#pragma once #include <torch/csrc/jit/mobile/function.h> namespace torch { namespace jit { namespace mobile { using c10::IValue; TORCH_API void parseInstructions( const std::string& function_name, c10::ivalue::TupleElements&& ins_list, c10::ivalue::TupleElements& debug_handles_m_tuple, mobile::Function...
790
29.423077
75
h
null
pytorch-main/torch/csrc/jit/mobile/parse_operators.h
#pragma once #include <torch/csrc/jit/mobile/function.h> namespace torch { namespace jit { using c10::IValue; enum MobileModuleLoadOptions { OPERATOR_CHECK = 1, // PARSE_ALL_EXTRA_FILE_MAPS is used to gate for ExtraFileMaps to pull all // files automatically without explicit entries mapping. Refer to PR for a ...
734
25.25
76
h
null
pytorch-main/torch/csrc/jit/mobile/profiler_edge.h
#pragma once #include <torch/csrc/autograd/profiler_kineto.h> #include <torch/csrc/jit/mobile/module.h> namespace torch { namespace jit { namespace mobile { // If we dont have kineto available then edge profiler does not // work since it relies on Kineto #ifdef USE_KINETO class TORCH_API KinetoEdgeCPUProfiler { publ...
4,538
36.825
80
h
null
pytorch-main/torch/csrc/jit/mobile/quantization.h
#pragma once #include <c10/macros/Export.h> #include <string> namespace torch { namespace jit { namespace mobile { class Module; namespace quantization { /* * Device side PTQ API. * Once the model has been prepared for quantization on server side, such model * is sent to device. On device side the model is further...
1,288
32.051282
80
h
null
pytorch-main/torch/csrc/jit/mobile/register_ops_common_utils.h
#pragma once #include <ATen/Context.h> #include <ATen/NativeFunctions.h> #include <ATen/core/ivalue.h> #include <ATen/core/stack.h> #include <torch/csrc/jit/runtime/jit_exception.h> #include <torch/csrc/jit/runtime/vararg_functions.h> #include <iostream> namespace torch { namespace jit { inline void noop(Stack& n) ...
1,704
28.396552
79
h
null
pytorch-main/torch/csrc/jit/mobile/type_parser.h
#pragma once #include <ATen/core/dynamic_type.h> #include <ATen/core/jit_type.h> #include <unordered_set> namespace c10 { class TORCH_API TypeParser { public: explicit TypeParser(std::string pythonStr); explicit TypeParser(std::vector<std::string>& pythonStrs); TypePtr parse(); std::vector<TypePtr> parseLi...
1,443
25.254545
78
h
null
pytorch-main/torch/csrc/jit/mobile/upgrader_mobile.h
#pragma once // #include <ATen/core/ivalue.h> #include <ATen/core/ivalue_inl.h> #include <torch/csrc/jit/mobile/code.h> #include <torch/csrc/jit/mobile/function.h> #include <torch/csrc/jit/serialization/import_export_functions.h> #include <memory> #include <string> #include <unordered_map> #include <vector> namespac...
981
21.318182
70
h
null
pytorch-main/torch/csrc/jit/mobile/compatibility/backport.h
#pragma once #include <c10/macros/Export.h> #include <istream> #include <memory> namespace caffe2 { namespace serialize { class ReadAdapterInterface; class PyTorchStreamWriter; } // namespace serialize } // namespace caffe2 namespace torch { namespace jit { TORCH_API bool _backport_for_mobile( std::istream& in,...
826
20.205128
39
h
null
pytorch-main/torch/csrc/jit/mobile/compatibility/backport_manager.h
#pragma once #include <functional> #include <memory> #include <unordered_map> namespace c10 { struct IValue; } namespace caffe2 { namespace serialize { class IStreamAdapter; class ReadAdapterInterface; class PyTorchStreamWriter; class PyTorchStreamReader; } // namespace serialize } // namespace caffe2 namespace tor...
1,286
21.982143
79
h
null
pytorch-main/torch/csrc/jit/mobile/compatibility/model_compatibility.h
#pragma once #include <c10/macros/Export.h> #include <torch/csrc/jit/mobile/compatibility/runtime_compatibility.h> #include <istream> #include <memory> #include <unordered_map> namespace caffe2 { namespace serialize { class PyTorchStreamReader; class ReadAdapterInterface; } // namespace serialize } // namespace caff...
3,591
32.570093
80
h
null
pytorch-main/torch/csrc/jit/mobile/compatibility/runtime_compatibility.h
#pragma once #include <c10/macros/Export.h> #include <c10/util/Optional.h> #include <memory> #include <unordered_map> #include <unordered_set> namespace torch { namespace jit { // Struct storing metadata of an operator that can be useful for versioning struct OperatorInfo { // The number of arguments within the s...
1,233
26.422222
81
h
null
pytorch-main/torch/csrc/jit/mobile/model_tracer/BuildFeatureTracer.h
#pragma once #include <ATen/record_function.h> #include <c10/util/Synchronized.h> #include <map> #include <set> #include <string> namespace torch { namespace jit { namespace mobile { /* The BuildFeatureTracer class handles the attachment and removal of a * recording callback that traces the invocation of code that ...
1,011
23.095238
79
h
null
pytorch-main/torch/csrc/jit/mobile/model_tracer/CustomClassTracer.h
#pragma once #include <ATen/record_function.h> #include <c10/util/Synchronized.h> #include <map> #include <set> #include <string> namespace torch { namespace jit { namespace mobile { /* The CustomClassTracer class handles the attachment and removal of a recording * callback that traces the invocation of code that h...
1,009
23.047619
80
h
null
pytorch-main/torch/csrc/jit/mobile/model_tracer/KernelDTypeTracer.h
#pragma once #include <ATen/record_function.h> #include <c10/util/Synchronized.h> #include <map> #include <set> #include <string> namespace torch { namespace jit { namespace mobile { /* The KernelDTypeTracer class handles the attachment and removal of a recording * callback that traces the invocation of code that ha...
1,262
29.071429
80
h
null
pytorch-main/torch/csrc/jit/mobile/model_tracer/MobileModelRunner.h
#pragma once #include <iostream> #include <mutex> #include <sstream> #include <torch/csrc/autograd/grad_mode.h> #include <torch/csrc/jit/mobile/import.h> #include <torch/csrc/jit/mobile/module.h> #include <torch/csrc/jit/serialization/export.h> #include <torch/script.h> namespace torch { namespace jit { namespace mo...
5,156
32.927632
80
h
null
pytorch-main/torch/csrc/jit/mobile/model_tracer/OperatorCallTracer.h
#pragma once #include <ATen/record_function.h> #include <c10/util/Synchronized.h> namespace torch { namespace jit { namespace mobile { /* The OperatorCallTracer class handles the attachment and removal of a * recording callback that traces invocation of ATen (and other) PyTorch * operators that get called via the D...
968
25.189189
76
h
null
pytorch-main/torch/csrc/jit/mobile/model_tracer/TracerRunner.h
#pragma once #include <set> #include <string> #include <vector> #include <ATen/core/ivalue.h> #include <torch/csrc/jit/mobile/model_tracer/BuildFeatureTracer.h> #include <torch/csrc/jit/mobile/model_tracer/CustomClassTracer.h> #include <torch/csrc/jit/mobile/model_tracer/KernelDTypeTracer.h> namespace torch { namesp...
1,157
25.318182
75
h
null
pytorch-main/torch/csrc/jit/mobile/nnc/aot_compiler.h
#pragma once #include <torch/csrc/Export.h> #include <torch/csrc/jit/ir/ir.h> #include <torch/csrc/jit/mobile/nnc/context.h> namespace torch { namespace jit { namespace mobile { namespace nnc { // Performs Ahead Of Time compilation of a given method in a model // returning the compiled function and LLVM assembly cod...
705
27.24
77
h