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/caffe2/core/distributions_stubs.h
#ifndef CAFFE2_CORE_DISTRIBUTIONS_STUBS_H_ #define CAFFE2_CORE_DISTRIBUTIONS_STUBS_H_ #include <c10/macros/Macros.h> /** * This file provides distributions compatible with * ATen/core/DistributionsHelper.h but backed with the std RNG implementation * instead of the ATen one. * * Caffe2 mobile builds currently do...
2,161
27.447368
77
h
null
pytorch-main/caffe2/core/event.h
#ifndef CAFFE2_CORE_EVENT_H_ #define CAFFE2_CORE_EVENT_H_ #include <chrono> #include <c10/core/DeviceType.h> #include "caffe2/core/common.h" #include "caffe2/core/logging.h" #include "caffe2/proto/caffe2_pb.h" namespace caffe2 { constexpr int MaxDeviceTypes = DeviceTypeProto::PROTO_COMPILE_TIME_MAX_DEVICE_TYPES...
12,420
31.94695
80
h
null
pytorch-main/caffe2/core/event_cpu.h
#include "caffe2/core/event.h" #include <atomic> #include <condition_variable> namespace caffe2 { struct CPUEventWrapper { explicit CPUEventWrapper(const DeviceOption& option) : status_(EventStatus::EVENT_INITIALIZED) { CAFFE_ENFORCE( option.device_type() == PROTO_CPU || option.device...
1,192
23.854167
66
h
null
pytorch-main/caffe2/core/export_c10_op_to_caffe2.h
#pragma once #include <c10/macros/Macros.h> #include <c10/util/Registry.h> #include "caffe2/core/operator.h" // TODO Also register c10 operators on mobile #if !defined(CAFFE2_IS_XPLAT_BUILD) && !defined(C10_MOBILE) #include <ATen/core/dispatch/Dispatcher.h> #include <ATen/core/ivalue.h> #include <c10/util/ArrayRef.h>...
9,539
35.136364
124
h
null
pytorch-main/caffe2/core/export_caffe2_op_to_c10.h
#pragma once #include <c10/macros/Macros.h> #if defined(EXPOSE_C2_OPS) || \ !defined(CAFFE2_IS_XPLAT_BUILD) && !defined(C10_MOBILE) #include <ATen/core/dispatch/OperatorOptions.h> #include <ATen/core/function_schema.h> #include <ATen/core/grad_mode.h> #include <ATen/core/op_registration/op_registration.h> #includ...
12,349
42.639576
130
h
null
pytorch-main/caffe2/core/graph.h
#pragma once #include "caffe2/core/common.h" #include "caffe2/proto/caffe2_pb.h" #include "caffe2/utils/proto_utils.h" #include "caffe2/utils/string_utils.h" #include <algorithm> #include <unordered_map> #include <unordered_set> namespace caffe2 { namespace transform { /** * Graph representation of an operator. ...
5,258
28.216667
80
h
null
pytorch-main/caffe2/core/init.h
#ifndef CAFFE2_CORE_INIT_H_ #define CAFFE2_CORE_INIT_H_ #include "caffe2/core/common.h" #include "caffe2/core/flags.h" #include "caffe2/core/logging.h" namespace caffe2 { namespace internal { class TORCH_API Caffe2InitializeRegistry { public: typedef bool (*InitFunction)(int*, char***); // Registry() is defined...
6,496
35.094444
80
h
null
pytorch-main/caffe2/core/memonger.h
#ifndef CAFFE2_CORE_MEMONGER_H_ #define CAFFE2_CORE_MEMONGER_H_ #include <unordered_set> #include "caffe2/core/common.h" #include "caffe2/core/workspace.h" #include "caffe2/proto/caffe2_pb.h" namespace caffe2 { // op schema check TORCH_API void run_schema_check(const NetDef& net); namespace memonger { TORCH_API N...
817
23.058824
64
h
null
pytorch-main/caffe2/core/module.h
/** * A global dictionary that holds information about what Caffe2 modules have * been loaded in the current runtime, and also utility functions to load * modules. */ #ifndef CAFFE2_CORE_MODULE_H_ #define CAFFE2_CORE_MODULE_H_ #include <algorithm> #include <cstdio> #include <cstdlib> #include <functional> #include...
2,473
33.361111
79
h
null
pytorch-main/caffe2/core/net.h
#ifndef CAFFE2_CORE_NET_H_ #define CAFFE2_CORE_NET_H_ #include <atomic> #include <climits> #include <cstddef> #include <thread> // NOLINT #include <typeinfo> #include <unordered_map> #include <vector> #include "c10/core/thread_pool.h" #include "c10/util/Registry.h" #include "caffe2/core/blob.h" #include "caffe2/core/...
4,634
25.335227
79
h
null
pytorch-main/caffe2/core/net_async_base.h
#ifndef CAFFE2_CORE_NET_ASYNC_BASE_H_ #define CAFFE2_CORE_NET_ASYNC_BASE_H_ #include <c10/macros/Macros.h> #include "c10/core/thread_pool.h" #include "c10/util/Registry.h" #include "caffe2/core/common.h" #include "caffe2/core/net.h" #include "caffe2/core/net_dag_utils.h" #include "caffe2/core/prof_dag_counters.h" #inc...
7,397
30.084034
80
h
null
pytorch-main/caffe2/core/net_async_scheduling.h
#ifndef CAFFE2_CORE_NET_ASYNC_SCHEDULING_H_ #define CAFFE2_CORE_NET_ASYNC_SCHEDULING_H_ #include "caffe2/core/net_async_base.h" namespace caffe2 { class TORCH_API AsyncSchedulingNet : public AsyncNetBase { public: AsyncSchedulingNet( const std::shared_ptr<const NetDef>& net_def, Workspace* ws); ~Asy...
993
22.116279
63
h
null
pytorch-main/caffe2/core/net_async_task_future.h
#ifndef CAFFE2_NET_ASYNC_TASK_FUTURE_H #define CAFFE2_NET_ASYNC_TASK_FUTURE_H #include <atomic> #include <condition_variable> #include <functional> #include <memory> #include <mutex> #include <string> #include <vector> namespace caffe2 { // Represents the state of AsyncTask execution, that can be queried with // IsC...
1,925
24.012987
73
h
null
pytorch-main/caffe2/core/net_async_task_graph.h
#ifndef CAFFE2_NET_ASYNC_TASK_GRAPH_H #define CAFFE2_NET_ASYNC_TASK_GRAPH_H #include "caffe2/core/net_async_base.h" #include "caffe2/core/net_async_task.h" #include "caffe2/core/net_async_task_future.h" #include "caffe2/core/operator.h" namespace caffe2 { // AsyncTaskGraph represents an execution of a net, it owns t...
2,253
27.531646
80
h
null
pytorch-main/caffe2/core/net_async_tracing.h
/** * Copyright (c) 2016-present, Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable ...
5,093
26.836066
77
h
null
pytorch-main/caffe2/core/net_dag_utils.h
#ifndef CAFFE2_CORE_NET_DAG_UTILS_H_ #define CAFFE2_CORE_NET_DAG_UTILS_H_ #include <atomic> #include <climits> #include <cstddef> #include <thread> // NOLINT #include <typeinfo> #include <unordered_map> #include <unordered_set> #include <vector> #include "c10/util/Registry.h" #include "caffe2/core/blob.h" #include "c...
2,146
29.671429
80
h
null
pytorch-main/caffe2/core/net_parallel.h
#ifndef CAFFE2_CORE_NET_PARALLEL_H #define CAFFE2_CORE_NET_PARALLEL_H #include "caffe2/core/net_async_base.h" #include "caffe2/core/net_async_task_graph.h" C10_DECLARE_string(caffe2_task_graph_engine); namespace caffe2 { class ParallelNetExecutorHelper; class TORCH_API ParallelNet : public NetBase { public: Par...
2,144
23.94186
77
h
null
pytorch-main/caffe2/core/net_simple.h
#ifndef CAFFE2_CORE_NET_SIMPLE_H_ #define CAFFE2_CORE_NET_SIMPLE_H_ #include <vector> #include "c10/util/Registry.h" #include "caffe2/core/common.h" #include "caffe2/core/logging.h" #include "caffe2/core/net.h" #include "caffe2/core/tensor.h" #include "caffe2/core/workspace.h" #include "caffe2/proto/caffe2_pb.h" nam...
2,606
25.876289
79
h
null
pytorch-main/caffe2/core/net_simple_refcount.h
#ifndef CAFFE2_CORE_NET_SIMPLE_REFCOUNT_H_ #define CAFFE2_CORE_NET_SIMPLE_REFCOUNT_H_ #include <vector> #include "c10/util/Registry.h" #include "caffe2/core/common.h" #include "caffe2/core/logging.h" #include "caffe2/core/net.h" #include "caffe2/core/net_simple.h" #include "caffe2/core/tensor.h" #include "caffe2/core...
2,097
33.966667
80
h
null
pytorch-main/caffe2/core/observer.h
#pragma once #include <memory> #include <unordered_set> #include "caffe2/core/logging.h" namespace caffe2 { /** * Use this to implement a Observer using the Observer Pattern template. */ template <class T> class ObserverBase { public: explicit ObserverBase(T* subject) : subject_(subject) {} virtual void S...
3,809
22.090909
80
h
null
pytorch-main/caffe2/core/operator_gradient.h
#ifndef CAFFE2_CORE_OPERATOR_GRADIENT_H_ #define CAFFE2_CORE_OPERATOR_GRADIENT_H_ #include "c10/util/Registry.h" #include "caffe2/core/operator_schema.h" #include "caffe2/proto/caffe2_pb.h" #include "caffe2/utils/proto_utils.h" namespace caffe2 { /* @brief A struct that abstracts on top of dense and sparse blobs. *...
10,222
29.245562
80
h
null
pytorch-main/caffe2/core/operator_schema.h
#ifndef CAFFE2_CORE_OPERATOR_SCHEMA_H_ #define CAFFE2_CORE_OPERATOR_SCHEMA_H_ #include <climits> #include <functional> #include <initializer_list> #include <ostream> #include <set> #include <unordered_map> #include <vector> #include <c10/util/irange.h> #include <c10/util/Registry.h> #include <caffe2/core/common.h> #i...
18,533
29.23491
80
h
null
pytorch-main/caffe2/core/prof_dag_counters.h
#ifndef PROF_DAG_COUNTERS_H #define PROF_DAG_COUNTERS_H #include "caffe2/core/common.h" #include "caffe2/core/logging.h" #include "caffe2/core/timer.h" #include "caffe2/proto/caffe2_pb.h" #include "caffe2/proto/prof_dag.pb.h" #include <unordered_map> namespace caffe2 { class ProfDAGStats { public: ProfDAGStats()...
2,751
21.933333
73
h
null
pytorch-main/caffe2/core/qtensor.h
#ifndef CAFFE2_CORE_QTENSOR_H_ #define CAFFE2_CORE_QTENSOR_H_ #include "caffe2/core/common.h" #include "caffe2/core/context.h" #include "caffe2/core/tensor.h" #include <c10/util/accumulate.h> #include <c10/util/irange.h> #include <c10/util/typeid.h> #include <algorithm> #include <climits> #include <cstddef> #include ...
6,657
24.412214
98
h
null
pytorch-main/caffe2/core/qtensor_serialization.h
#ifndef CAFFE2_CORE_QTENSOR_SERIALIZATION_H_ #define CAFFE2_CORE_QTENSOR_SERIALIZATION_H_ #include "caffe2/core/blob_serialization.h" #include "caffe2/core/qtensor.h" namespace caffe2 { constexpr auto kQTensorBlobQType = "QTensor"; template <class Context> class QTensorSerializer : public BlobSerializerBase { publ...
2,641
28.355556
79
h
null
pytorch-main/caffe2/core/scope_guard.h
/** * Copyright 2016 Facebook * @author Tudor Bosman (tudorb@fb.com) */ #pragma once #include <cstddef> #include <functional> #include <new> #include <type_traits> #include <utility> namespace caffe2 { // Copied from folly/ScopeGuard.h namespace detail { class ScopeGuardImplBase { public: void dismiss() noe...
4,675
28.408805
80
h
null
pytorch-main/caffe2/core/static_tracepoint_elfx86.h
#pragma once // Default constraint for the probe arguments as operands. #ifndef CAFFE_SDT_ARG_CONSTRAINT #define CAFFE_SDT_ARG_CONSTRAINT "nor" #endif // Instruction to emit for the probe. #define CAFFE_SDT_NOP nop // Note section properties. #define CAFFE_SDT_NOTE_NAME "stapsdt" #defi...
5,555
54.009901
80
h
null
pytorch-main/caffe2/core/stats.h
#pragma once #include <atomic> #include <memory> #include <mutex> #include <string> #include <unordered_map> #include <vector> #include "caffe2/core/logging.h" #include "caffe2/core/static_tracepoint.h" namespace caffe2 { class TORCH_API StatValue { std::atomic<int64_t> v_{0}; public: int64_t increment(int64_t...
10,443
28.091922
80
h
null
pytorch-main/caffe2/core/storage.h
#ifndef CAFFE2_CORE_STORAGE_H_ #define CAFFE2_CORE_STORAGE_H_ #include <cstddef> #include <cstdint> #include <fstream> #include <sstream> #include <type_traits> #include <typeinfo> #include <vector> #include "caffe2/core/allocator.h" #include "caffe2/core/common.h" #include "caffe2/core/context.h" #include "caffe2/co...
733
20.588235
36
h
null
pytorch-main/caffe2/core/tensor.h
#ifndef CAFFE2_CORE_TENSOR_H_ #define CAFFE2_CORE_TENSOR_H_ #include <c10/macros/Macros.h> #include "caffe2/core/storage.h" #include <c10/core/SymIntArrayRef.h> #include <ATen/core/UndefinedTensorImpl.h> #include <c10/core/TensorOptions.h> #include <c10/util/ExclusivelyOwned.h> #include <c10/util/ExclusivelyOwnedTens...
19,521
27.921481
108
h
null
pytorch-main/caffe2/core/test_utils.h
#ifndef CAFFE2_UTILS_TEST_UTILS_H_ #define CAFFE2_UTILS_TEST_UTILS_H_ #include "caffe2/core/tensor.h" #include "caffe2/core/workspace.h" #include "caffe2/utils/proto_utils.h" #include <c10/macros/Macros.h> #include <c10/util/irange.h> #include <cmath> #include <string> #include <vector> // Utilities that make it ea...
6,322
27.481982
79
h
null
pytorch-main/caffe2/core/timer.h
#ifndef CAFFE2_CORE_TIMER_H_ #define CAFFE2_CORE_TIMER_H_ #include <chrono> #include "caffe2/core/common.h" namespace caffe2 { /** * @brief A simple timer object for measuring time. * * This is a minimal class around a std::chrono::high_resolution_clock that * serves as a utility class for testing code. */ cla...
1,218
23.877551
76
h
null
pytorch-main/caffe2/core/transform.h
#pragma once #include "caffe2/core/common.h" #include "caffe2/core/graph.h" #include "caffe2/core/workspace.h" #include "caffe2/proto/caffe2_pb.h" #include "caffe2/utils/proto_utils.h" namespace caffe2 { /** * The Transform Base Object * * A Transform is an operation which manipulates a Caffe2 NetDef. * You can ...
5,741
31.811429
80
h
null
pytorch-main/caffe2/core/types.h
#ifndef CAFFE2_CORE_TYPES_H_ #define CAFFE2_CORE_TYPES_H_ #include <cstdint> #include <string> #include <type_traits> #include "caffe2/core/common.h" #include "caffe2/core/logging.h" #include <c10/util/typeid.h> #include "caffe2/proto/caffe2_pb.h" #include <c10/util/Half.h> namespace caffe2 { // Storage orders that...
2,249
25.785714
79
h
null
pytorch-main/caffe2/core/workspace.h
#ifndef CAFFE2_CORE_WORKSPACE_H_ #define CAFFE2_CORE_WORKSPACE_H_ #include "caffe2/core/common.h" #include "caffe2/core/observer.h" #include <climits> #include <cstddef> #include <mutex> #include <typeinfo> #include <unordered_map> #include <unordered_set> #include <vector> #include "c10/util/Registry.h" #include "c...
11,305
31.962099
80
h
null
pytorch-main/caffe2/core/hip/common_miopen.h
/** * Copyright (c) 2016-present, Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable ...
6,281
34.094972
99
h
null
pytorch-main/caffe2/core/hip/miopen_wrapper.h
// Copyright 2004-present Facebook. All Rights Reserved. #ifndef CAFFE2_CORE_MIOPEN_WRAPPERS_H_ #define CAFFE2_CORE_MIOPEN_WRAPPERS_H_ #include "caffe2/core/hip/common_miopen.h" #include "caffe2/core/hip/context_gpu.h" #include <c10/hip/HIPGuard.h> namespace caffe2 { class MIOPENWrapper; /** * MIOPENWorkspace is ...
5,150
29.844311
94
h
null
pytorch-main/caffe2/core/nomnigraph/include/nomnigraph/Converters/Dot.h
#ifndef NOM_CONVERTERS_DOT_H #define NOM_CONVERTERS_DOT_H #include "c10/util/irange.h" #include "nomnigraph/Graph/Algorithms.h" #include "nomnigraph/Graph/Graph.h" #include "nomnigraph/Support/Casting.h" #include <functional> #include <iostream> #include <map> #include <queue> #include <sstream> #include <unordered_m...
9,062
31.483871
78
h
null
pytorch-main/caffe2/core/nomnigraph/include/nomnigraph/Graph/Algorithms.h
//===- nomnigraph/Graph/Algorithms.h - Graph algorithms ---------*- C++ -*-===// // // TODO Licensing. // //===----------------------------------------------------------------------===// // // This file defines algorithms that only require Graph level annotations. // Tarjans is defined. // //===------------------------...
6,493
29.345794
83
h
null
pytorch-main/caffe2/core/nomnigraph/include/nomnigraph/Graph/BinaryMatchImpl.h
#ifndef NOM_GRAPH_BINARYMATCHIMPL_H #define NOM_GRAPH_BINARYMATCHIMPL_H #include "nomnigraph/Graph/Graph.h" namespace nom { namespace algorithm { /// \brief A binary graph matching algorithm based on Kahn's algorithm. template <typename F, typename T, typename... U> std::vector<Subgraph<T, U...>> binaryMatch(Graph<T...
2,874
25.376147
84
h
null
pytorch-main/caffe2/core/nomnigraph/include/nomnigraph/Graph/Graph.h
//===- nomnigraph/Graph/Graph.h - Basic graph implementation ----*- C++ -*-===// // // This file defines a basic graph API for generic and flexible use with // graph algorithms. // //===----------------------------------------------------------------------===// #ifndef NOM_GRAPH_GRAPH_H #define NOM_GRAPH_GRAPH_H #inc...
15,333
26.284698
80
h
null
pytorch-main/caffe2/core/nomnigraph/include/nomnigraph/Graph/TarjansImpl.h
#ifndef NOM_GRAPH_TARJANSIMPL_H #define NOM_GRAPH_TARJANSIMPL_H #include <unordered_map> #include "nomnigraph/Graph/Graph.h" namespace nom { namespace algorithm { template <typename T, typename... U> struct GraphWrapper { struct NodeWrapper { using NodeRef = typename Graph<T, U...>::NodeRef; NodeWrapper(N...
5,526
30.050562
84
h
null
pytorch-main/caffe2/core/nomnigraph/include/nomnigraph/Graph/TopoSort.h
#ifndef NOM_GRAPH_TOPO_SORT_H #define NOM_GRAPH_TOPO_SORT_H #include <unordered_map> #include "nomnigraph/Graph/Graph.h" namespace nom { namespace algorithm { /// \brief Topological sort using DFS. /// /// This algorithm takes a Graph object and returns node references in /// topological order. template <typename G...
2,130
24.070588
77
h
null
pytorch-main/caffe2/core/nomnigraph/include/nomnigraph/Representations/Compiler.h
#ifndef NOM_REPRESENTATIONS_COMPILER_H #define NOM_REPRESENTATIONS_COMPILER_H #include "caffe2/core/common.h" #include "nomnigraph/Graph/Graph.h" #include "nomnigraph/Support/Casting.h" namespace nom { namespace repr { class TORCH_API Value { public: enum class ValueKind { Value, Instruction, Data }; Value(Valu...
2,304
21.598039
72
h
null
pytorch-main/caffe2/core/nomnigraph/include/nomnigraph/Representations/ControlFlow.h
#ifndef NOM_REPRESENTATIONS_CONTROLFLOW_H #define NOM_REPRESENTATIONS_CONTROLFLOW_H #include "caffe2/core/common.h" #include "nomnigraph/Graph/Graph.h" #include "nomnigraph/Representations/Compiler.h" #include <unordered_map> namespace nom { namespace repr { /// \brief A basic block holds a reference to a subgraph ...
5,822
30.475676
78
h
null
pytorch-main/caffe2/core/nomnigraph/include/nomnigraph/Representations/NeuralNet.h
//=== nomnigraph/Representations/NeuralNet.h - NN interface -----*- C++ -*-===// // // TODO Licensing. // //===----------------------------------------------------------------------===// // // This file defines classes that can be used in a // nom::Graph<nom::repr::NeuralNetOperator, nom::repr::NeuralNetData> graph. //...
15,713
28.482176
80
h
null
pytorch-main/caffe2/core/nomnigraph/include/nomnigraph/Support/Casting.h
//===- nomnigraph/Support/Casting.h - Allow casting checks ------*- C++ -*-===// // // This is taken directly from LLVM's source code. // // The original file is distributed under the University of Illinois Open Source // License. // //===----------------------------------------------------------------------===// // //...
14,766
31.242358
80
h
null
pytorch-main/caffe2/core/nomnigraph/include/nomnigraph/Support/Common.h
//== nomnigraph/Support/Common.h - Common class implementations --*- C++ -*-==// // // TODO Licensing. // //===----------------------------------------------------------------------===// // // This file defines basic classes that are useful to inherit from. // //===------------------------------------------------------...
3,279
25.885246
80
h
null
pytorch-main/caffe2/core/nomnigraph/include/nomnigraph/Transformations/Match.h
//=== nomnigraph/Transformations/Match.h - Graph matching utils -*- C++ -*-===// // // TODO Licensing. // //===----------------------------------------------------------------------===// // // This file defines utilities for matching subgraphs. // //===-------------------------------------------------------------------...
2,523
25.568421
80
h
null
pytorch-main/caffe2/core/nomnigraph/include/nomnigraph/Transformations/SubgraphMatcher.h
#ifndef NOM_TRANFORMATIONS_SUBGRAPH_MATCHER_H #define NOM_TRANFORMATIONS_SUBGRAPH_MATCHER_H #include "c10/util/irange.h" #include "caffe2/core/common.h" #include "nomnigraph/Graph/Graph.h" #include <functional> #include <memory> #include <sstream> #include <unordered_map> #include <vector> namespace nom { namespace...
14,898
33.648837
80
h
null
pytorch-main/caffe2/core/nomnigraph/tests/test_util.h
#ifndef NOM_TESTS_TEST_UTIL_H #define NOM_TESTS_TEST_UTIL_H #include "caffe2/core/common.h" #include "nomnigraph/Graph/Graph.h" #include "nomnigraph/Graph/Algorithms.h" #include "nomnigraph/Representations/NeuralNet.h" #include "nomnigraph/Converters/Dot.h" #include <map> class TestClass { public: TestClass() {} ...
3,129
24.867769
95
h
null
pytorch-main/caffe2/cuda_rtc/common_rtc.h
#ifndef CAFFE2_CUDA_RTC_COMMON_RTC_H_ #define CAFFE2_CUDA_RTC_COMMON_RTC_H_ #include <sstream> #include <string> #include <cuda.h> #include <nvrtc.h> #define NVRTC_CHECK(condition) \ do { \ nvrtcResult res...
4,300
31.583333
79
h
null
pytorch-main/caffe2/db/create_db_op.h
#ifndef CAFFE2_DB_CREATE_DB_OP_H_ #define CAFFE2_DB_CREATE_DB_OP_H_ #include "caffe2/core/context.h" #include "caffe2/core/db.h" #include "caffe2/core/operator.h" namespace caffe2 { template <class Context> class CreateDBOp final : public Operator<Context> { public: CreateDBOp(const OperatorDef& operator_def, Wor...
1,190
26.697674
77
h
null
pytorch-main/caffe2/distributed/file_store_handler.h
#pragma once #include <caffe2/distributed/store_handler.h> namespace caffe2 { class TORCH_API FileStoreHandler : public StoreHandler { public: explicit FileStoreHandler(const std::string& path, const std::string& prefix); ~FileStoreHandler() override; void set(const std::string& name, const std::string& data...
1,039
24.365854
80
h
null
pytorch-main/caffe2/distributed/file_store_handler_op.h
#pragma once #include "file_store_handler.h" #include <caffe2/core/operator.h> namespace caffe2 { template <class Context> class FileStoreHandlerCreateOp final : public Operator<Context> { public: explicit FileStoreHandlerCreateOp( const OperatorDef& operator_def, Workspace* ws) : Operator<Cont...
979
23.5
80
h
null
pytorch-main/caffe2/distributed/redis_store_handler.h
#pragma once #include <caffe2/distributed/store_handler.h> extern "C" { #include <hiredis/hiredis.h> } #include <string> namespace caffe2 { class TORCH_API RedisStoreHandler : public StoreHandler { public: explicit RedisStoreHandler(std::string& host, int port, std::string& prefix); virtual ~RedisStoreHandler...
1,060
21.574468
79
h
null
pytorch-main/caffe2/distributed/redis_store_handler_op.h
#pragma once #include "redis_store_handler.h" #include <caffe2/core/operator.h> #include <string> namespace caffe2 { template <class Context> class RedisStoreHandlerCreateOp final : public Operator<Context> { public: explicit RedisStoreHandlerCreateOp( const OperatorDef& operator_def, Workspace* ws)...
1,143
24.422222
79
h
null
pytorch-main/caffe2/distributed/store_handler.h
#pragma once #include <chrono> #include <cstdint> #include <stdexcept> #include <string> #include <vector> #include "caffe2/core/common.h" namespace caffe2 { class TORCH_API StoreHandler { public: static constexpr std::chrono::milliseconds kDefaultTimeout = std::chrono::seconds(30); static constexpr std:...
2,522
26.725275
80
h
null
pytorch-main/caffe2/experiments/operators/fully_connected_op_decomposition.h
/** * Copyright (c) 2016-present, Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable ...
8,170
26.982877
80
h
null
pytorch-main/caffe2/experiments/operators/fully_connected_op_prune.h
/** * Copyright (c) 2016-present, Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable ...
11,801
27.926471
79
h
null
pytorch-main/caffe2/experiments/operators/fully_connected_op_sparse.h
/** * Copyright (c) 2016-present, Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable ...
4,601
22.84456
78
h
null
pytorch-main/caffe2/experiments/operators/funhash_op.h
/** * Copyright (c) 2016-present, Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable ...
7,342
29.983122
75
h
null
pytorch-main/caffe2/experiments/operators/sparse_funhash_op.h
/** * Copyright (c) 2016-present, Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable ...
7,548
30.194215
80
h
null
pytorch-main/caffe2/experiments/operators/sparse_matrix_reshape_op.h
/** * Copyright (c) 2016-present, Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable ...
4,305
31.870229
75
h
null
pytorch-main/caffe2/experiments/operators/tt_contraction_op.h
/** * Copyright (c) 2016-present, Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable ...
4,750
26.462428
78
h
null
pytorch-main/caffe2/experiments/operators/tt_pad_op.h
/** * Copyright (c) 2016-present, Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable ...
2,779
28.263158
77
h
null
pytorch-main/caffe2/ideep/ideep_utils.h
#pragma once #include <caffe2/core/macros.h> // For caffe2 macros. #include <caffe2/utils/eigen_utils.h> // All caffe2 ideep related headers #include <ideep.hpp> #include <caffe2/ideep/utils/ideep_context.h> #include <caffe2/ideep/utils/ideep_operator.h> namespace caffe2 { enum ConvAlgorithm { CONV_ALGORITHM_AUTO...
2,209
44.102041
80
h
null
pytorch-main/caffe2/ideep/operators/conv_pool_base_op.h
#ifndef CAFFE2_IDEEP_OPERATORS_CONV_POOL_BASE_OP_H_ #define CAFFE2_IDEEP_OPERATORS_CONV_POOL_BASE_OP_H_ #include <vector> #include "caffe2/ideep/ideep_utils.h" #include "caffe2/operators/conv_pool_op_base.h" namespace caffe2 { class IDEEPConvPoolOpBase : public ConvPoolOpBase<IDEEPContext> { public: IDEEPConvPoo...
2,115
26.128205
69
h
null
pytorch-main/caffe2/ideep/operators/conv_transpose_unpool_base_op.h
#pragma once #include "caffe2/ideep/ideep_utils.h" #include "caffe2/proto/caffe2_legacy.pb.h" using namespace caffe2; namespace { class IDEEPConvTransposeUnpoolBase : public IDEEPOperator { public: USE_IDEEP_DEF_ALIASES(); USE_IDEEP_OPERATOR_FUNCTIONS(); IDEEPConvTransposeUnpoolBase(const OperatorDef& opera...
7,792
28.518939
78
h
null
pytorch-main/caffe2/ideep/operators/operator_fallback_ideep.h
#pragma once #include <caffe2/core/common.h> #include <caffe2/core/context.h> #include <caffe2/core/operator.h> #include <caffe2/ideep/ideep_utils.h> #include <caffe2/proto/caffe2_pb.h> namespace caffe2 { /** * @brief A templated class to allow one to wrap a CPU operator as an IDEEP * operator. * * This class ca...
7,776
39.717277
91
h
null
pytorch-main/caffe2/ideep/utils/ideep_context.h
#pragma once #include <cstdlib> #include <ctime> #include <random> #include <caffe2/core/context.h> namespace caffe2 { class IDEEPContext final : public BaseContext { public: typedef std::mt19937 rand_gen_type; IDEEPContext() : random_seed_(RandomNumberSeed()) {} explicit IDEEPContext(const DeviceOption& opt...
4,170
23.25
80
h
null
pytorch-main/caffe2/ideep/utils/ideep_operator.h
#pragma once #include <ideep.hpp> #include <caffe2/core/operator.h> #include <caffe2/proto/caffe2_pb.h> namespace caffe2 { C10_DECLARE_REGISTRY( IDEEPOperatorRegistry, OperatorBase, const OperatorDef&, Workspace*); #define REGISTER_IDEEP_OPERATOR_CREATOR(key, ...) \ C10_REGISTER_CREATOR(IDEEPOpera...
5,379
34.629139
80
h
null
pytorch-main/caffe2/image/transform_gpu.h
#ifndef CAFFE2_IMAGE_TRANSFORM_GPU_H_ #define CAFFE2_IMAGE_TRANSFORM_GPU_H_ /** * * Copyright (c) 2016, NVIDIA CORPORATION, All rights reserved * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributi...
1,705
37.772727
82
h
null
pytorch-main/caffe2/mobile/contrib/ios/ios_caffe.h
#ifdef __cplusplus #include <string> #include <vector> #include "caffe2/mobile/contrib/ios/ios_caffe_defines.h" #include "caffe2/mobile/contrib/ios/ios_caffe_predictor.h" #include "caffe2/predictor/predictor.h" extern "C" { IOS_CAFFE_EXPORT Caffe2IOSPredictor* MakeCaffe2Predictor(const std::string& init_net_str, ...
1,102
41.423077
92
h
null
pytorch-main/caffe2/mobile/contrib/ios/ios_caffe_predictor.h
#pragma once #include <string> #include "caffe2/core/net.h" #include "caffe2/mobile/contrib/ios/ios_caffe_defines.h" #include "caffe2/predictor/predictor.h" struct Tensor { std::vector<int64_t> dims; uint8_t* data; }; class IOS_CAFFE_EXPORT Caffe2IOSPredictor final { public: /** @allowMetalOperators Allow...
1,312
34.486486
98
h
null
pytorch-main/caffe2/mobile/contrib/ios/mpscnn/mpscnn.h
#pragma once #include "caffe2/core/net.h" #include "caffe2/utils/math.h" namespace caffe2 { static constexpr const char* kMPSCNNReadCountArg = "__mpscnn_read_count__"; static constexpr const char* kMPSCNNOutputIsTempImageArg = "__mpscnn_output_is_temp_img__"; static constexpr const int kMetalMaxTextureArrLength = 204...
948
38.541667
99
h
null
pytorch-main/caffe2/mobile/contrib/ios/mpscnn/mpscnn_context.h
#pragma once #import <Metal/MTLBuffer.h> #import <Metal/MTLDevice.h> #import <Metal/MTLLibrary.h> #include <array> #include <mutex> #include <string> #include <thread> #include <unordered_map> namespace caffe2 { struct MPSCNNContext { public: id<MTLDevice> device; id<MTLCommandQueue> commandQueue; id<MTLLib...
791
22.294118
96
h
null
pytorch-main/caffe2/mobile/contrib/ios/mpscnn/mpscnn_graph_mask.h
#pragma once #include "caffe2/core/net.h" #include "mpscnn.h" namespace caffe2 { // We currently only try to convert a fixed set of operators that handle a subset of a full // CNN. We also only run when MPSCNN is available, provides a speedup. // On failure, returns false. On success, returns true, and sets the MPSCN...
698
40.117647
93
h
null
pytorch-main/caffe2/mobile/contrib/libopencl-stub/include/CL/cl_ext.h
/******************************************************************************* * Copyright (c) 2008 - 2012 The Khronos Group Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and/or associated documentation files (the * "Materials"), to deal in the Materials...
11,540
44.797619
121
h
null
pytorch-main/caffe2/mobile/contrib/libopencl-stub/include/CL/cl_gl.h
/********************************************************************************** * Copyright (c) 2008 - 2012 The Khronos Group Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and/or associated documentation files (the * "Materials"), to deal in the Materi...
7,343
44.055215
107
h
null
pytorch-main/caffe2/mobile/contrib/libopencl-stub/include/CL/cl_gl_ext.h
/********************************************************************************** * Copyright (c) 2008-2012 The Khronos Group Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and/or associated documentation files (the * "Materials"), to deal in the Material...
2,630
36.585714
94
h
null
pytorch-main/caffe2/mobile/contrib/libopencl-stub/include/CL/opencl.h
/******************************************************************************* * Copyright (c) 2008-2012 The Khronos Group Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and/or associated documentation files (the * "Materials"), to deal in the Materials w...
1,754
30.909091
81
h
null
pytorch-main/caffe2/mobile/contrib/libvulkan-stub/include/vulkan/vk_platform.h
// // File: vk_platform.h // /* ** Copyright (c) 2014-2015 The Khronos Group Inc. ** ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License. ** You may obtain a copy of the License at ** ** http://www.apache.org/licenses/LICENSE-2.0 ** *...
3,903
31.264463
99
h
null
pytorch-main/caffe2/mobile/contrib/nnapi/dlnnapi.c
/** * Copyright (c) 2016-present, Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable ...
4,073
30.338462
77
c
null
pytorch-main/caffe2/mobile/contrib/nnapi/nnapi.h
#include "caffe2/core/operator.h" #include "caffe2/core/tensor.h" #include "caffe2/core/types.h" #include "caffe2/utils/proto_utils.h" #include "NeuralNetworks.h" #include "dlnnapi.h" namespace caffe2 { class NNApi { public: using TensorVector = std::vector<TensorCPU*>; // Three different modes: // ANEURALNE...
2,669
23.495413
73
h
null
pytorch-main/caffe2/mobile/contrib/ulp2/ulp.h
#pragma once #include "caffe2/core/operator.h" #include "caffe2/core/tensor.h" namespace caffe2 { constexpr size_t k2b1bXBits = 2; struct ConvArgs { int stride_w{1}; int stride_h{1}; int pad_l{0}; int pad_t{0}; int pad_b{0}; int pad_r{0}; }; using ParallelFor = std::function<void(size_t, std::function<...
2,346
32.528571
100
h
null
pytorch-main/caffe2/mpi/mpi_common.h
#ifndef CAFFE2_MPI_MPI_COMMON_H_ #define CAFFE2_MPI_MPI_COMMON_H_ #include <mpi.h> #include <mutex> #include "caffe2/core/common.h" #include "caffe2/core/logging.h" namespace caffe2 { inline void CheckInitializedMPI() { int flag; MPI_Initialized(&flag); CAFFE_ENFORCE(flag, "MPI does not seem to have been init...
4,756
28.73125
79
h
null
pytorch-main/caffe2/mpi/mpi_ops.h
#ifndef CAFFE2_MPI_MPI_OPS_H_ #define CAFFE2_MPI_MPI_OPS_H_ #include <mpi.h> #include "caffe2/core/operator.h" #include "caffe2/mpi/mpi_common.h" namespace caffe2 { // TODO(jiayq): if needed, write up the use of color and key with MPI split. // Currently, the operator simply creates a communicator that has the // s...
7,787
30.277108
80
h
null
pytorch-main/caffe2/observers/operator_attaching_net_observer.h
#pragma once #include "caffe2/core/net.h" #include "caffe2/core/observer.h" #include "caffe2/core/operator.h" namespace caffe2 { // Thin class that attaches the observer to all operators in the net template <typename TOpObserver, typename TNetObserver> class OperatorAttachingNetObserver : public ObserverBase<NetBase...
907
27.375
69
h
null
pytorch-main/caffe2/observers/profile_observer.h
/** * Copyright (c) 2016-present, Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable ...
3,258
27.587719
79
h
null
pytorch-main/caffe2/observers/runcnt_observer.h
#pragma once #include "caffe2/core/net.h" #include "caffe2/core/observer.h" #include "caffe2/core/operator.h" #include "caffe2/observers/operator_attaching_net_observer.h" namespace caffe2 { class RunCountNetObserver; class TORCH_API RunCountOperatorObserver final : public ObserverBase<OperatorBase> { public: ...
1,391
24.777778
80
h
null
pytorch-main/caffe2/observers/time_observer.h
#ifndef CAFFE2_CONTRIB_OBSERVERS_TIME_OBSERVER_H_ #define CAFFE2_CONTRIB_OBSERVERS_TIME_OBSERVER_H_ #include <unordered_map> #include "caffe2/core/common.h" #include "caffe2/core/net.h" #include "caffe2/core/observer.h" #include "caffe2/core/operator.h" #include "caffe2/core/timer.h" #include "caffe2/observers/operat...
1,862
24.520548
80
h
null
pytorch-main/caffe2/onnx/backend.h
#pragma once #include "caffe2/onnx/backend_rep.h" #include "caffe2/onnx/device.h" #include "caffe2/onnx/helper.h" #include "caffe2/proto/caffe2_pb.h" #include "onnx/onnx_pb.h" #include <functional> #include <string> #include <unordered_map> #include <unordered_set> constexpr int kKnownOpsetVersion = 9; namespace ca...
8,674
29.762411
80
h
null
pytorch-main/caffe2/onnx/backend_rep.h
#pragma once #include "caffe2/predictor/predictor.h" #include "caffe2/proto/caffe2_pb.h" #include <memory> #include <string> #include <vector> namespace caffe2 { namespace onnx { class TORCH_API Caffe2BackendRep { public: void Run( const caffe2::Predictor::TensorList& inputs, caffe2::Predictor::Tensor...
1,137
21.313725
64
h
null
pytorch-main/caffe2/onnx/helper.h
#pragma once #include "caffe2/core/common.h" #include "onnx/onnx_pb.h" #include <set> #include <string> #include <unordered_set> namespace caffe2 { namespace onnx { using ::ONNX_NAMESPACE::AttributeProto; using ::ONNX_NAMESPACE::NodeProto; // \brief This class generates unique dummy names class TORCH_API DummyName...
2,819
22.898305
75
h
null
pytorch-main/caffe2/onnx/offline_tensor.h
#pragma once #include <c10/core/Storage.h> #include "caffe2/core/operator.h" #include "caffe2/core/tensor.h" namespace caffe2 { #ifndef C10_MOBILE struct TORCH_API OfflineTensor { // A shell tensor to record shape and dtype Tensor shape_tensor{CPU}; void setShapeAndType( const std::vector<int>& sizes, ...
1,645
29.481481
75
h
null
pytorch-main/caffe2/onnx/onnx_exporter.h
#pragma once #include "caffe2/core/common.h" #include "caffe2/core/tensor.h" #include "caffe2/onnx/helper.h" #include "caffe2/proto/caffe2_pb.h" #include "onnx/onnx_pb.h" #include <string> #include <unordered_map> #include <vector> namespace caffe2 { namespace onnx { namespace { using ::ONNX_NAMESPACE::AttributePro...
4,843
32.178082
80
h
null
pytorch-main/caffe2/onnx/onnxifi_graph_info.h
#pragma once #include <functional> #include <memory> #include <mutex> #include <unordered_map> #include "caffe2/core/logging.h" #include "caffe2/opt/shape_info.h" #include "foxi/onnxifi_loader.h" namespace caffe2 { namespace onnx { struct BackendGraphInfo { onnxBackendID backend_id; onnxBackend backend; onnxG...
3,539
29.782609
80
h
null
pytorch-main/caffe2/onnx/torch_ops/operator_sets.h
#pragma once #include "onnx/defs/schema.h" namespace ONNX_NAMESPACE { class ONNX_OPERATOR_SET_SCHEMA_CLASS_NAME( PyTorch, 1, SparseLengthsSumFused8BitRowwise); class ONNX_OPERATOR_SET_SCHEMA_CLASS_NAME(PyTorch, 1, SparseLengthsSum); class ONNX_OPERATOR_SET_SCHEMA_CLASS_NAME(PyTorch, 1, SparseLengthsWeigh...
1,779
36.87234
80
h
null
pytorch-main/caffe2/operators/accumulate_op.h
#ifndef CAFFE2_OPERATORS_ACCUMULATE_OP_H_ #define CAFFE2_OPERATORS_ACCUMULATE_OP_H_ #include "caffe2/core/context.h" #include "caffe2/core/operator.h" #include "caffe2/utils/math.h" namespace caffe2 { template <typename T, class Context> class AccumulateOp final : public Operator<Context> { public: template <clas...
1,073
24.571429
73
h