未验证 提交 fdbe114b 编写于 作者: Z zlsh80826 提交者: GitHub

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

上级 14dd6388
...@@ -63,7 +63,7 @@ __global__ void gelu_kernel(const T a, int n, const T* input, T* output) { ...@@ -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; const int idx = blockIdx.x * TPB + threadIdx.x;
if (idx < n) { if (idx < n) {
const T in = input[idx]; 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; output[idx] = in * cdf;
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册