mirror of
https://github.com/ROCm/composable_kernel.git
synced 2026-05-17 03:19:48 +00:00
Adding Missed Activation Functions for Grouped 2D/3D Convolutions (#1348)
* Initial Push
* First Push
* Fixed Clang format
* Resolve merge conflict
* Addressed review comments
* Addressed review comments
* Addressed review comments
[ROCm/composable_kernel commit: 0162a5f6ba]
This commit is contained in:
committed by
GitHub
parent
19c52f8082
commit
cc15ede67e
@@ -961,6 +961,24 @@ struct Elu
|
||||
const float alpha_;
|
||||
};
|
||||
|
||||
struct Logistic
|
||||
{
|
||||
Logistic(float alpha = 1.f) : alpha_(alpha){};
|
||||
|
||||
template <typename T>
|
||||
__host__ __device__ void operator()(T& y, const T& x) const
|
||||
{
|
||||
static_assert(is_same<T, float>::value || is_same<T, double>::value ||
|
||||
is_same<T, half_t>::value || is_same<T, int32_t>::value ||
|
||||
is_same<T, int8_t>::value,
|
||||
"Data type is not supported by this operation!");
|
||||
T casted_alpha = type_convert<T>(alpha_);
|
||||
constexpr T one = type_convert<T>(1);
|
||||
y = casted_alpha / (one + ck::math::exp(-x) * casted_alpha);
|
||||
}
|
||||
const float alpha_;
|
||||
};
|
||||
|
||||
struct ConvInvscale
|
||||
{
|
||||
__host__ __device__ ConvInvscale(float scale_in = 1.f,
|
||||
|
||||
Reference in New Issue
Block a user