-
Notifications
You must be signed in to change notification settings - Fork 24k
/
Copy pathqconv.h
100 lines (92 loc) · 3.47 KB
/
qconv.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#pragma once
#include <ATen/Tensor.h>
#include <ATen/Config.h>
namespace at {
namespace native {
class QConvoneDNN final {
public:
C10_API static at::Tensor run_pointwise(
at::Tensor act, // contains quantized values but not QTensor
double act_scale,
int64_t act_zero_point,
at::Tensor weight, // contains quantized values but not QTensor
at::Tensor weight_scales,
at::Tensor weight_zero_points,
std::optional<at::Tensor> bias,
torch::List<int64_t> stride,
torch::List<int64_t> padding,
torch::List<int64_t> dilation,
int64_t groups,
double output_scale,
int64_t output_zero_point,
std::optional<c10::ScalarType> output_dtype,
std::string_view attr,
torch::List<std::optional<at::Scalar>> scalars,
std::optional<std::string_view> algorithm);
C10_API static at::Tensor run_pointwise_tensor(
at::Tensor act, // contains quantized values but not QTensor
at::Tensor act_scale,
at::Tensor act_zero_point,
at::Tensor weight, // contains quantized values but not QTensor
at::Tensor weight_scales,
at::Tensor weight_zero_points,
std::optional<at::Tensor> bias,
torch::List<int64_t> stride,
torch::List<int64_t> padding,
torch::List<int64_t> dilation,
int64_t groups,
double output_scale,
int64_t output_zero_point,
std::optional<c10::ScalarType> output_dtype,
std::string_view attr,
torch::List<std::optional<at::Scalar>> scalars,
std::optional<std::string_view> algorithm);
C10_API static at::Tensor run_pointwise_binary(
at::Tensor act, // contains quantized values but not QTensor
double act_scale,
int64_t act_zero_point,
at::Tensor weight, // contains quantized values but not QTensor
at::Tensor weight_scales,
at::Tensor weight_zero_points,
at::Tensor accum, // contains quantized values but not QTensor
std::optional<at::Tensor> bias,
torch::List<int64_t> stride,
torch::List<int64_t> padding,
torch::List<int64_t> dilation,
int64_t groups,
double output_scale,
int64_t output_zero_point,
std::optional<c10::ScalarType> output_dtype,
double accum_scale,
int64_t accum_zero_point,
std::string_view binary_attr,
std::optional<at::Scalar> alpha,
std::optional<std::string_view> unary_attr,
torch::List<std::optional<at::Scalar>> unary_scalars,
std::optional<std::string_view> unary_algorithm);
C10_API static at::Tensor run_pointwise_binary_tensor(
at::Tensor act, // contains quantized values but not QTensor
at::Tensor act_scale,
at::Tensor act_zero_point,
at::Tensor weight, // contains quantized values but not QTensor
at::Tensor weight_scales,
at::Tensor weight_zero_points,
at::Tensor accum, // contains quantized values but not QTensor
std::optional<at::Tensor> bias,
torch::List<int64_t> stride,
torch::List<int64_t> padding,
torch::List<int64_t> dilation,
int64_t groups,
double output_scale,
int64_t output_zero_point,
std::optional<c10::ScalarType> output_dtype,
double accum_scale,
int64_t accum_zero_point,
std::string_view binary_attr,
std::optional<at::Scalar> alpha,
std::optional<std::string_view> unary_attr,
torch::List<std::optional<at::Scalar>> unary_scalars,
std::optional<std::string_view> unary_algorithm);
};
} // namespace native
} // namespace at