diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index c214571224a3..716f146b7833 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -301,6 +301,7 @@ List of Contributors * [Zhenghui Jin](https://github.com/barry-jin) * [Dominika Jedynak](https://github.com/DominikaJedynak) * [Adam Grabowski](https://github.com/agrabows) +* [Kacper Pietkun](https://github.com/Kacper-Pietkun) Label Bot --------- diff --git a/src/operator/mshadow_op.h b/src/operator/mshadow_op.h index 991cae79d13e..f04861867560 100644 --- a/src/operator/mshadow_op.h +++ b/src/operator/mshadow_op.h @@ -248,10 +248,17 @@ struct floor_divide : public mxnet_op::tunable { return static_cast(::floor(a / b)); } - template < - typename DType, - typename std::enable_if::value && !std::is_same::value, - int>::type = 0> + MSHADOW_XINLINE static mshadow::half::half_t Map(mshadow::half::half_t a, + mshadow::half::half_t b) { + return static_cast( + ::floor(static_cast(a) / static_cast(b))); + } + + template ::value && + !std::is_same::value && + !std::is_same::value, + int>::type = 0> MSHADOW_XINLINE static DType Map(DType a, DType b) { return ::floor(a / b); }