Commit 4522f7f8 authored by rocking's avatar rocking
Browse files

Prevent implicit cast

parent 18e65656
...@@ -90,7 +90,9 @@ struct ReferenceLayernorm : public device::BaseOperator ...@@ -90,7 +90,9 @@ struct ReferenceLayernorm : public device::BaseOperator
for(int m = 0; m < M; ++m) for(int m = 0; m < M; ++m)
{ {
auto divisor = 1 / sqrt(var(m) + arg.epsilon_); AccDataType divisor =
static_cast<AccDataType>(1 / ck::math::sqrt(var(m) + arg.epsilon_));
for(int n = 0; n < N; ++n) for(int n = 0; n < N; ++n)
{ {
auto x_val = ck::type_convert<AccDataType>(arg.x_m_n_(m, n)); auto x_val = ck::type_convert<AccDataType>(arg.x_m_n_(m, n));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment