@@ -379,6 +379,9 @@ struct SiLu<Array<T, N>> {
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
using ScaledSiLu = Scale<SiLu<T>>;
|
||||
|
||||
// Hardswish operator introduced by Howard et al. in the following paper
|
||||
// "Searching for MobileNetV3" (2019)
|
||||
// https://arxiv.org/pdf/1905.02244.pdf
|
||||
|
||||
@@ -219,10 +219,10 @@ public:
|
||||
|
||||
/// Clamping constant value
|
||||
ElementCompute const kClampMax =
|
||||
ElementCompute(platform::numeric_limits<ElementOutput>::max());
|
||||
ElementCompute(cutlass::platform::numeric_limits<ElementOutput>::max());
|
||||
|
||||
ElementCompute const kClampMin =
|
||||
ElementCompute(platform::numeric_limits<ElementOutput>::lowest());
|
||||
ElementCompute(cutlass::platform::numeric_limits<ElementOutput>::lowest());
|
||||
|
||||
intermediate = max_accumulator(intermediate, kClampMin);
|
||||
intermediate = min_accumulator(intermediate, kClampMax);
|
||||
@@ -260,10 +260,10 @@ public:
|
||||
|
||||
/// Clamping constant value
|
||||
ElementCompute const kClampMax =
|
||||
ElementCompute(platform::numeric_limits<ElementOutput>::max());
|
||||
ElementCompute(cutlass::platform::numeric_limits<ElementOutput>::max());
|
||||
|
||||
ElementCompute const kClampMin =
|
||||
ElementCompute(platform::numeric_limits<ElementOutput>::lowest());
|
||||
ElementCompute(cutlass::platform::numeric_limits<ElementOutput>::lowest());
|
||||
|
||||
intermediate = max_accumulator(intermediate, kClampMin);
|
||||
intermediate = min_accumulator(intermediate, kClampMax);
|
||||
@@ -299,7 +299,7 @@ public:
|
||||
using ElementCompute = float;
|
||||
|
||||
static_assert(
|
||||
platform::numeric_limits<ElementOutput>::is_integer,
|
||||
cutlass::platform::numeric_limits<ElementOutput>::is_integer,
|
||||
"This elementwise op expects the output to be int.");
|
||||
|
||||
static int const kCount = Count;
|
||||
@@ -499,7 +499,7 @@ class FastLinearCombinationClamp {
|
||||
using ElementCompute = float;
|
||||
|
||||
static_assert(
|
||||
platform::numeric_limits<ElementOutput>::is_integer,
|
||||
cutlass::platform::numeric_limits<ElementOutput>::is_integer,
|
||||
"This elementwise op expects the output to be int.");
|
||||
|
||||
static int const kCount = Count;
|
||||
|
||||
@@ -447,7 +447,7 @@ public:
|
||||
// Compute threshold optionally
|
||||
intermediate = relu(threshold_, intermediate);
|
||||
|
||||
if (platform::numeric_limits<ElementOutput>::is_integer) {
|
||||
if (cutlass::platform::numeric_limits<ElementOutput>::is_integer) {
|
||||
// Convert floats back to INT
|
||||
FragmentAccumulator scaled_accumulator;
|
||||
|
||||
@@ -492,7 +492,7 @@ public:
|
||||
// Compute threshold optionally
|
||||
intermediate = relu(threshold_, intermediate);
|
||||
|
||||
if (platform::numeric_limits<ElementOutput>::is_integer) {
|
||||
if (cutlass::platform::numeric_limits<ElementOutput>::is_integer) {
|
||||
// Convert floats back to INT
|
||||
FragmentAccumulator scaled_accumulator;
|
||||
|
||||
@@ -540,7 +540,7 @@ public:
|
||||
// Compute threshold optionally
|
||||
intermediate = relu(threshold_, intermediate);
|
||||
|
||||
if (platform::numeric_limits<ElementOutput>::is_integer) {
|
||||
if (cutlass::platform::numeric_limits<ElementOutput>::is_integer) {
|
||||
// Convert floats back to INT
|
||||
FragmentAccumulator scaled_accumulator;
|
||||
|
||||
|
||||
@@ -418,7 +418,7 @@ public:
|
||||
// Compute threshold optionally
|
||||
intermediate = relu(intermediate);
|
||||
|
||||
if (platform::numeric_limits<ElementOutput>::is_integer) {
|
||||
if (cutlass::platform::numeric_limits<ElementOutput>::is_integer) {
|
||||
// Convert floats back to INT
|
||||
FragmentAccumulator scaled_accumulator;
|
||||
|
||||
@@ -463,7 +463,7 @@ public:
|
||||
// Compute threshold optionally
|
||||
intermediate = relu(intermediate);
|
||||
|
||||
if (platform::numeric_limits<ElementOutput>::is_integer) {
|
||||
if (cutlass::platform::numeric_limits<ElementOutput>::is_integer) {
|
||||
// Convert floats back to INT
|
||||
FragmentAccumulator scaled_accumulator;
|
||||
|
||||
@@ -511,7 +511,7 @@ public:
|
||||
// Compute threshold optionally
|
||||
intermediate = relu(intermediate);
|
||||
|
||||
if (platform::numeric_limits<ElementOutput>::is_integer) {
|
||||
if (cutlass::platform::numeric_limits<ElementOutput>::is_integer) {
|
||||
// Convert floats back to INT
|
||||
FragmentAccumulator scaled_accumulator;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user