-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix compiler warning & speed up compile stage. #1197
Conversation
Extract FunctionBase into a seperate header.
CHECK_EQ(shape_.ndims(), (size_t)2); | ||
CHECK_EQ(row_.shape().ndims(), (size_t)1); | ||
CHECK_EQ(col_.shape().ndims(), (size_t)1); | ||
CHECK_EQ(shape_.ndims(), 2UL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is simpler to use a 'U' or 'UL' suffix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
哦,warning来自于unsigned。
@@ -18,7 +18,7 @@ limitations under the License. */ | |||
#include <functional> | |||
#include <memory> | |||
#include "ModelConfig.pb.h" | |||
#include "paddle/function/Function.h" | |||
#include "paddle/function/FunctionBase.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make Layer.h depend on FunctionBase.h.
It could speed up compiling time very much, and it makes us not to recompile the whole Paddle when we change something in Function library.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layer.h还是需要知道完整的BufferArgs类型的;Function的Prepare arguments阶段是将Layer的参数Argument类型,转换成Function的参数BufferArg类型,这个对于很多Layer的实现是一样的,后续会考虑在class Layer里面实现。
编译耗时的问题可能来自于,当前BufferArg的一些函数的实现是在类声明里面的,这些可以移入cpp里面。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好,那我先close了。。其他的fix回头顺手改一下吧 :)
CHECK_EQ(shape_.ndims(), (size_t)2); | ||
CHECK_EQ(row_.shape().ndims(), (size_t)1); | ||
CHECK_EQ(col_.shape().ndims(), (size_t)1); | ||
CHECK_EQ(shape_.ndims(), 2UL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
哦,warning来自于unsigned。
@@ -18,7 +18,7 @@ limitations under the License. */ | |||
#include <functional> | |||
#include <memory> | |||
#include "ModelConfig.pb.h" | |||
#include "paddle/function/Function.h" | |||
#include "paddle/function/FunctionBase.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layer.h还是需要知道完整的BufferArgs类型的;Function的Prepare arguments阶段是将Layer的参数Argument类型,转换成Function的参数BufferArg类型,这个对于很多Layer的实现是一样的,后续会考虑在class Layer里面实现。
编译耗时的问题可能来自于,当前BufferArg的一些函数的实现是在类声明里面的,这些可以移入cpp里面。
* Refine create_array op api doc. test=develop Signed-off-by: zhaoyuchen <zhaoyuchen01@baidu.com> * Refine create_array api doc test=develop Signed-off-by: zhaoyuchen <zhaoyuchen01@baidu.com>
Extract FunctionBase into a seperate header.