@@ -37,10 +37,10 @@ __global__ void KernelUnpool2dMax(const int nthreads, const T* input_data,
37
37
int cidx = boffset / in_c_stride;
38
38
int out_offset = bidx * out_n_stride + cidx * out_c_stride;
39
39
int out_index = indices_data[i];
40
- PADDLE_ASSERT_MSG (out_index < out_c_stride,
41
- " out_index < out_c_stride. Expected %ld < %ld, but got "
42
- " %ld >= %ld. Please check input value." ,
43
- out_index, out_c_stride, out_index, out_c_stride);
40
+ PADDLE_ENFORCE (out_index < out_c_stride,
41
+ " out_index < out_c_stride. Expected %ld < %ld, but got "
42
+ " %ld >= %ld. Please check input value." ,
43
+ out_index, out_c_stride, out_index, out_c_stride);
44
44
output_data[out_offset + out_index] = input_data[i];
45
45
}
46
46
}
@@ -62,10 +62,10 @@ __global__ void KernelUnpool2dMaxGrad(
62
62
int cidx = boffset / in_c_stride;
63
63
int out_offset = bidx * out_n_stride + cidx * out_c_stride;
64
64
int out_index = indices_data[i];
65
- PADDLE_ASSERT_MSG (out_index < out_c_stride,
66
- " out_index < out_c_stride. Expected %ld < %ld, but got "
67
- " %ld >= %ld. Please check input value." ,
68
- out_index, out_c_stride, out_index, out_c_stride);
65
+ PADDLE_ENFORCE (out_index < out_c_stride,
66
+ " out_index < out_c_stride. Expected %ld < %ld, but got "
67
+ " %ld >= %ld. Please check input value." ,
68
+ out_index, out_c_stride, out_index, out_c_stride);
69
69
input_grad[i] = output_grad[out_offset + out_index];
70
70
}
71
71
}
0 commit comments