Skip to content

Conversation

reyoung
Copy link
Collaborator

@reyoung reyoung commented Dec 13, 2016

Remove m4 macro language in protobuf generation. Always use double when serializing in protobuf, but use float or double in Paddle C++.

Because of the implicit conversion between float and double, most of C++ code do not need to change.

Also fix compile issues
Copy link
Contributor

@hedaoyuan hedaoyuan left a comment

Choose a reason for hiding this comment

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

LGTM,也许float就可以。

}

template <typename T1, typename T2>
static inline auto add(T1 a, T2 b) -> decltype(a + b) {
Copy link
Contributor

Choose a reason for hiding this comment

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

return 类型不是T1?decltype的话不对吧。

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

不是T1。也有可能是T2吧。。这个decltype反正可以返回a+b应该的类型。

Copy link
Contributor

Choose a reason for hiding this comment

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

你这里是确定的吧,结果最终存储的数据类型是T1指定的类型。

@reyoung
Copy link
Collaborator Author

reyoung commented Dec 13, 2016 via email

* Also fix a protential bug in WarpCTCLayer.cpp
CHECK_EQ(numClasses_, inputLayers_[0]->getSize());

blank_ = config_.blank();
CHECK_GE(blank_, 0UL);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

这个check是没有必要,并且永远为真的。

因为blank_是size_t,也是unsigned int。永远大于0。

Copy link
Contributor

Choose a reason for hiding this comment

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

ok.

@reyoung reyoung merged commit f8e8d1a into PaddlePaddle:develop Dec 13, 2016
@reyoung reyoung mentioned this pull request Dec 14, 2016
14 tasks
@reyoung reyoung deleted the feature/remove_m4 branch December 14, 2016 09:49
wangxicoding pushed a commit to wangxicoding/Paddle that referenced this pull request Dec 9, 2021
wwbitejotunn pushed a commit to wwbitejotunn/Paddle that referenced this pull request Jun 21, 2024
zhangyuqin1998 pushed a commit to zhangyuqin1998/Paddle that referenced this pull request Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants