Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
Checks: >
bugprone-*,
google-*,
modernize-*,
misc-*,
performance-*,
portability-*,
readability-*,
-google-readability-braces-around-statements,
-google-readability-namespace-comments,
-google-runtime-references,
-google-build-using-namespace,
-misc-non-private-member-variables-in-classes,
-misc-const-correctness,
-misc-include-cleaner,
Expand Down
6 changes: 4 additions & 2 deletions app/Graph/build.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,16 +138,18 @@ void build_graph_linear(it_lab_ai::Graph& graph, it_lab_ai::Tensor& input,
if (comments) std::cout << "Input set in graph." << '\n';

graph.makeConnection(a1, layers[0]);
if (comments)
if (comments) {
std::cout << "Connection made between InputLayer and first layer." << '\n';
}

for (size_t i = 0; i < layers.size() - 1; ++i) {
if (layerpostop[i]) {
layers[i - 1]->postops.layers.push_back(layers[i]);
layers[i - 1]->postops.count++;
graph.makeConnection(layers[i - 1], layers[i + 1]);
} else if (!layerpostop[i + 1])
} else if (!layerpostop[i + 1]) {
graph.makeConnection(layers[i], layers[i + 1]);
}
}

graph.setOutput(layers.back(), output);
Expand Down
25 changes: 9 additions & 16 deletions include/layers/InputLayer.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once
#include <algorithm>
#include <cmath>
#include <cstdint>

#include "layers/Layer.hpp"

Expand Down Expand Up @@ -76,10 +77,8 @@ class InputLayer : public Layer {
}
}
}
Shape sh1({static_cast<unsigned long long>(n),
static_cast<unsigned long long>(h),
static_cast<unsigned long long>(w),
static_cast<unsigned long long>(c)});
Shape sh1({static_cast<uint64_t>(n), static_cast<uint64_t>(h),
static_cast<uint64_t>(w), static_cast<uint64_t>(c)});
output[0] = make_tensor<int>(res, sh1);
break;
}
Expand All @@ -103,10 +102,8 @@ class InputLayer : public Layer {
}
}
}
Shape sh1({static_cast<unsigned long long>(n),
static_cast<unsigned long long>(c),
static_cast<unsigned long long>(h),
static_cast<unsigned long long>(w)});
Shape sh1({static_cast<uint64_t>(n), static_cast<uint64_t>(c),
static_cast<uint64_t>(h), static_cast<uint64_t>(w)});
output[0] = make_tensor<int>(res, sh1);
break;
}
Expand Down Expand Up @@ -144,10 +141,8 @@ class InputLayer : public Layer {
}
}
}
Shape sh1({static_cast<unsigned long long>(n),
static_cast<unsigned long long>(h),
static_cast<unsigned long long>(w),
static_cast<unsigned long long>(c)});
Shape sh1({static_cast<uint64_t>(n), static_cast<uint64_t>(h),
static_cast<uint64_t>(w), static_cast<uint64_t>(c)});
output[0] = make_tensor<float>(res, sh1);
break;
}
Expand All @@ -171,10 +166,8 @@ class InputLayer : public Layer {
}
}
}
Shape sh1({static_cast<unsigned long long>(n),
static_cast<unsigned long long>(c),
static_cast<unsigned long long>(h),
static_cast<unsigned long long>(w)});
Shape sh1({static_cast<uint64_t>(n), static_cast<uint64_t>(c),
static_cast<uint64_t>(h), static_cast<uint64_t>(w)});
output[0] = make_tensor<float>(res, sh1);
break;
}
Expand Down
3 changes: 2 additions & 1 deletion src/Weights_Reader/reader_weights.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ json read_json(const std::string& filename) {
return json{};
}

char* data = (char*)mmap(nullptr, sb.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
char* data = static_cast<char*>(
mmap(nullptr, sb.st_size, PROT_READ, MAP_PRIVATE, fd, 0));
json result = json::parse(data, data + sb.st_size);

munmap(data, sb.st_size);
Expand Down
6 changes: 4 additions & 2 deletions src/layers_oneDNN/ConvLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,12 +249,14 @@ void ConvLayerOneDnn::initialize_convolution(const Shape& input_shape,
src_memory_ = dnnl::memory(conv_pd.src_desc(), *engine_);
weights_memory_ = dnnl::memory(conv_pd.weights_desc(), *engine_);
dst_memory_ = dnnl::memory(conv_pd.dst_desc(), *engine_);
if (!bias_->empty())
if (!bias_->empty()) {
bias_memory_ = dnnl::memory(conv_pd.bias_desc(), *engine_);
}

fill_memory_with_tensor(weights_memory_, *kernel_, data_type);
if (!bias_->empty())
if (!bias_->empty()) {
fill_memory_with_tensor(bias_memory_, *bias_, data_type);
}

conv_prim_ = std::make_unique<dnnl::convolution_forward>(conv_pd);
initialized_ = true;
Expand Down
Loading