mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-06 00:57:33 +08:00
[Functions] Add quantile function (#700)
* Add sort function * Add isfinite function * upgrade isinf isnan * Add Scalar to FDTensor * Add floor, ceil function * add cast functions * Update out_tmp * Update quantile * add gather scatter along axis * finish quantile function * Add quantile unittest * refresh code style for test source code * Add comments * Add full function * Add scalar to fd tensor * Add full unittest * Add functions headers * move fdtensor operators to fastdeploy namespace
This commit is contained in:
@@ -40,6 +40,8 @@ DEFINE_ACTIVATION_KERNEL(Log, LogFunctor)
|
||||
DEFINE_ACTIVATION_KERNEL(Round, RoundFunctor)
|
||||
DEFINE_ACTIVATION_KERNEL(Exp, ExpFunctor)
|
||||
DEFINE_ACTIVATION_KERNEL(Abs, AbsFunctor)
|
||||
DEFINE_ACTIVATION_KERNEL(Ceil, CeilFunctor)
|
||||
DEFINE_ACTIVATION_KERNEL(Floor, FloorFunctor)
|
||||
|
||||
void Sqrt(const FDTensor& x, FDTensor* out) {
|
||||
FD_VISIT_FLOAT_TYPES(x.dtype, "SqrtKernel",
|
||||
@@ -66,5 +68,15 @@ void Abs(const FDTensor& x, FDTensor* out) {
|
||||
([&] { AbsKernel<data_t>(x, out); }));
|
||||
}
|
||||
|
||||
void Ceil(const FDTensor& x, FDTensor* out) {
|
||||
FD_VISIT_FLOAT_TYPES(x.dtype, "CeilKernel",
|
||||
([&] { CeilKernel<data_t>(x, out); }));
|
||||
}
|
||||
|
||||
void Floor(const FDTensor& x, FDTensor* out) {
|
||||
FD_VISIT_FLOAT_TYPES(x.dtype, "FloorKernel",
|
||||
([&] { FloorKernel<data_t>(x, out); }));
|
||||
}
|
||||
|
||||
} // namespace function
|
||||
} // namespace fastdeploy
|
Reference in New Issue
Block a user