[Paddle-TRT] use float constant instead of double test=develop (#24544)

v1.8
zlsh80826 5 years ago committed by GitHub
parent 14dd6388c5
commit fdbe114b12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -63,7 +63,7 @@ __global__ void gelu_kernel(const T a, int n, const T* input, T* output) {
const int idx = blockIdx.x * TPB + threadIdx.x;
if (idx < n) {
const T in = input[idx];
const T cdf = 0.5 * (1.0 + erf(in * 0.5 * a));
const T cdf = 0.5f * (1.0f + erff(in * 0.5f * a));
output[idx] = in * cdf;
}
}

Loading…
Cancel
Save