Skip to content
Snippets Groups Projects

Replace Name Maps with Node-Pointers Unordered Maps

Merged Benjamin Halimi requested to merge ptr_maps into dev
Files
8
@@ -13,7 +13,7 @@
@@ -13,7 +13,7 @@
#define AIDGE_QUANTIZATION_QUANTIZATION_PTQ_CLIP_H_
#define AIDGE_QUANTIZATION_QUANTIZATION_PTQ_CLIP_H_
#include <cstdint> // std::uint8_t
#include <cstdint> // std::uint8_t
#include <map>
#include <unordered_map>
#include <memory>
#include <memory>
#include <string>
#include <string>
#include <vector>
#include <vector>
@@ -36,7 +36,7 @@ namespace Aidge
@@ -36,7 +36,7 @@ namespace Aidge
* @param inputDataSet The input dataset, consisting of a vector of input samples.
* @param inputDataSet The input dataset, consisting of a vector of input samples.
* @return A map associating each node name to it's corresponding activation histogram.
* @return A map associating each node name to it's corresponding activation histogram.
*/
*/
std::map<std::string, std::vector<int>> computeHistograms(std::map<std::string, double> valueRanges, int nbBins, std::shared_ptr<GraphView> graphView, std::vector<std::shared_ptr<Tensor>> inputDataSet, bool useCuda);
std::unordered_map<std::shared_ptr<Node>, std::vector<int>> computeHistograms(std::unordered_map<std::shared_ptr<Node>, double> valueRanges, int nbBins, std::shared_ptr<GraphView> graphView, std::vector<std::shared_ptr<Tensor>> inputDataSet, bool useCuda);
/**
/**
* @brief Given an input activation histogram, compute the optimal clipping value in the sense of the Lp norm.
* @brief Given an input activation histogram, compute the optimal clipping value in the sense of the Lp norm.
@@ -67,7 +67,7 @@ namespace Aidge
@@ -67,7 +67,7 @@ namespace Aidge
* @param verbose Whether to print the clipping values or not.
* @param verbose Whether to print the clipping values or not.
* @return The corrected map associating each provided node to its clipped range.
* @return The corrected map associating each provided node to its clipped range.
*/
*/
std::map<std::string, double> adjustRanges(Clipping clippingMode, std::map<std::string, double> valueRanges, std::uint8_t nbBits, std::shared_ptr<GraphView> graphView, std::vector<std::shared_ptr<Tensor>> inputDataSet, bool useCuda, bool verbose);
std::unordered_map<std::shared_ptr<Node>, double> adjustRanges(Clipping clippingMode, std::unordered_map<std::shared_ptr<Node>, double> valueRanges, std::uint8_t nbBits, std::shared_ptr<GraphView> graphView, std::vector<std::shared_ptr<Tensor>> inputDataSet, bool useCuda, bool verbose);
}
}
Loading