Skip to content

Conversation

@reyoung
Copy link
Collaborator

@reyoung reyoung commented Jan 19, 2017

Extract FunctionBase into a seperate header.

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);
Copy link
Collaborator Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

哦,warning来自于unsigned。

#include <memory>
#include "ModelConfig.pb.h"
#include "paddle/function/Function.h"
#include "paddle/function/FunctionBase.h"
Copy link
Collaborator Author

@reyoung reyoung Jan 19, 2017

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.

Copy link
Contributor

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里面。

Copy link
Collaborator Author

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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

哦,warning来自于unsigned。

#include <memory>
#include "ModelConfig.pb.h"
#include "paddle/function/Function.h"
#include "paddle/function/FunctionBase.h"
Copy link
Contributor

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里面。

@reyoung reyoung closed this Jan 20, 2017
@reyoung reyoung deleted the feature/speed_up_compile branch January 20, 2017 10:24
zhhsplendid pushed a commit to zhhsplendid/Paddle that referenced this pull request Sep 25, 2019
* 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>
zhangyuqin1998 pushed a commit to zhangyuqin1998/Paddle that referenced this pull request Feb 20, 2025
* Add missing `#include <cstdio>` * move to non nvrtc part --------- Co-authored-by: Haicheng Wu <haichengw@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants