diff --git a/include/aidge/hook/ExecTime.hpp b/include/aidge/hook/ExecTime.hpp index 212fef58696be702e89c8ad973dcc0dd0fc389ae..0964d9575b7ad345d5e07c9f19c7e56a3b69c813 100644 --- a/include/aidge/hook/ExecTime.hpp +++ b/include/aidge/hook/ExecTime.hpp @@ -18,7 +18,7 @@ #define execTime_H_ #include "aidge/operator/Operator.hpp" -#include "aidge/hook/hook.hpp" +#include "aidge/hook/Hook.hpp" #include <memory> #include <chrono> #include <vector> diff --git a/include/aidge/hook/OutputRange.hpp b/include/aidge/hook/OutputRange.hpp index a2da2a997d594c0ef78fb7c31f33b32c3495c4eb..355f4aaa15a6bcd77d99ec2dad344a45f8f9edc0 100644 --- a/include/aidge/hook/OutputRange.hpp +++ b/include/aidge/hook/OutputRange.hpp @@ -18,7 +18,7 @@ #define AIDGE_CORE_HOOK_OUTPUTRANGE_H_ #include "aidge/operator/Operator.hpp" -#include "aidge/hook/hook.hpp" +#include "aidge/hook/Hook.hpp" #include <memory> #include <chrono> #include <vector> diff --git a/include/aidge/operator/Operator.hpp b/include/aidge/operator/Operator.hpp index 903b6362adf3db0c867dc419086e0cb6ddaa65c7..0281e1bb83002a2e3799cc73337ffd4d77becdba 100644 --- a/include/aidge/operator/Operator.hpp +++ b/include/aidge/operator/Operator.hpp @@ -21,6 +21,7 @@ #include "aidge/data/Tensor.hpp" #include "aidge/utils/Types.h" #include "aidge/hook/Hook.hpp" +#include <iostream> namespace Aidge { diff --git a/include/aidge/operator/Scaling.hpp b/include/aidge/operator/Scaling.hpp index 353666fb3950d034a7dbe8ec1d3ebdb312679f95..43dd7beb10b49c3695e6c55fac0449a34565dd7f 100644 --- a/include/aidge/operator/Scaling.hpp +++ b/include/aidge/operator/Scaling.hpp @@ -28,12 +28,12 @@ namespace Aidge { enum class ScalingAttr { - scalingFactor + scalingFactor, quantizedNbBits, isOutputUnsigned }; class Scaling_Op : public Operator, public Registrable<Scaling_Op, std::string, std::unique_ptr<OperatorImpl>(const Scaling_Op&)>, - public StaticAttributes<ScalingAttr, float> { + public StaticAttributes<ScalingAttr, float, size_t, bool> { public: // FIXME: change accessibility std::shared_ptr<Tensor> mInput = std::make_shared<Tensor>(); @@ -44,16 +44,18 @@ public: Scaling_Op() = delete; - using Attributes_ = StaticAttributes<ScalingAttr, float>; + using Attributes_ = StaticAttributes<ScalingAttr, float, std::size_t, bool>; template <ScalingAttr e> using attr = typename Attributes_::template attr<e>; - Scaling_Op(float scalingFactor) + Scaling_Op(float scalingFactor, std::size_t nbBits, bool isOutputUnsigned) : Operator(Type), Attributes_( - attr<ScalingAttr::scalingFactor>(scalingFactor)) - { - setDatatype(DataType::Float32); - } + attr<ScalingAttr::scalingFactor>(scalingFactor), + attr<ScalingAttr::quantizedNbBits>(nbBits), + attr<ScalingAttr::isOutputUnsigned>(isOutputUnsigned)) { + + setDatatype(DataType::Float32); + } /** * @brief Copy-constructor. Copy the operator attributes and its output tensor(s), but not its input tensors (the new operator has no input associated). @@ -154,15 +156,21 @@ public: } }; +/* inline std::shared_ptr<Node> Scaling(float scalingFactor = 1.0f, const std::string& name = "") { return std::make_shared<Node>(std::make_shared<Scaling_Op>(scalingFactor), name); } +*/ +inline std::shared_ptr<Node> Scaling(float scalingFactor = 1.0f, std::size_t quantizedNbBits=8, bool isOutputUnsigned=true, const std::string& name = "") { + return std::make_shared<Node>(std::make_shared<Scaling_Op>(scalingFactor,quantizedNbBits, isOutputUnsigned), name); +} + } namespace { template <> const char* const EnumStrings<Aidge::ScalingAttr>::data[] - = {"scalingFactor"}; + = {"scalingFactor", "quantizedNbBits", "isOutputUnsigned"}; } #endif /* __AIDGE_CORE_OPERATOR_RELU_H__ */