Commit b7fa6bb1 authored by Chaitanya Inumella's avatar Chaitanya Inumella
Browse files

Added the change to fix the float-to-int warning errors

parent 7ee6c2c0
......@@ -134,7 +134,7 @@ struct GeneratorTensor_cuTensor
template <typename... Is>
T operator()(Is...)
{
float tmp = ((float(std::rand()))/RAND_MAX - 0.5)*100;
float tmp = (float(std::rand())/float(RAND_MAX) - 0.5)*100;
return static_cast<T>(tmp);
}
};
......@@ -148,7 +148,7 @@ struct GeneratorTensor_cuTensor<ck::bhalf_t>
template <typename... Is>
ck::bhalf_t operator()(Is...)
{
float tmp = ((float(std::rand()))/RAND_MAX - 0.5)*100;
float tmp = (float(std::rand())/float(RAND_MAX) - 0.5)*100;
return ck::type_convert<ck::bhalf_t>(tmp);
}
};
......
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