summaryrefslogtreecommitdiffstats
path: root/mlir/lib/Quantizer/Support
diff options
context:
space:
mode:
authorRiver Riddle <riverriddle@google.com>2019-12-18 10:46:16 -0800
committerA. Unique TensorFlower <gardener@tensorflow.org>2019-12-18 10:46:48 -0800
commit2666b97314ad1b50f88fcc4376ae941f601f67ea (patch)
tree1044ae8be656b70a00a6130ed4d50b32f51a16bc /mlir/lib/Quantizer/Support
parent47034c4bc509f727051ff172c2bf3367a60e2c01 (diff)
downloadbcm5719-llvm-2666b97314ad1b50f88fcc4376ae941f601f67ea.tar.gz
bcm5719-llvm-2666b97314ad1b50f88fcc4376ae941f601f67ea.zip
NFC: Cleanup non-conforming usages of namespaces.
* Fixes use of anonymous namespace for static methods. * Uses explicit qualifiers(mlir::) instead of wrapping the definition with the namespace. PiperOrigin-RevId: 286222654
Diffstat (limited to 'mlir/lib/Quantizer/Support')
-rw-r--r--mlir/lib/Quantizer/Support/Statistics.cpp9
-rw-r--r--mlir/lib/Quantizer/Support/UniformSolvers.cpp14
2 files changed, 7 insertions, 16 deletions
diff --git a/mlir/lib/Quantizer/Support/Statistics.cpp b/mlir/lib/Quantizer/Support/Statistics.cpp
index d155875cfe3..6753898dbdc 100644
--- a/mlir/lib/Quantizer/Support/Statistics.cpp
+++ b/mlir/lib/Quantizer/Support/Statistics.cpp
@@ -95,15 +95,10 @@ bool AttributeTensorStatistics::get(TensorAxisStatistics &stats) const {
return false;
}
-namespace mlir {
-namespace quantizer {
-
-raw_ostream &operator<<(raw_ostream &os, const TensorAxisStatistics &stats) {
+raw_ostream &mlir::quantizer::operator<<(raw_ostream &os,
+ const TensorAxisStatistics &stats) {
os << "STATS[sampleSize=" << stats.sampleSize << ", min=" << stats.minValue
<< ", maxValue=" << stats.maxValue << ", mean=" << stats.mean
<< ", variance=" << stats.variance << "]";
return os;
}
-
-} // end namespace quantizer
-} // end namespace mlir
diff --git a/mlir/lib/Quantizer/Support/UniformSolvers.cpp b/mlir/lib/Quantizer/Support/UniformSolvers.cpp
index bd2fe686ee1..77d69be8382 100644
--- a/mlir/lib/Quantizer/Support/UniformSolvers.cpp
+++ b/mlir/lib/Quantizer/Support/UniformSolvers.cpp
@@ -127,16 +127,15 @@ double UniformParamsFromMinMaxSolver::dequantize(int64_t xq) const {
return (xq - zp) * delta;
}
-namespace mlir {
-namespace quantizer {
-
-raw_ostream &operator<<(raw_ostream &os, const UniformStorageParams &p) {
+raw_ostream &mlir::quantizer::operator<<(raw_ostream &os,
+ const UniformStorageParams &p) {
os << "UniformStorageParams{" << p.numLevels << ", " << p.minValue << "}";
return os;
}
-raw_ostream &operator<<(raw_ostream &os,
- const UniformParamsFromMinMaxSolver &s) {
+raw_ostream &
+mlir::quantizer::operator<<(raw_ostream &os,
+ const UniformParamsFromMinMaxSolver &s) {
os << "UniformParamsFromMinMaxSolver(" << s.getStepCount() << "){";
os << "(" << s.getBoundingMin() << ":" << s.getBoundingMax() << ") -> ";
if (!s.isSatisfied()) {
@@ -151,6 +150,3 @@ raw_ostream &operator<<(raw_ostream &os,
return os;
}
-
-} // end namespace quantizer
-} // end namespace mlir
OpenPOWER on IntegriCloud