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/operators/sparse_normalize_op.h
#pragma once #include "caffe2/core/operator.h" #include "caffe2/utils/math.h" namespace caffe2 { template <typename T, class Context> class TORCH_API SparseNormalizeOp final : public Operator<Context> { public: USE_OPERATOR_CONTEXT_FUNCTIONS; template <class... Args> explicit SparseNormalizeOp(Args&&... args)...
834
23.558824
74
h
null
pytorch-main/caffe2/operators/sparse_to_dense_mask_op.h
#ifndef CAFFE2_OPERATORS_SPARSE_TO_DENSE_MASK_OP_H_ #define CAFFE2_OPERATORS_SPARSE_TO_DENSE_MASK_OP_H_ #include <algorithm> #include <unordered_map> #include <vector> #include "caffe2/core/context.h" #include "caffe2/core/export_caffe2_op_to_c10.h" #include <c10/util/irange.h> #include "caffe2/core/operator.h" #inclu...
10,051
32.395349
80
h
null
pytorch-main/caffe2/operators/sparse_to_dense_op.h
#ifndef CAFFE2_OPERATORS_SPARSE_TO_DENSE_OP_H_ #define CAFFE2_OPERATORS_SPARSE_TO_DENSE_OP_H_ #include "caffe2/core/context.h" #include "caffe2/core/operator.h" #include "caffe2/utils/math.h" #include "c10/util/irange.h" namespace caffe2 { template <class Context> class SparseToDenseOp final : public Operator<Contex...
4,010
30.093023
95
h
null
pytorch-main/caffe2/operators/spatial_batch_norm_op.h
#ifndef CAFFE2_OPERATORS_SPATIAL_BATCH_NORM_OP_H_ #define CAFFE2_OPERATORS_SPATIAL_BATCH_NORM_OP_H_ #include <algorithm> #include <array> #include <functional> #include <limits> #include <string> #include <vector> #include "caffe2/core/context.h" #include "caffe2/core/operator.h" #include "caffe2/utils/eigen_utils.h"...
15,176
30.42236
80
h
null
pytorch-main/caffe2/operators/spatial_softmax_with_loss_op.h
#ifndef SPATIAL_SOFTMAX_WITH_LOSS_OP_H_ #define SPATIAL_SOFTMAX_WITH_LOSS_OP_H_ #include "caffe2/core/context.h" #include "caffe2/core/logging.h" #include "caffe2/core/operator.h" #include "caffe2/utils/math.h" namespace caffe2 { template <typename T, class Context> class SpatialSoftmaxWithLossOp final : public Oper...
2,182
29.746479
80
h
null
pytorch-main/caffe2/operators/square_root_divide_op.h
#ifndef CAFFE2_OPERATORS_SQUARE_ROOT_DIVIDE_OP_H_ #define CAFFE2_OPERATORS_SQUARE_ROOT_DIVIDE_OP_H_ #include "caffe2/core/context.h" #include "caffe2/core/operator.h" #include "caffe2/utils/math.h" #include "c10/util/irange.h" namespace caffe2 { template <class Context> class SquareRootDivideOp final : public Operat...
1,896
28.184615
80
h
null
pytorch-main/caffe2/operators/stats_put_ops.h
#include <limits> #include "caffe2/core/operator.h" #include "caffe2/core/stats.h" #include "caffe2/core/tensor.h" #include "caffe2/core/types.h" namespace caffe2 { template <typename T> struct TemplatePutOp : public Operator<CPUContext> { explicit TemplatePutOp(const OperatorDef& operator_def, Workspace* ws) ...
2,813
28.010309
77
h
null
pytorch-main/caffe2/operators/stop_gradient.h
#ifndef CAFFE2_OPERATORS_STOP_GRADIENT_H_ #define CAFFE2_OPERATORS_STOP_GRADIENT_H_ #include "caffe2/core/operator.h" namespace caffe2 { template <class Context> class StopGradientOp : public Operator<Context> { public: USE_SIMPLE_CTOR_DTOR(StopGradientOp) USE_OPERATOR_CONTEXT_FUNCTIONS; bool RunOnDevice() ov...
548
20.115385
49
h
null
pytorch-main/caffe2/operators/string_ops.h
#ifndef CAFFE2_OPERATORS_STRING_OPS_H_ #define CAFFE2_OPERATORS_STRING_OPS_H_ #include "caffe2/core/operator.h" #include "caffe2/operators/elementwise_ops.h" namespace caffe2 { /** * ForEach is a unary functor that forwards each element of the input array * into the elementwise Functor provided, and gathers the re...
2,075
25.615385
77
h
null
pytorch-main/caffe2/operators/stump_func_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,112
28.347222
79
h
null
pytorch-main/caffe2/operators/summarize_op.h
#ifndef CAFFE2_OPERATORS_SUMMARIZE_OP_H_ #define CAFFE2_OPERATORS_SUMMARIZE_OP_H_ #include <fstream> #include "caffe2/core/context.h" #include "caffe2/core/operator.h" #include "caffe2/utils/math.h" namespace caffe2 { constexpr char kSummaryzeOpExtension[] = ".summary"; template <typename T, class Context> class S...
1,884
29.403226
75
h
null
pytorch-main/caffe2/operators/swish_op.h
#ifndef CAFFE2_OPERATORS_SWISH_OP_H_ #define CAFFE2_OPERATORS_SWISH_OP_H_ #include "caffe2/operators/elementwise_ops.h" #include "caffe2/utils/math.h" namespace caffe2 { template <class Context> struct SwishFunctor { template <typename T> bool operator()(const int N, const T* X, T* Y, Context* context) const; };...
772
20.472222
76
h
null
pytorch-main/caffe2/operators/tensor_protos_db_input.h
#ifndef CAFFE2_OPERATORS_TENSOR_PROTOS_DB_INPUT_H_ #define CAFFE2_OPERATORS_TENSOR_PROTOS_DB_INPUT_H_ #include "caffe2/core/db.h" #include "caffe2/operators/prefetch_op.h" #include "c10/util/irange.h" #include <iostream> #include <mutex> namespace caffe2 { template <class Context> class TensorProtosDBInput final : ...
3,697
32.926606
79
h
null
pytorch-main/caffe2/operators/text_file_reader_utils.h
#ifndef CAFFE2_OPERATORS_TEXT_FILE_READER_UTILS_H #define CAFFE2_OPERATORS_TEXT_FILE_READER_UTILS_H #include <memory> #include <string> #include <vector> #include "caffe2/core/common.h" namespace caffe2 { struct TORCH_API Token { int startDelimId; const char* start; const char* end; }; class TORCH_API Tokeni...
2,922
22.764228
77
h
null
pytorch-main/caffe2/operators/thresholded_relu_op.h
#ifndef CAFFE2_OPERATORS_THRESHOLDED_RELU_OP_H_ #define CAFFE2_OPERATORS_THRESHOLDED_RELU_OP_H_ #include "caffe2/core/common_omp.h" #include "caffe2/core/context.h" #include "caffe2/core/logging.h" #include "caffe2/core/operator.h" namespace caffe2 { template <typename T, class Context> class ThresholdedReluOp final...
1,137
23.73913
66
h
null
pytorch-main/caffe2/operators/tile_op.h
#ifndef CAFFE2_OPERATORS_TILE_OP_H_ #define CAFFE2_OPERATORS_TILE_OP_H_ #include <array> #include <string> #include <type_traits> #include <vector> #include "caffe2/core/common_omp.h" #include "caffe2/core/context.h" #include "caffe2/core/logging.h" #include "caffe2/core/operator.h" #include "caffe2/utils/eigen_utils...
8,776
31.628253
78
h
null
pytorch-main/caffe2/operators/transpose_op.h
#ifndef CAFFE2_OPERATORS_TRANSPOSE_H_ #define CAFFE2_OPERATORS_TRANSPOSE_H_ #include <algorithm> #include <vector> #include "caffe2/core/context.h" #include "caffe2/core/operator.h" #include "caffe2/utils/math.h" #include "c10/util/irange.h" namespace caffe2 { template <class Context> class TransposeOp : public Ope...
2,086
25.75641
80
h
null
pytorch-main/caffe2/operators/tt_linear_op.h
#ifndef CAFFE2_OPERATORS_TT_LINEAR_OP_H_ #define CAFFE2_OPERATORS_TT_LINEAR_OP_H_ #ifdef CAFFE2_USE_MKL #include <mkl.h> #endif // CAFFE2_USE_MKL #include "Eigen/Core" #include "Eigen/Dense" #include "caffe2/core/context.h" #include "caffe2/core/operator.h" #include "caffe2/utils/eigen_utils.h" #include "caffe2/utils...
6,474
32.035714
80
h
null
pytorch-main/caffe2/operators/unique_ops.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 ...
1,666
26.327869
79
h
null
pytorch-main/caffe2/operators/unsafe_coalesce.h
#ifndef CAFFE2_OPERATORS_UNSAFE_COALESCE_OP_H_ #define CAFFE2_OPERATORS_UNSAFE_COALESCE_OP_H_ #include "caffe2/core/context.h" #include "caffe2/core/export_caffe2_op_to_c10.h" #include <c10/util/irange.h> #include "caffe2/core/operator.h" namespace caffe2 { template <class Context> class UnsafeCoalesceOp final : pu...
2,533
34.690141
107
h
null
pytorch-main/caffe2/operators/upsample_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,246
28.181818
75
h
null
pytorch-main/caffe2/operators/variable_length_sequence_padding.h
#pragma once #include "caffe2/core/context.h" #include "caffe2/core/operator.h" #include "caffe2/utils/eigen_utils.h" #include "caffe2/utils/math.h" namespace caffe2 { namespace detail { template <typename T, typename Context> void VariableLengthSequencePadding( int N, int B, int M, T* X, const i...
1,386
23.333333
77
h
null
pytorch-main/caffe2/operators/weighted_multi_sampling_op.h
#pragma once #include "caffe2/core/context.h" #include "caffe2/core/operator.h" namespace caffe2 { template <class Context> class WeightedMultiSamplingOp : public Operator<Context> { public: USE_OPERATOR_CONTEXT_FUNCTIONS; template <class... Args> explicit WeightedMultiSamplingOp(Args&&... args) : Opera...
602
21.333333
74
h
null
pytorch-main/caffe2/operators/weighted_sample_op.h
// Copyright 2004-present Facebook. All Rights Reserved. #ifndef CAFFE2_OPERATORS_WEIGHTEDSAMPLE_OP_H_ #define CAFFE2_OPERATORS_WEIGHTEDSAMPLE_OP_H_ #include "caffe2/core/context.h" #include "caffe2/core/operator.h" #include "caffe2/core/tensor.h" #include "caffe2/utils/math.h" namespace caffe2 { template <typename...
739
22.125
57
h
null
pytorch-main/caffe2/operators/while_op.h
#ifndef CAFFE2_OPERATORS_WHILE_OP_H_ #define CAFFE2_OPERATORS_WHILE_OP_H_ #include "caffe2/core/context.h" #include "caffe2/core/logging.h" #include "caffe2/core/operator.h" namespace caffe2 { template <class Context> class WhileOp final : public Operator<Context> { public: explicit WhileOp(const OperatorDef& ope...
1,961
25.876712
77
h
null
pytorch-main/caffe2/operators/hip/activation_ops_miopen.h
#ifndef CAFFE2_OPERATORS_ACTIVATION_OPS_MIOPEN_H_ #define CAFFE2_OPERATORS_ACTIVATION_OPS_MIOPEN_H_ #include "caffe2/core/hip/context_gpu.h" #include "caffe2/core/hip/miopen_wrapper.h" #include "caffe2/core/operator.h" #include "caffe2/core/tensor.h" #include "caffe2/core/types.h" namespace caffe2 { class MIOPENActi...
4,678
29.782895
78
h
null
pytorch-main/caffe2/operators/quantized/int8_add_op.h
#ifndef CAFFE2_OPERATORS_INT8_ADD_OP_H_ #define CAFFE2_OPERATORS_INT8_ADD_OP_H_ #include <qnnpack.h> #include "caffe2/core/context.h" #include "caffe2/core/operator.h" #include "caffe2/core/tensor_int8.h" #include "caffe2/operators/quantized/int8_utils.h" namespace caffe2 { namespace int8 { template <Activation Ac...
3,630
29.512605
82
h
null
pytorch-main/caffe2/operators/quantized/int8_average_pool_op.h
#ifndef CAFFE2_OPERATORS_INT8_AVERAGE_POOL_OP_H_ #define CAFFE2_OPERATORS_INT8_AVERAGE_POOL_OP_H_ #include <qnnpack.h> #include "caffe2/core/context.h" #include "caffe2/core/operator.h" #include "caffe2/core/tensor_int8.h" #include "caffe2/operators/conv_pool_op_base.h" #include "caffe2/operators/quantized/int8_utils...
5,814
33.408284
79
h
null
pytorch-main/caffe2/operators/quantized/int8_channel_shuffle_op.h
#ifndef CAFFE2_OPERATORS_INT8_CHANNEL_SHUFFLE_OP_H_ #define CAFFE2_OPERATORS_INT8_CHANNEL_SHUFFLE_OP_H_ #include <qnnpack.h> #include "caffe2/core/context.h" #include "caffe2/core/operator.h" #include "caffe2/core/tensor_int8.h" #include "caffe2/operators/conv_pool_op_base.h" #include "caffe2/operators/quantized/int8...
3,459
31.037037
79
h
null
pytorch-main/caffe2/operators/quantized/int8_concat_op.h
#ifndef CAFFE2_OPERATORS_INT8_CONCAT_OP_H_ #define CAFFE2_OPERATORS_INT8_CONCAT_OP_H_ #include <c10/util/irange.h> #include "caffe2/core/context.h" #include "caffe2/core/operator.h" #include "caffe2/core/tensor_int8.h" #include "caffe2/operators/quantized/int8_utils.h" namespace caffe2 { namespace int8 { class Int8...
3,175
33.150538
80
h
null
pytorch-main/caffe2/operators/quantized/int8_conv_op.h
#ifndef CAFFE2_OPERATORS_INT8_CONV_OP_H_ #define CAFFE2_OPERATORS_INT8_CONV_OP_H_ #include <qnnpack.h> #include "caffe2/core/context.h" #include "caffe2/core/operator.h" #include "caffe2/core/tensor_int8.h" #include "caffe2/operators/conv_op_shared.h" #include "caffe2/operators/conv_pool_op_base.h" #include "caffe2/o...
6,290
33.95
77
h
null
pytorch-main/caffe2/operators/quantized/int8_conv_transpose_op.h
#ifndef CAFFE2_OPERATORS_INT8_CONV_TRANSPOSE_OP_H_ #define CAFFE2_OPERATORS_INT8_CONV_TRANSPOSE_OP_H_ #include <qnnpack.h> #include "caffe2/core/context.h" #include "caffe2/core/operator.h" #include "caffe2/core/tensor_int8.h" #include "caffe2/operators/conv_op_shared.h" #include "caffe2/operators/conv_transpose_unpo...
5,947
33.183908
78
h
null
pytorch-main/caffe2/operators/quantized/int8_dequantize_op.h
#ifndef CAFFE2_OPERATORS_INT8_DEQUANTIZE_OP_H_ #define CAFFE2_OPERATORS_INT8_DEQUANTIZE_OP_H_ #include "caffe2/core/context.h" #include "caffe2/core/operator.h" #include "caffe2/core/tensor_int8.h" #include "caffe2/operators/quantized/int8_utils.h" #include <c10/util/irange.h> namespace caffe2 { namespace int8 { n...
1,185
20.563636
64
h
null
pytorch-main/caffe2/operators/quantized/int8_fc_op.h
#ifndef CAFFE2_OPERATORS_INT8_FC_OP_H_ #define CAFFE2_OPERATORS_INT8_FC_OP_H_ #include <qnnpack.h> #include "caffe2/core/context.h" #include "caffe2/core/operator.h" #include "caffe2/core/tensor_int8.h" #include "caffe2/operators/conv_op_shared.h" #include "caffe2/operators/quantized/int8_utils.h" namespace caffe2 {...
4,551
31.748201
80
h
null
pytorch-main/caffe2/operators/quantized/int8_flatten_op.h
#ifndef CAFFE2_OPERATORS_INT8_FLATTEN_OP_H_ #define CAFFE2_OPERATORS_INT8_FLATTEN_OP_H_ #include "caffe2/core/context.h" #include "caffe2/core/operator.h" #include "caffe2/core/tensor_int8.h" #include "caffe2/operators/quantized/int8_utils.h" namespace caffe2 { namespace int8 { class Int8FlattenOp : public Operator...
1,421
28.020408
80
h
null
pytorch-main/caffe2/operators/quantized/int8_given_tensor_fill_op.h
#ifndef CAFFE2_OPERATORS_INT8_GIVEN_TENSOR_FILL_OP_H_ #define CAFFE2_OPERATORS_INT8_GIVEN_TENSOR_FILL_OP_H_ #include "caffe2/core/context.h" #include "caffe2/core/logging.h" #include "caffe2/core/operator.h" #include "caffe2/core/tensor_int8.h" #include "caffe2/operators/filler_op.h" #include "caffe2/utils/cast.h" #in...
3,976
31.333333
80
h
null
pytorch-main/caffe2/operators/quantized/int8_leaky_relu_op.h
#ifndef CAFFE2_OPERATORS_INT8_LEAKY_RELU_OP_H_ #define CAFFE2_OPERATORS_INT8_LEAKY_RELU_OP_H_ #include <qnnpack.h> #include "caffe2/core/context.h" #include "caffe2/core/operator.h" #include "caffe2/core/tensor_int8.h" #include "caffe2/operators/quantized/int8_utils.h" namespace caffe2 { namespace int8 { class Int...
3,658
30.273504
80
h
null
pytorch-main/caffe2/operators/quantized/int8_max_pool_op.h
#ifndef CAFFE2_OPERATORS_INT8_MAX_POOL_OP_H_ #define CAFFE2_OPERATORS_INT8_MAX_POOL_OP_H_ #include <qnnpack.h> #include "caffe2/core/context.h" #include "caffe2/core/operator.h" #include "caffe2/core/tensor_int8.h" #include "caffe2/operators/conv_pool_op_base.h" #include "caffe2/operators/quantized/int8_utils.h" nam...
3,447
29.785714
80
h
null
pytorch-main/caffe2/operators/quantized/int8_quantize_op.h
#ifndef CAFFE2_OPERATORS_INT8_QUANTIZE_OP_H_ #define CAFFE2_OPERATORS_INT8_QUANTIZE_OP_H_ #include "caffe2/core/context.h" #include "caffe2/core/operator.h" #include "caffe2/core/tensor_int8.h" #include "caffe2/operators/quantized/int8_simd.h" #include "caffe2/operators/quantized/int8_utils.h" namespace caffe2 { nam...
2,996
30.882979
80
h
null
pytorch-main/caffe2/operators/quantized/int8_relu_op.h
#ifndef CAFFE2_OPERATORS_INT8_RELU_OP_H_ #define CAFFE2_OPERATORS_INT8_RELU_OP_H_ #include <qnnpack.h> #include "caffe2/core/context.h" #include "caffe2/core/operator.h" #include "caffe2/core/tensor_int8.h" #include "caffe2/operators/quantized/int8_utils.h" namespace caffe2 { namespace int8 { class Int8ReluOp fina...
3,060
29.306931
77
h
null
pytorch-main/caffe2/operators/quantized/int8_reshape_op.h
#ifndef CAFFE2_OPERATORS_INT8_RESHAPE_OP_H_ #define CAFFE2_OPERATORS_INT8_RESHAPE_OP_H_ #include "caffe2/core/context.h" #include "caffe2/core/operator.h" #include "caffe2/core/tensor_int8.h" #include "caffe2/operators/quantized/int8_utils.h" #include "caffe2/operators/reshape_op.h" namespace caffe2 { namespace int8...
1,416
27.918367
80
h
null
pytorch-main/caffe2/operators/quantized/int8_resize_nearest_op.h
#ifndef CAFFE2_OPERATORS_INT8_RESIZE_NEAREST_OP_H_ #define CAFFE2_OPERATORS_INT8_RESIZE_NEAREST_OP_H_ #include "caffe2/core/context.h" #include "caffe2/core/operator.h" #include "caffe2/core/tensor_int8.h" #include "caffe2/operators/quantized/int8_utils.h" #include <c10/util/irange.h> namespace caffe2 { namespace in...
2,685
30.97619
80
h
null
pytorch-main/caffe2/operators/quantized/int8_roi_align_op.h
#ifndef CAFFE2_OPERATORS_INT8_ROI_ALIGN_OP_H_ #define CAFFE2_OPERATORS_INT8_ROI_ALIGN_OP_H_ #include "caffe2/core/common.h" #include "caffe2/core/context.h" #include "caffe2/core/logging.h" #include "caffe2/core/operator.h" #include "caffe2/core/operator_schema.h" #include "caffe2/core/tensor_int8.h" #include "caffe2/...
11,524
31.013889
80
h
null
pytorch-main/caffe2/operators/quantized/int8_sigmoid_op.h
#ifndef CAFFE2_INT8_SIGMOID_OP_H_ #define CAFFE2_INT8_SIGMOID_OP_H_ #include <qnnpack.h> #include "caffe2/core/context.h" #include "caffe2/core/operator.h" #include "caffe2/core/tensor_int8.h" #include "caffe2/operators/quantized/int8_utils.h" namespace caffe2 { namespace int8 { class Int8SigmoidOp final : public O...
3,297
29.537037
80
h
null
pytorch-main/caffe2/operators/quantized/int8_simd.h
#pragma once // We want to allow 128-bit wide SIMD if either NEON is available (as // detected by GEMMLOWP_NEON), or whether SSE4.2 and Clang is // available (in which case we will use the neon_sse.h library to // share source between the two implementations). We use SSE4.2 to // ensure we can use the full neon2sse li...
722
29.125
69
h
null
pytorch-main/caffe2/operators/quantized/int8_slice_op.h
#ifndef CAFFE2_OPERATORS_INT8_SLICE_OP_H_ #define CAFFE2_OPERATORS_INT8_SLICE_OP_H_ #include "caffe2/core/context.h" #include "caffe2/core/operator.h" #include "caffe2/core/tensor_int8.h" #include "caffe2/operators/quantized/int8_utils.h" #include "caffe2/operators/slice_op.h" namespace caffe2 { namespace int8 { cl...
3,024
31.180851
80
h
null
pytorch-main/caffe2/operators/quantized/int8_softmax_op.h
#ifndef CAFFE2_OPERATORS_INT8_SOFTMAX_OP_H_ #define CAFFE2_OPERATORS_INT8_SOFTMAX_OP_H_ #include <qnnpack.h> #include "caffe2/core/context.h" #include "caffe2/core/operator.h" #include "caffe2/core/tensor_int8.h" #include "caffe2/operators/quantized/int8_utils.h" namespace caffe2 { namespace int8 { class Int8Softm...
3,287
29.728972
80
h
null
pytorch-main/caffe2/operators/quantized/int8_test_utils.h
#ifndef CAFFE2_INT8_TEST_UTILS_H_ #define CAFFE2_INT8_TEST_UTILS_H_ #include "caffe2/core/common.h" #include "caffe2/core/context.h" #include "caffe2/core/operator.h" #include "caffe2/core/tensor.h" #include "caffe2/core/tensor_int8.h" #include <array> #include <cmath> #include <random> #include "gtest/gtest.h" nam...
3,880
31.341667
83
h
null
pytorch-main/caffe2/operators/quantized/int8_transpose_op.h
#ifndef CAFFE2_OPERATORS_INT8_TRANSPOSE_OP_H_ #define CAFFE2_OPERATORS_INT8_TRANSPOSE_OP_H_ #include "caffe2/core/context.h" #include "caffe2/core/operator.h" #include "caffe2/core/tensor_int8.h" #include "caffe2/operators/quantized/int8_utils.h" #include "caffe2/operators/transpose_op.h" namespace caffe2 { namespac...
1,120
27.74359
73
h
null
pytorch-main/caffe2/operators/quantized/int8_utils.h
#ifndef CAFFE2_INT8_UTILS_H_ #define CAFFE2_INT8_UTILS_H_ #include <gemmlowp/public/gemmlowp.h> #include "caffe2/utils/threadpool/ThreadPool.h" #include "caffe2/utils/threadpool/WorkersPool.h" namespace caffe2 { /* * Initialized QNNPACK (only once). * Throws if initialization failed. */ void initQNNPACK(); name...
4,737
28.987342
79
h
null
pytorch-main/caffe2/operators/rnn/recurrent_network_blob_fetcher_op.h
#ifndef CAFFE2_OPERATORS_RECURRENT_BLOB_FETCHER_OP_H_ #define CAFFE2_OPERATORS_RECURRENT_BLOB_FETCHER_OP_H_ #include "caffe2/core/context.h" #include "caffe2/core/logging.h" #include "caffe2/core/operator.h" #include "caffe2/core/tensor.h" #include "caffe2/operators/rnn/recurrent_network_op.h" #include "google/protobu...
2,289
31.253521
92
h
null
pytorch-main/caffe2/operators/rnn/recurrent_network_executor.h
#ifndef CAFFE2_OPERATORS_RECURRENT_NETWORK_EXECUTOR_H_ #define CAFFE2_OPERATORS_RECURRENT_NETWORK_EXECUTOR_H_ #include "caffe2/core/context.h" #include "caffe2/core/logging.h" #include "caffe2/core/operator.h" #include "caffe2/core/timer.h" #include "caffe2/operators/rnn/recurrent_network_executor_incl.h" #include "c1...
17,661
32.199248
88
h
null
pytorch-main/caffe2/operators/rnn/recurrent_network_executor_gpu.h
#ifndef CAFFE2_OPERATORS_RECURRENT_NETWORK_GPU_EXECUTOR_H_ #define CAFFE2_OPERATORS_RECURRENT_NETWORK_GPU_EXECUTOR_H_ #include "caffe2/core/context_gpu.h" #include "caffe2/operators/rnn/recurrent_network_executor.h" #include <map> namespace caffe2 { class CUDARecurrentNetworkExecutor : public RecurrentNetworkExecu...
2,434
28.337349
88
h
null
pytorch-main/caffe2/operators/rnn/recurrent_network_executor_incl.h
#ifndef CAFFE2_OPERATORS_RECURRENT_NETWORK_EXECUTOR_INCL_H_ #define CAFFE2_OPERATORS_RECURRENT_NETWORK_EXECUTOR_INCL_H_ #include <vector> #include "caffe2/core/operator.h" namespace caffe2 { /** * Struct for operator in a timestep and its dependencies. */ struct RNNNetOperator { int order; // Position in the st...
2,202
27.986842
77
h
null
pytorch-main/caffe2/operators/rnn/recurrent_op_cudnn.h
#ifndef CAFFE2_OPERATORS_RECURRENT_OP_CUDNN_H_ #define CAFFE2_OPERATORS_RECURRENT_OP_CUDNN_H_ #include "caffe2/core/context.h" #include "caffe2/core/context_gpu.h" #include "caffe2/core/cudnn_wrappers.h" #include "caffe2/core/logging.h" #include "caffe2/core/operator.h" namespace caffe2 { namespace detail { template...
4,233
27.039735
83
h
null
pytorch-main/caffe2/operators/rnn/hip/recurrent_op_miopen.h
#ifndef CAFFE2_OPERATORS_RECURRENT_OP_MIOPEN_H_ #define CAFFE2_OPERATORS_RECURRENT_OP_MIOPEN_H_ #include "caffe2/core/context.h" #include "caffe2/core/hip/context_gpu.h" #include "caffe2/core/hip/miopen_wrapper.h" #include "caffe2/core/logging.h" #include "caffe2/core/operator.h" namespace caffe2 { namespace detail {...
3,878
26.510638
79
h
null
pytorch-main/caffe2/opt/annotations.h
#pragma once #include "caffe2/core/common.h" #include "caffe2/core/logging.h" #include "caffe2/proto/caffe2_pb.h" #include "nomnigraph/Representations/NeuralNet.h" namespace caffe2 { class TORCH_API Caffe2Annotation : public nom::repr::Annotation { public: Caffe2Annotation() : Annotation(AnnotationKind::Caffe2) {...
2,141
30.043478
78
h
null
pytorch-main/caffe2/opt/backend_cutting.h
#pragma once #include "caffe2/core/common.h" #include "caffe2/proto/caffe2_pb.h" #include "nomnigraph/Representations/NeuralNet.h" #include <functional> namespace caffe2 { namespace opt { struct CutResult { caffe2::NetDef net; int numberOfSubnets{0}; }; TORCH_API void DumpGraph(nom::repr::NNGraph* g, const std:...
586
23.458333
74
h
null
pytorch-main/caffe2/opt/backend_transformer_base.h
#pragma once #include "caffe2/core/common.h" #include "caffe2/core/workspace.h" #include "caffe2/opt/bound_shape_inferencer.h" #include "caffe2/proto/caffe2_pb.h" #include <string> #include <unordered_map> #include <vector> namespace caffe2 { namespace { constexpr char kNetPos[] = "net_pos"; constexpr char kModelId[...
2,773
26.74
79
h
null
pytorch-main/caffe2/opt/converter.h
#ifndef CAFFE2_OPT_CONVERTER_H #define CAFFE2_OPT_CONVERTER_H #include "caffe2/core/common.h" #include "caffe2/core/logging.h" #include "caffe2/opt/annotations.h" #include "caffe2/proto/caffe2_pb.h" #include "nomnigraph/Graph/Graph.h" #include "nomnigraph/Representations/ControlFlow.h" #include "nomnigraph/Representat...
3,014
37.164557
80
h
null
pytorch-main/caffe2/opt/distributed.h
#pragma once #include "caffe2/core/common.h" #include "caffe2/core/logging.h" #include "caffe2/proto/caffe2_pb.h" #include "nomnigraph/Representations/NeuralNet.h" namespace caffe2 { /// \brief Convert to an NNModule and apply a mapping of /// tensor names to DeviceOptions to it. /// /// This *only* applies the map ...
1,126
32.147059
65
h
null
pytorch-main/caffe2/opt/fakefp16_transform.h
#pragma once #include <string> #include <unordered_map> #include <vector> #include <caffe2/core/net.h> #include <caffe2/core/workspace.h> #include <caffe2/proto/caffe2_pb.h> namespace caffe2 { namespace opt { // Mapping from fp32 ops to fakefp16 ops TORCH_API std::unordered_map<std::string, std::string> getFakeFp16...
584
21.5
76
h
null
pytorch-main/caffe2/opt/fusion.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,141
32.674797
79
h
null
pytorch-main/caffe2/opt/glow_net_transform.h
#pragma once #include <string> #include <unordered_set> #include <vector> #include <caffe2/core/net.h> #include <caffe2/core/workspace.h> #include <caffe2/opt/shape_info.h> #include <caffe2/proto/caffe2_pb.h> C10_DECLARE_string(onnxifi_blacklist); C10_DECLARE_string(onnxifi_blacklist_ops); namespace caffe2 { namesp...
1,625
34.347826
80
h
null
pytorch-main/caffe2/opt/onnxifi_op.h
#pragma once #include <unordered_map> #include "onnx/onnx_pb.h" #include <c10/util/Exception.h> #include <c10/util/SmallVector.h> #include <c10/util/irange.h> #include "caffe2/core/context.h" #include "caffe2/core/logging.h" #include "caffe2/core/operator.h" #include "caffe2/onnx/onnxifi_graph_info.h" #include "caff...
19,554
35.965974
119
h
null
pytorch-main/caffe2/opt/onnxifi_transformer.h
#pragma once #include <cstdint> #include <string> #include <unordered_map> #include <vector> #include "caffe2/opt/backend_cutting.h" #include "onnx/onnx_pb.h" #include "caffe2/core/operator.h" #include "caffe2/onnx/onnxifi_init.h" #include "caffe2/opt/backend_transformer_base.h" namespace caffe2 { namespace onnx { ...
6,859
31.511848
80
h
null
pytorch-main/caffe2/opt/passes.h
#ifndef CAFFE2_OPT_OPT_PASSS_H #define CAFFE2_OPT_OPT_PASSS_H #include "caffe2/core/common.h" #include "caffe2/core/workspace.h" #include "caffe2/proto/caffe2_pb.h" #include "nomnigraph/Representations/NeuralNet.h" using namespace nom::repr; namespace caffe2 { /* This file sets up the optimization pass registry. ...
2,642
33.776316
91
h
null
pytorch-main/caffe2/opt/shape_info.h
#pragma once #include "caffe2/core/operator.h" namespace caffe2 { struct TORCH_API QShapeInfo { QShapeInfo(float o = 0, float s = 1, uint32_t a = 1) { offset.clear(); scale.clear(); offset.push_back(o); scale.push_back(s); axis = a; } uint32_t axis; vector<float> offset; vector<float> ...
4,784
27.825301
94
h
null
pytorch-main/caffe2/opt/tvm_transformer.h
#pragma once #include "caffe2/opt/backend_transformer_base.h" #include <unordered_set> namespace caffe2 { struct TvmTransformOptions final : public BackendTransformOptions { explicit TvmTransformOptions() : BackendTransformOptions() {} // Whether to enable profiling based jit bool profiling_based_jit{false}...
2,992
30.840426
79
h
null
pytorch-main/caffe2/opt/custom/cc_amrc.h
#pragma once #include <immintrin.h> #include "caffe2/core/context.h" #include "caffe2/core/operator.h" #include "caffe2/core/types.h" #include "caffe2/utils/math.h" namespace caffe2 { template <class Context> class ConcatAddMulReplaceNaNClipOp final : public Operator<Context> { public: USE_OPERATOR_CONTEXT_FUNCTI...
5,926
32.485876
84
h
null
pytorch-main/caffe2/opt/custom/freeze_quantization_params.h
#pragma once #include <caffe2/core/workspace.h> #include <caffe2/proto/caffe2_pb.h> namespace caffe2 { /// We have a variant of 2-input Int8Quantize and 4-input Int8FC where the last /// input points to a blob which contains the y_scale and y_zero_point. It's /// orginated from online snapshot update but is creating ...
545
38
80
h
null
pytorch-main/caffe2/opt/nql/ast.h
#pragma once #include "c10/util/irange.h" #include <iostream> #include <string> #include <vector> struct ASTExpr { std::string name = ""; std::vector<ASTExpr*> children; bool isCallFlag = false; bool starInputsFlag = false; ~ASTExpr() { for (ASTExpr* e : children) delete e; } bool isCall() con...
1,619
20.038961
67
h
null
pytorch-main/caffe2/opt/nql/graphmatcher.h
#include "ast.h" #include "caffe2/opt/converter.h" #include "nomnigraph/Transformations/SubgraphMatcher.h" namespace nom { namespace nql { using Criteria = std::string; using TestMatchGraph = nom::matcher::MatchGraph<nom::repr::NNGraph>; using TestMatchPredicate = nom::matcher::MatchPredicate<nom::repr::NNGraph>; /...
4,659
34.037594
80
h
null
pytorch-main/caffe2/perfkernels/adagrad.h
#pragma once #if defined(__AVX__) && !defined(__NVCC__) && \ (defined(__x86_64__) || defined(_M_X64) || defined(__i386__)) #define CAFFE2_PERFKERNELS_ADAGRAD_H_USE_INTRINSIC #include <immintrin.h> #endif #include <c10/util/Half.h> #include <c10/util/irange.h> namespace caffe2 { namespace internal { // The follo...
6,104
28.635922
80
h
null
pytorch-main/caffe2/perfkernels/batch_box_cox.h
// Impmenets BoxCox operator for CPU #pragma once #include <cstdint> namespace caffe2 { template <typename T> void compute_batch_box_cox( std::size_t N, std::size_t D, std::size_t block_size, const T* self_data, const T* lambda1_data, const T* lambda2_data, T* output_data); extern templat...
789
20.944444
51
h
null
pytorch-main/caffe2/perfkernels/common.h
// !!!! PLEASE READ !!!! // Minimize (transitively) included headers from _avx*.cc because some of the // functions defined in the headers compiled with platform dependent compiler // options can be reused by other translation units generating illegal // instruction run-time error. // Common utilities for writing perf...
5,526
41.515385
80
h
null
pytorch-main/caffe2/perfkernels/cvtsh_ss_bugfix.h
#pragma once // Apple clang was fixed in 8.1 #if defined(__apple_build_version__) && \ ((__clang_major__ < 8) || \ ((__clang_major__ == 8) && (__clang_minor__ < 1))) #define CAFFE2_INTERNAL_APPLE_NEED_FIX 1 #endif // Regular clang was fixed in 3.9 #if defined(__clang__) && (__clang_major__ < 4) && ...
2,062
26.144737
75
h
null
pytorch-main/caffe2/perfkernels/embedding_lookup.h
#pragma once #include <cstdint> namespace caffe2 { /** * Embedding lookup with reduction. * * `input` of size data_size * block_size * `indices` of size index_size * `lengths` of size output_size * `weights` nullptr or array of size index_size * `out` of size output_size * block_size * sum(lengths[i]) == ind...
1,539
27.518519
77
h
null
pytorch-main/caffe2/perfkernels/embedding_lookup_idx.h
#pragma once #include <cstdint> namespace caffe2 { // clang-format off /** * Embedding lookup with reduction. * * `input` of size data_size * block_size * `indices` of size index_size * `offsets` of size output_size * `weights` nullptr or array of size index_size * `out` of size output_size * block_size * *...
1,674
27.87931
85
h
null
pytorch-main/caffe2/perfkernels/fused_8bit_rowwise_embedding_lookup.h
#pragma once #include <cstdint> namespace caffe2 { /** * Embedding lookup with reduction. * * `input` of size data_size * (block_size + 8B) * `indices` of size index_size * `lengths` of size output_size * `weights` nullptr or array of size index_size * `out` of size output_size * block_size * sum(lengths[i])...
1,690
29.196429
79
h
null
pytorch-main/caffe2/perfkernels/fused_8bit_rowwise_embedding_lookup_idx.h
#pragma once #include <cstdint> namespace caffe2 { /** * Embedding lookup with reduction. * * `input` of size data_size * (block_size + 8B) * `indices` of size index_size * `offsets` of size output_size * `weights` nullptr or array of size index_size * `out` of size output_size * block_size * * Note that bl...
1,807
30.172414
79
h
null
pytorch-main/caffe2/perfkernels/lstm_unit_cpu-impl.h
#pragma once #include <string.h> #include <cmath> #include <cstdint> #include "c10/util/irange.h" #include "caffe2/utils/conversions.h" #include "vectorizer.h" namespace caffe2 { namespace perfkernels { namespace { template <typename T> inline T sigmoid(T x) { return 1 / (1 + std::exp(-x)); } template <typename T>...
3,693
25.014085
72
h
null
pytorch-main/caffe2/perfkernels/math.h
#pragma once #include <cstdint> namespace caffe2 { namespace math { // Returns the quantized and compressed values of floating inputs // The "fused" representation stores the [bitwidth][tail][min][max] // with the quantized data in one array. Since we store 8/bitwidth // quantized data in one byte, the last buckets...
1,103
29.666667
70
h
null
pytorch-main/caffe2/perfkernels/vectorizer.h
#pragma once #if (ENABLE_VECTORIZATION > 0) && !defined(_DEBUG) && !defined(DEBUG) #if defined(__clang__) && (__clang_major__ > 7) #define IS_SANITIZER \ ((__has_feature(address_sanitizer) == 1) || \ (__has_feature(memory_sanitizer) == 1) || \ (__has_feature(thread_sanitizer) == 1) ||...
810
26.965517
69
h
null
pytorch-main/caffe2/predictor/InferenceGraph.h
#pragma once #include "caffe2/core/workspace.h" namespace caffe2 { /** * This struct stores information about the inference graph which defines * underlying math of BlackBoxPredictor. Other parts of it such as various * threading optimizations don't belong here. */ struct InferenceGraph { std::unique_ptr<NetDe...
833
29.888889
80
h
null
pytorch-main/caffe2/predictor/ThreadLocalPtr.h
#pragma once #include <mutex> #include <unordered_map> #include <unordered_set> #include "caffe2/core/logging.h" namespace caffe2 { /** * thread_local pointer in C++ is a per thread pointer. However, sometimes * we want to have a thread local state that is per thread and also per * instance. e.g. we have the foll...
4,109
24.849057
80
h
null
pytorch-main/caffe2/predictor/predictor.h
#pragma once #include <unordered_set> #include "caffe2/core/net.h" #include "caffe2/core/tensor.h" #include "caffe2/predictor/predictor_config.h" namespace caffe2 { class TORCH_API Predictor { public: using TensorList = std::vector<TensorCPU>; using TensorMap = std::unordered_map<std::string, TensorCPU>; Pre...
1,810
24.152778
77
h
null
pytorch-main/caffe2/predictor/predictor_config.h
#pragma once #include <memory> #include "caffe2/core/tensor.h" #include "caffe2/core/workspace.h" #include "caffe2/proto/metanet.pb.h" #include "caffe2/proto/predictor_consts.pb.h" namespace caffe2 { /* * Parameters for a Predictor provided by name. * They are stored as shared_ptr to accommodate parameter sharing ...
1,934
31.25
80
h
null
pytorch-main/caffe2/predictor/predictor_utils.h
#pragma once #include "caffe2/core/db.h" #include "caffe2/core/workspace.h" #include "caffe2/predictor/predictor_config.h" #include "caffe2/proto/metanet.pb.h" namespace caffe2 { namespace predictor_utils { TORCH_API const NetDef& getNet(const MetaNetDef& def, const std::string& name); const ::google::protobuf::Repe...
802
27.678571
79
h
null
pytorch-main/caffe2/predictor/emulator/benchmark.h
#pragma once #include "caffe2/core/logging.h" #include "caffe2/predictor/emulator/emulator.h" #include "caffe2/predictor/emulator/output_formatter.h" #include "caffe2/predictor/emulator/profiler.h" C10_DECLARE_int(warmup); C10_DECLARE_int(iter); C10_DECLARE_int(threads); C10_DECLARE_int(runs); C10_DECLARE_string(run_n...
1,062
22.622222
55
h
null
pytorch-main/caffe2/predictor/emulator/data_filler.h
#pragma once #include "caffe2/core/logging.h" #include "caffe2/core/operator.h" #include "caffe2/predictor/predictor.h" #include "caffe2/utils/filler.h" namespace caffe2 { namespace emulator { typedef caffe2::Predictor::TensorList TensorList_t; /* * A filler to initialize the parameters and inputs of a predictor *...
4,670
29.135484
78
h
null
pytorch-main/caffe2/predictor/emulator/net_supplier.h
#pragma once #include <functional> #include "caffe2/predictor/emulator/data_filler.h" #include "caffe2/predictor/emulator/utils.h" namespace caffe2 { namespace emulator { struct RunnableNet { const caffe2::NetDef& netdef; const Filler* filler; std::string debug_info; RunnableNet( const caffe2::NetDef&...
2,554
24.29703
73
h
null
pytorch-main/caffe2/predictor/emulator/std_output_formatter.h
#pragma once #include "output_formatter.h" namespace caffe2 { namespace emulator { const uint64_t MS_IN_SECOND = 1000; /* * Print the output of the emulator run to stdout. */ class StdOutputFormatter : public OutputFormatter { private: template <typename T> static float get_mean(const std::vector<T>& values) ...
1,365
28.695652
78
h
null
pytorch-main/caffe2/predictor/emulator/utils.h
#pragma once #include <fstream> #include "caffe2/core/logging.h" namespace caffe2 { namespace emulator { /* * Replace a @substring in a given @line with @target */ inline std::string replace( std::string line, const std::string& substring, const std::string& target) { size_t index = 0; while (true)...
1,584
22.308824
79
h
null
pytorch-main/caffe2/proto/caffe2_pb.h
#pragma once #include <c10/core/Device.h> #include <c10/util/Exception.h> #include <caffe2/proto/caffe2.pb.h> namespace caffe2 { using DeviceType = at::DeviceType; constexpr DeviceType CPU = DeviceType::CPU; constexpr DeviceType CUDA = DeviceType::CUDA; constexpr DeviceType OPENGL = DeviceType::OPENGL; constexpr Devi...
4,269
30.397059
83
h
null
pytorch-main/caffe2/python/dlpack.h
/*! * Copyright (c) 2017 by Contributors * \file dlpack.h * \brief The common header of DLPack. */ #ifndef DLPACK_DLPACK_H_ #define DLPACK_DLPACK_H_ /** * \brief Compatibility with C++ */ #ifdef __cplusplus #define DLPACK_EXTERN_C extern "C" #else #define DLPACK_EXTERN_C #endif /*! \brief The current version o...
6,661
27.839827
80
h
null
pytorch-main/caffe2/python/pybind_state.h
#pragma once #include <unordered_map> #include "caffe2/core/context.h" #include "caffe2/core/init.h" #include "caffe2/core/logging.h" #include "caffe2/core/memonger.h" #include "caffe2/core/net.h" #include "caffe2/core/operator.h" #include "caffe2/core/scope_guard.h" #include "caffe2/core/tensor.h" #include "caffe2/c...
15,149
31.371795
80
h
null
pytorch-main/caffe2/python/pybind_state_dlpack.h
#pragma once #include "caffe2/core/context.h" #include "caffe2/core/tensor.h" #include "caffe2/core/types.h" #include "caffe2/proto/caffe2_pb.h" #include "caffe2/python/dlpack.h" #include <pybind11/pybind11.h> #include <pybind11/stl.h> namespace caffe2 { namespace python { namespace py = pybind11; const DLDeviceTy...
4,152
29.536765
78
h
null
pytorch-main/caffe2/python/pybind_state_registry.h
#pragma once #include <pybind11/pybind11.h> #include "c10/util/Registry.h" namespace caffe2 { namespace python { namespace py = pybind11; struct PybindAddition { PybindAddition() {} PybindAddition(py::module&) {} virtual ~PybindAddition(){}; }; C10_DECLARE_REGISTRY(PybindAdditionRegistry, PybindAddition, py:...
1,021
31.967742
79
h
null
pytorch-main/caffe2/python/pybind_workspace.h
#pragma once #include <pybind11/pybind11.h> #include <pybind11/stl.h> //#include <Python.h> namespace caffe2 { namespace python { class C10_EXPORT BlobFetcherBase { public: struct FetchedBlob { pybind11::object obj; bool copied; }; virtual ~BlobFetcherBase(); virtual pybind11::object Fetch(const Blo...
1,206
27.069767
78
h