Skip to content

Commit 55ea47b

Browse files
committed
fix
1 parent e7ab565 commit 55ea47b

File tree

6 files changed

+11
-12
lines changed

6 files changed

+11
-12
lines changed

app/AccuracyImgNet/accimgnet.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ std::vector<std::pair<size_t, std::string> > extract_csv(
115115
void check_accuracy(const std::string& neural_network_path,
116116
const std::string& dataset_path, size_t imgs_size,
117117
const std::string& reference_path) {
118-
Graph a1 = open_network(std::move(neural_network_path));
118+
Graph a1 = open_network(neural_network_path);
119119
Tensor input;
120120
Tensor output;
121121
InputLayer inlayer;

include/graph/graph.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,8 @@ class Graph {
5656
if (layPrev.getID() == layNext.getID()) {
5757
throw std::out_of_range("i=j cant add edge");
5858
}
59-
for (int ind = 1; ind < static_cast<int>(arrayV_.size()) -
60-
static_cast<int>(layPrev.getID()) - 1;
61-
ind++)
59+
for (int ind = 1;
60+
ind < static_cast<int>(arrayV_.size()) - layPrev.getID() - 1; ind++)
6261
arrayV_[layPrev.getID() + ind]++;
6362
arrayE_.insert(arrayE_.begin() + arrayV_[layPrev.getID()], layNext.getID());
6463
V_++;

include/layers/InputLayer.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
namespace itlab_2023 {
88

9-
enum LayInOut {
9+
enum LayInOut : uint8_t {
1010
kNchw, // 0
1111
kNhwc // 1
1212
};
@@ -20,8 +20,8 @@ class InputLayer : public Layer {
2020

2121
public:
2222
InputLayer() = default;
23-
InputLayer(LayInOut layin, LayInOut layout, int mean = 0, int std = 1)
24-
: Layer() {
23+
InputLayer(LayInOut layin, LayInOut layout, int mean = 0, int std = 1) {
24+
type_ = LayerType::kInput;
2525
layin_ = layin;
2626
layout_ = layout;
2727
mean_ = mean;
@@ -44,7 +44,7 @@ class InputLayer : public Layer {
4444
"input layer");
4545
}
4646
for (int& re : in) {
47-
re = static_cast<int>((re - mean_) / std_);
47+
re = (re - mean_) / std_;
4848
}
4949
Shape sh(input.get_shape());
5050
if (layin_ == kNchw && layout_ == kNhwc) {

include/layers/Layer.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
namespace itlab_2023 {
1212

13-
enum LayerType {
13+
enum LayerType : uint8_t {
1414
kInput,
1515
kPooling,
1616
kNormalization,
@@ -36,7 +36,7 @@ class Layer {
3636
#endif
3737

3838
private:
39-
int id_;
39+
int id_ = 0;
4040
LayerType type_;
4141
};
4242

include/layers/PoolingLayer.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
namespace itlab_2023 {
1010

11-
enum PoolingType { kAverage, kMax };
11+
enum PoolingType : uint8_t { kAverage, kMax };
1212

1313
class PoolingLayer : public Layer {
1414
public:

include/layers/Tensor.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
namespace itlab_2023 {
1212

13-
enum class Type { kUnknown, kInt, kFloat };
13+
enum class Type : uint8_t { kUnknown, kInt, kFloat };
1414

1515
template <typename T>
1616
std::vector<uint8_t>* to_byte(std::vector<T>& v) {

0 commit comments

Comments
 (0)