Skip to content

Commit a75c39e

Browse files
author
NeiroYT
committed
Fix clang
1 parent 0200a7e commit a75c39e

3 files changed

Lines changed: 16 additions & 11 deletions

File tree

include/layers_oneDNN/ConvLayer.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ class ConvLayerOneDnn : public Layer {
1616
stride_(1),
1717
pads_(0),
1818
dilations_(1),
19-
group_(1),
20-
use_legacy_(false),
2119
kernel_(nullptr),
22-
bias_(nullptr) {}
20+
bias_(nullptr),
21+
group_(1),
22+
use_legacy_(false) {}
2323

2424
ConvLayerOneDnn(size_t stride, size_t pads, size_t dilations, Tensor& kernel,
2525
Tensor& bias = *std::make_shared<Tensor>(), size_t group = 1,
@@ -33,7 +33,7 @@ class ConvLayerOneDnn : public Layer {
3333
group_(group),
3434
use_legacy_(use_legacy) {}
3535

36-
ConvLayerOneDnn(size_t stride, size_t pads, size_t dilations,
36+
ConvLayerOneDnn(size_t stride, size_t pads, size_t dilations,
3737
std::shared_ptr<Tensor> kernel,
3838
std::shared_ptr<Tensor> bias = std::make_shared<Tensor>(),
3939
size_t group = 1, bool use_legacy = false)

src/layers/ConvLayer.cpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ void ConvolutionalLayer::run(const std::vector<Tensor>& input,
2121
ParBackend backend = options.par_backend;
2222

2323
if (group_ > 1) {
24-
if (group_ == input[0].get_shape()[1] && group_ == kernel_->get_shape()[0]) {
24+
if (group_ == input[0].get_shape()[1] &&
25+
group_ == kernel_->get_shape()[0]) {
2526
switch (input[0].get_type()) {
2627
case Type::kFloat:
2728
DepthwiseConv4D<float>(input[0], *kernel_, *bias_, output[0], stride_,
@@ -83,9 +84,11 @@ void ConvolutionalLayer::run(const std::vector<Tensor>& input,
8384
dilations_ +
8485
kernel_->get_shape()[kernel_->get_shape().dims() - 1],
8586
static_cast<int>(
86-
((1 + kernel_->get_shape()[kernel_->get_shape().dims() - 1]) *
87+
((1 +
88+
kernel_->get_shape()[kernel_->get_shape().dims() - 1]) *
8789
dilations_ +
88-
kernel_->get_shape()[kernel_->get_shape().dims() - 1] - 1) /
90+
kernel_->get_shape()[kernel_->get_shape().dims() - 1] -
91+
1) /
8992
2)),
9093
sh);
9194
} else {
@@ -137,9 +140,11 @@ void ConvolutionalLayer::run(const std::vector<Tensor>& input,
137140
dilations_ +
138141
kernel_->get_shape()[kernel_->get_shape().dims() - 1],
139142
static_cast<int>(
140-
((1 + kernel_->get_shape()[kernel_->get_shape().dims() - 1]) *
143+
((1 +
144+
kernel_->get_shape()[kernel_->get_shape().dims() - 1]) *
141145
dilations_ +
142-
kernel_->get_shape()[kernel_->get_shape().dims() - 1] - 1) /
146+
kernel_->get_shape()[kernel_->get_shape().dims() - 1] -
147+
1) /
143148
2)),
144149
sh);
145150
} else {

src/layers/FCLayer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ void FCLayer::run(const std::vector<Tensor>& input,
3838
break;
3939
}
4040
case Type::kFloat: {
41-
FCLayerImpl<float> used_impl(*weights_->as<float>(), weights_->get_shape(),
42-
*bias_->as<float>());
41+
FCLayerImpl<float> used_impl(*weights_->as<float>(),
42+
weights_->get_shape(), *bias_->as<float>());
4343
auto result = used_impl.run(*input[0].as<float>());
4444
output[0] = make_tensor(result, {batch_size, output_size});
4545
break;

0 commit comments

Comments
 (0)