mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-05 16:48:03 +08:00
Add abs functions
This commit is contained in:
@@ -39,6 +39,7 @@ DEFINE_ACTIVATION_KERNEL(Sqrt, SqrtFunctor)
|
||||
DEFINE_ACTIVATION_KERNEL(Log, LogFunctor)
|
||||
DEFINE_ACTIVATION_KERNEL(Round, RoundFunctor)
|
||||
DEFINE_ACTIVATION_KERNEL(Exp, ExpFunctor)
|
||||
DEFINE_ACTIVATION_KERNEL(Abs, AbsFunctor)
|
||||
|
||||
void Sqrt(const FDTensor& x, FDTensor* out) {
|
||||
FD_VISIT_FLOAT_TYPES(x.dtype, "SqrtKernel",
|
||||
@@ -60,5 +61,10 @@ void Exp(const FDTensor& x, FDTensor* out) {
|
||||
([&] { ExpKernel<data_t>(x, out); }));
|
||||
}
|
||||
|
||||
void Abs(const FDTensor& x, FDTensor* out) {
|
||||
FD_VISIT_FLOAT_TYPES(x.dtype, "AbsKernel",
|
||||
([&] { AbsKernel<data_t>(x, out); }));
|
||||
}
|
||||
|
||||
} // namespace function
|
||||
} // namespace fastdeploy
|
Reference in New Issue
Block a user