Skip to content

Commit

Permalink
Merge pull request #4 from cms-hls4ml/utility
Browse files Browse the repository at this point in the history
add utility
  • Loading branch information
jmduarte authored Mar 16, 2023
2 parents a658b8a + 041bb52 commit 74771a9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions AXOL1TL_v1/GTADModel_emulator_v1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "NN/nnet_utils/nnet_common.h"
#include <any>
#include <array>
#include <utility>
#include "ap_fixed.h"
#include "ap_int.h"
#include "scales.h"
Expand Down Expand Up @@ -63,11 +64,11 @@ class GTADModel_emulator_v1 : public hls4mlEmulator::Model {
// return results as an std::pair
// first = reconstructed output
// second = loss
std::pair<std::array<result_t, N_LAYER_6>, resultsq_t> result_p = std::any_cast<std::pair<std::array<result_t, N_LAYER_6>, resultsq_t>>(result);
std::pair<std::array<result_t, N_LAYER_6>, resultsq_t> *result_p = std::any_cast<std::pair<std::array<result_t, N_LAYER_6>, resultsq_t>*>(result);
for (int i = 0; i < N_LAYER_6; i++) {
result_p.first[i] = _result[i];
result_p->first[i] = _result[i];
}
result_p.second = _loss;
result_p->second = _loss;
}

};
Expand Down

0 comments on commit 74771a9

Please sign in to comment.