Skip to content
Snippets Groups Projects
Commit 3c5ca20d authored by Benjamin Halimi's avatar Benjamin Halimi
Browse files

minor changes

parent d1fa10b5
No related branches found
No related tags found
1 merge request!15version 0.2.0
......@@ -15,6 +15,8 @@
#include "aidge/backend/cpu/operator/LSQImpl.hpp"
#include "aidge/backend/cpu/operator/SAT/TanhClampImpl.hpp"
#include "aidge/backend/cpu/operator/SAT/DoReFaImpl.hpp"
// ...
......
/********************************************************************************
* Copyright (c) 2023 CEA-List
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: EPL-2.0
*
********************************************************************************/
#include <pybind11/pybind11.h>
#include "aidge/data/Tensor.hpp"
#include "aidge/operator/SAT/DoReFa.hpp"
#include "aidge/operator/OperatorTensor.hpp"
namespace py = pybind11;
namespace Aidge {
void init_DoReFa(py::module& m) {
py::enum_<DoReFaMode>(m, "DoReFaMode")
.value("Default", DoReFaMode::Default)
.value("Symmetric", DoReFaMode::Symmetric)
.export_values();
py::class_<DoReFa_Op, std::shared_ptr<DoReFa_Op>, OperatorTensor>(m, "DoReFaOp", py::multiple_inheritance())
.def(py::init<size_t, DoReFaMode>(), py::arg("range") = 255, py::arg("mode") = DoReFaMode::Default)
.def_static("get_inputs_name", &DoReFa_Op::getInputsName)
.def_static("get_outputs_name", &DoReFa_Op::getOutputsName);
declare_registrable<DoReFa_Op>(m, "DoReFaOp");
m.def("DoReFa", &DoReFa, py::arg("range") = 255, py::arg("mode") = DoReFaMode::Default, py::arg("name") = "");
}
} // namespace Aidge
......@@ -23,6 +23,7 @@ namespace Aidge
void init_FixedQ(py::module& m);
void init_LSQ(py::module& m);
void init_TanhClamp(py::module& m);
void init_DoReFa(py::module& m);
// quantization routines
......@@ -36,12 +37,11 @@ PYBIND11_MODULE(aidge_quantization, m)
init_FixedQ(m);
init_LSQ(m);
init_TanhClamp(m);
init_DoReFa(m);
init_PTQ(m);
init_QAT_FixedQ(m);
init_QAT_LSQ(m);
}
} // namespace Aidge
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment