xref: /aosp_15_r20/external/pytorch/aten/src/ATen/native/vulkan/ops/QuantizedFunctions.h (revision da0073e96a02ea20f0ac840b70461e3646d07c45)
1 #include <ATen/native/vulkan/ops/Common.h>
2 
3 namespace at {
4 namespace native {
5 namespace vulkan {
6 namespace ops {
7 
8 Tensor quantize_per_tensor(
9     const at::Tensor& input_arg,
10     const double scale,
11     const int64_t zero_point,
12     const c10::ScalarType dtype);
13 
14 Tensor quantize_per_tensor_tensor_qparams(
15     const at::Tensor& input_arg,
16     const at::Tensor& scale,
17     const at::Tensor& zero_point,
18     const c10::ScalarType dtype);
19 
20 Tensor dequantize_helper(
21     const at::Tensor& input_arg,
22     const double scale,
23     const int64_t zero_point,
24     const c10::ScalarType dtype);
25 
26 Tensor dequantize(const Tensor& self);
27 
28 Tensor quantized_add(
29     const Tensor& self_arg,
30     const Tensor& other_arg,
31     const double scale,
32     const int64_t zero_point);
33 
34 Tensor quantized_sub(
35     const Tensor& self_arg,
36     const Tensor& other_arg,
37     const double scale,
38     const int64_t zero_point);
39 
40 Tensor quantized_mul(
41     const Tensor& self_arg,
42     const Tensor& other_arg,
43     const double scale,
44     const int64_t zero_point);
45 
46 Tensor quantized_div(
47     const Tensor& self_arg,
48     const Tensor& other_arg,
49     const double scale,
50     const int64_t zero_point);
51 
52 Tensor quantized_conv2d(
53     const Tensor& input_,
54     const Tensor& weight,
55     const std::optional<Tensor>& bias_opt,
56     IntArrayRef stride,
57     IntArrayRef padding,
58     IntArrayRef dilation,
59     int64_t groups,
60     double out_scale,
61     int64_t out_zero_point);
62 
63 Tensor quantized_upsample_nearest2d(
64     const Tensor& input_arg,
65     const IntArrayRef output_sizes,
66     const std::optional<double> scales_h,
67     const std::optional<double> scales_w);
68 
69 } // namespace ops
70 } // namespace vulkan
71 } // namespace native
72 } // namespace at
73