Removed noexcept specifier; removed dead code and restored ostream format (#9563)

This commit is contained in:
Dmitrii Khurtin 2022-01-11 19:01:34 +03:00 committed by GitHub
parent 62e8923605
commit 91c89e77d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 12 deletions

View File

@ -387,14 +387,6 @@ void make_gna_pwl(const DnnActivation& fun,
gna_pwl[1].slope = FLOAT_TO_INT16(s.slope * s.slope_scale); gna_pwl[1].slope = FLOAT_TO_INT16(s.slope * s.slope_scale);
gna_pwl[1].xBase = gna_pwl[1].xBase | s.slope_scale_index; gna_pwl[1].xBase = gna_pwl[1].xBase | s.slope_scale_index;
print_segment((int32_t)(gna_pwl[1].xBase & XBASEMASK) / in_scale, gna_pwl[1].yBase / out_scale, 1.0); print_segment((int32_t)(gna_pwl[1].xBase & XBASEMASK) / in_scale, gna_pwl[1].yBase / out_scale, 1.0);
if (INT32_MAX > x_upper) { // need a right segment
gna_pwl.push_back({
static_cast<int32_t>(x_upper & XBASEMASK), // zero out the 2 lsb
y_upper,
0 });
print_segment((x_upper & XBASEMASK) / in_scale, gna_pwl[2].yBase / out_scale, 0.0);
}
} else { } else {
double min_x_val = -pwl[0].b / pwl[0].m; double min_x_val = -pwl[0].b / pwl[0].m;
double max_x_val = (y_max/out_scale - pwl[pwl_size - 2].b) / pwl[pwl_size - 2].m; double max_x_val = (y_max/out_scale - pwl[pwl_size - 2].b) / pwl[pwl_size - 2].m;

View File

@ -96,7 +96,9 @@ void ExportGnaDescriptorPartiallyFilled(uint32_t number_of_layers, std::ostream&
outStream.write(gd, sizeof(gd)); outStream.write(gd, sizeof(gd));
outStream.write(gd2, sizeof(gd2)); outStream.write(gd2, sizeof(gd2));
// TODO: GNA2: Scratchpad // TODO: GNA2: Scratchpad
outStream.fill(constScratchFill); auto previousCharacter = outStream.fill(constScratchFill);
outStream.width(scratchPadSize); auto previousWidth = outStream.width(scratchPadSize);
outStream << constScratchFill; outStream << constScratchFill;
outStream.width(previousWidth);
outStream.fill(previousCharacter);
} }

View File

@ -262,7 +262,7 @@ class LayerInfo {
bool isFakeQuantize() const noexcept { bool isFakeQuantize() const noexcept {
return isOfType("FakeQuantize"); return isOfType("FakeQuantize");
} }
bool isNonFunctional() const noexcept { bool isNonFunctional() const {
return isOfType("reshape") || isOfType("squeeze") || isOfType("unsqueeze") || isTrivialPermute(); return isOfType("reshape") || isOfType("squeeze") || isOfType("unsqueeze") || isTrivialPermute();
} }
bool isReshape() const noexcept { bool isReshape() const noexcept {
@ -272,7 +272,7 @@ class LayerInfo {
return isOfType("permute"); return isOfType("permute");
} }
// @brief this not only mathematically trivial, has some WA for kaldi case // @brief this not only mathematically trivial, has some WA for kaldi case
bool isTrivialPermute() const noexcept { bool isTrivialPermute() const {
if (!isPermute()) return false; if (!isPermute()) return false;
auto layerOrder = layer->GetParamAsInts("order"); auto layerOrder = layer->GetParamAsInts("order");