提交 73dcf2cd 编写于 作者: H Haonan

improving code comments

上级 6245fed2
......@@ -38,7 +38,8 @@ void RotateLayer::forward(PassType passType) {
size_ = input->getWidth();
CHECK_GE(size_, height_ * width_);
CHECK_EQ(size_ % (height_ * width_), 0)
<< "The input's depth should be an int";
<< "total size_ is not dividable by (height_ * width_), i.e., "
<< "channel number should be an integer";
channels_ = size_ / (height_ * width_);
resizeOutput(batchSize_, size_);
......
......@@ -21,7 +21,7 @@ namespace paddle {
/**
* A layer for rotating a multi-channel feature map (M x N x C) in the spatial
* domain
* The rotation is 90 degrees in clock-wise
* The rotation is 90 degrees in clock-wise for each channel
* \f[
* y(j,i,:) = x(M-i-1,j,:)
* \f]
......
......@@ -1320,9 +1320,10 @@ TEST(Layer, RotateLayer) {
TestConfig config;
config.biasSize = 0;
config.layerConfig.set_type("rotate");
const int INPUT_SIZE = 64; // height * width * depth
const int CHANNEL = 2;
const int HEIGHT = 8;
const int WIDTH = 4;
const int INPUT_SIZE = HEIGHT * WIDTH * CHANNEL;
config.layerConfig.set_size(INPUT_SIZE);
config.layerConfig.set_height(HEIGHT);
config.layerConfig.set_width(WIDTH);
......
......@@ -1679,8 +1679,8 @@ def trans_layer(input, name=None, layer_attr=None):
@layer_support()
def rotate_layer(input, height, width, name=None, layer_attr=None):
"""
A layer for rotating 90 degrees (clock-wise), usually used when the input sample
is some image or feature map.
A layer for rotating 90 degrees (clock-wise) for each feature channel,
usually used when the input sample is some image or feature map.
.. math::
y(j,i,:) = x(M-i-1,j,:)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册