Debian Codegraph @

arm_compute/runtime/experimental/operators/CpuDequantize.h

raw
1 /*
2 * Copyright (c) 2017-2021, 2024 Arm Limited.
3 *
4 * SPDX-License-Identifier: MIT
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to
8 * deal in the Software without restriction, including without limitation the
9 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 * sell copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in all
14 * copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 * SOFTWARE.
23 */
24 #ifndef ACL_ARM_COMPUTE_RUNTIME_EXPERIMENTAL_OPERATORS_CPUDEQUANTIZE_H
25 #define ACL_ARM_COMPUTE_RUNTIME_EXPERIMENTAL_OPERATORS_CPUDEQUANTIZE_H
26
27 #include "arm_compute/core/ITensorPack.h"
28 #include "arm_compute/runtime/NEON/INEOperator.h"
29
30 #include <memory>
31
32 /*
33 * A shallow wrapper for arm_compute::cpu::CpuDequantize.
34 * Any new features should be added to arm_compute::cpu::CpuDequantize and
35 * arm_compute::experimental::op::CpuDequantize should remain a shallow wrapper.
36 */
37 namespace arm_compute
38 {
39 namespace experimental
40 {
41 namespace op
42 {
43 /** A simple wrapper class which runs cpu::CpuDequantize that dequantizes an input tensor */
44 class CpuDequantize : public INEOperator
45 {
46 public:
47 /** Default Constructor */
48 CpuDequantize();
49 /** Default Destructor */
50 ~CpuDequantize();
51 /** Prevent instances of this class from being copied (As this class contains pointers) */
52 CpuDequantize(const CpuDequantize &) = delete;
53 /** Default move constructor */
54 CpuDequantize(CpuDequantize &&) = default;
55 /** Prevent instances of this class from being copied (As this class contains pointers) */
56 CpuDequantize &operator=(const CpuDequantize &) = delete;
57 /** Default move assignment operator */
58 CpuDequantize &operator=(CpuDequantize &&) = default;
59 /** Configure the kernel.
60 *
61 * Valid configurations and data layouts can be referenced in @ref arm_compute::NEDequantizationLayer.
62 */
63 void configure(const ITensorInfo *input, ITensorInfo *output);
64 /** Static function to check if given info will lead to a valid configuration of @ref CpuDequantize
65 *
66 * Similar to @ref CpuDequantize::configure
67 *
68 * @return a status
69 */
70 static Status validate(const ITensorInfo *input, const ITensorInfo *output);
71
72 // Inherited methods overridden:
73 void run(ITensorPack &tensors) override;
74
75 private:
76 struct Impl;
77 std::unique_ptr<Impl> impl_;
78 };
79 } // namespace op
80 } // namespace experimental
81 } // namespace arm_compute
82 #endif // ACL_ARM_COMPUTE_RUNTIME_EXPERIMENTAL_OPERATORS_CPUDEQUANTIZE_H