Commit 1f6883c1 authored by Anna Petrovicheva's avatar Anna Petrovicheva

Renamed field

parent acc55b24
...@@ -71,7 +71,7 @@ FlattenLayer::FlattenLayer(LayerParams &params) : Layer(params) ...@@ -71,7 +71,7 @@ FlattenLayer::FlattenLayer(LayerParams &params) : Layer(params)
} }
else else
{ {
_endAxis = _num_axes + params.end_axis; _endAxis = _numAxes + params.end_axis;
} }
} }
...@@ -80,7 +80,7 @@ void FlattenLayer::checkInputs(const std::vector<Blob*> &inputs) ...@@ -80,7 +80,7 @@ void FlattenLayer::checkInputs(const std::vector<Blob*> &inputs)
CV_Assert(inputs.size() > 0); CV_Assert(inputs.size() > 0);
for (size_t i = 0; i < inputs.size(); i++) for (size_t i = 0; i < inputs.size(); i++)
{ {
for (size_t j = 0; j < _num_axes; j++) for (size_t j = 0; j < _numAxes; j++)
{ {
CV_Assert(inputs[i]->shape[j] == inputs[0]->shape[j]); CV_Assert(inputs[i]->shape[j] == inputs[0]->shape[j]);
} }
...@@ -110,7 +110,7 @@ void FlattenLayer::allocate(const std::vector<Blob*> &inputs, std::vector<Blob> ...@@ -110,7 +110,7 @@ void FlattenLayer::allocate(const std::vector<Blob*> &inputs, std::vector<Blob>
outputShape[i] = inputs[0]->shape()[i - interval]; outputShape[i] = inputs[0]->shape()[i - interval];
} }
outputShape[_endAxis] = flattenedDimensionSize; outputShape[_endAxis] = flattenedDimensionSize;
for (size_t i = _endAxis + 1; i < _num_axes; i++) for (size_t i = _endAxis + 1; i < _numAxes; i++)
{ {
outputShape[i] = inputs[0]->shape()[i]; outputShape[i] = inputs[0]->shape()[i];
} }
......
...@@ -52,7 +52,7 @@ class FlattenLayer : public Layer ...@@ -52,7 +52,7 @@ class FlattenLayer : public Layer
size_t _startAxis; size_t _startAxis;
size_t _endAxis; size_t _endAxis;
static const size_t _num_axes = 4; static const size_t _numAxes = 4;
public: public:
FlattenLayer(LayerParams &params); FlattenLayer(LayerParams &params);
......
...@@ -76,7 +76,7 @@ void NormalizeBBoxLayer::checkInputs(const std::vector<Blob*> &inputs) ...@@ -76,7 +76,7 @@ void NormalizeBBoxLayer::checkInputs(const std::vector<Blob*> &inputs)
CV_Assert(inputs.size() > 0); CV_Assert(inputs.size() > 0);
for (size_t i = 0; i < inputs.size(); i++) for (size_t i = 0; i < inputs.size(); i++)
{ {
for (size_t j = 0; j < _num_axes; j++) for (size_t j = 0; j < _numAxes; j++)
{ {
CV_Assert(inputs[i]->shape[j] == inputs[0]->shape[j]); CV_Assert(inputs[i]->shape[j] == inputs[0]->shape[j]);
} }
......
...@@ -71,7 +71,7 @@ class NormalizeBBoxLayer : public Layer ...@@ -71,7 +71,7 @@ class NormalizeBBoxLayer : public Layer
size_t _channelSize; size_t _channelSize;
size_t _imageSize; size_t _imageSize;
static const size_t _num_axes = 4; static const size_t _numAxes = 4;
public: public:
NormalizeBBoxLayer(LayerParams &params); NormalizeBBoxLayer(LayerParams &params);
......
...@@ -57,7 +57,7 @@ PermuteLayer::PermuteLayer(LayerParams &params) : Layer(params) ...@@ -57,7 +57,7 @@ PermuteLayer::PermuteLayer(LayerParams &params) : Layer(params)
} }
else else
{ {
for (size_t i = 0; i < _num_axes; i++) for (size_t i = 0; i < _numAxes; i++)
{ {
size_t current_order = params.order(i); size_t current_order = params.order(i);
...@@ -69,7 +69,7 @@ PermuteLayer::PermuteLayer(LayerParams &params) : Layer(params) ...@@ -69,7 +69,7 @@ PermuteLayer::PermuteLayer(LayerParams &params) : Layer(params)
} }
_needsPermute = false; _needsPermute = false;
for (int i = 0; i < _num_axes; ++i) for (int i = 0; i < _numAxes; ++i)
{ {
if (_order[i] != i) if (_order[i] != i)
{ {
...@@ -86,7 +86,7 @@ void PermuteLayer::allocate(const std::vector<Blob*> &inputs, std::vector<Blob> ...@@ -86,7 +86,7 @@ void PermuteLayer::allocate(const std::vector<Blob*> &inputs, std::vector<Blob>
_oldDimensionSize = inputs[0]->shape(); _oldDimensionSize = inputs[0]->shape();
for (size_t i = 0; i < _num_axes; i++) for (size_t i = 0; i < _numAxes; i++)
{ {
_newDimensionSize[i] = _oldDimensionSize[order[i]]; _newDimensionSize[i] = _oldDimensionSize[order[i]];
} }
...@@ -99,8 +99,8 @@ void PermuteLayer::allocate(const std::vector<Blob*> &inputs, std::vector<Blob> ...@@ -99,8 +99,8 @@ void PermuteLayer::allocate(const std::vector<Blob*> &inputs, std::vector<Blob>
outputs[i].create(BlobShape(_newDimensionSize)); outputs[i].create(BlobShape(_newDimensionSize));
} }
_oldStride.resize(_num_axes); _oldStride.resize(_numAxes);
_newStride.resize(_num_axes); _newStride.resize(_numAxes);
_oldStride[3] = 1; _oldStride[3] = 1;
_newStride[3] = 1; _newStride[3] = 1;
...@@ -135,7 +135,7 @@ void PermuteLayer::forward(std::vector<Blob*> &inputs, std::vector<Blob> &output ...@@ -135,7 +135,7 @@ void PermuteLayer::forward(std::vector<Blob*> &inputs, std::vector<Blob> &output
int oldPosition = 0; int oldPosition = 0;
int newPosition = i; int newPosition = i;
for (int j = 0; j < _num_axes; ++j) for (int j = 0; j < _numAxes; ++j)
{ {
oldPosition += (newPosition / _newStride[j]) * _oldStride[_order[j]]; oldPosition += (newPosition / _newStride[j]) * _oldStride[_order[j]];
newPosition %= _newStride[j]; newPosition %= _newStride[j];
......
...@@ -59,7 +59,7 @@ class PermuteLayer : public Layer ...@@ -59,7 +59,7 @@ class PermuteLayer : public Layer
std::vector<size_t> _newStride; std::vector<size_t> _newStride;
bool _needsPermute; bool _needsPermute;
static const size_t _num_axes = 4; static const size_t _numAxes = 4;
public: public:
PermuteLayer(LayerParams &params); PermuteLayer(LayerParams &params);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment