We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents a06bec1 + a21fe4a commit 54b3994Copy full SHA for 54b3994
paddle/gserver/layers/ROIPoolLayer.cpp
@@ -13,6 +13,7 @@ See the License for the specific language governing permissions and
13
limitations under the License. */
14
15
#include "ROIPoolLayer.h"
16
+#include <cfloat>
17
18
namespace paddle {
19
@@ -126,10 +127,8 @@ void ROIPoolLayer::forward(PassType passType) {
126
127
128
bool isEmpty = (hend <= hstart) || (wend <= wstart);
129
size_t poolIndex = ph * pooledWidth_ + pw;
- if (isEmpty) {
130
- outputData[poolIndex] = 0;
131
- argmaxData[poolIndex] = -1;
132
- }
+ outputData[poolIndex] = isEmpty ? 0 : -FLT_MAX;
+ argmaxData[poolIndex] = -1;
133
134
for (size_t h = hstart; h < hend; ++h) {
135
for (size_t w = wstart; w < wend; ++w) {
0 commit comments