mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-21 21:52:11 +00:00
Fix ACL EP convolution-activation fusion optimization (#3896)
Co-authored-by: Andrei-Alexandru <andrei-alexandru.avram@nxp.com>
This commit is contained in:
parent
f170f31e1d
commit
475ea382f9
1 changed files with 6 additions and 7 deletions
|
|
@ -12,18 +12,17 @@
|
|||
#include "core/providers/acl/acl_common.h"
|
||||
#include "core/providers/acl/acl_fwd.h"
|
||||
#include "core/providers/acl/acl_execution_provider.h"
|
||||
#include "contrib_ops/cpu/fused_activation.h"
|
||||
|
||||
namespace onnxruntime {
|
||||
namespace acl{
|
||||
|
||||
template <typename T>
|
||||
class FusedConv final : public acl::Conv<T> {
|
||||
public:
|
||||
explicit FusedConv(const OpKernelInfo& info) : acl::Conv<T>(info) {
|
||||
class FusedConv final : public acl::Conv<float> {
|
||||
public:
|
||||
explicit FusedConv(const OpKernelInfo& info) : acl::Conv<float>(info) {
|
||||
ORT_ENFORCE(info.GetAttr<std::string>("activation", &(this->activation_type)).IsOK());
|
||||
// printf("fused\n");
|
||||
ORT_ENFORCE(GetFusedActivationAttr(info, activation_).IsOK());
|
||||
}
|
||||
// Status Compute(OpKernelContext* context) const override;
|
||||
};
|
||||
|
||||
ONNX_OPERATOR_TYPED_KERNEL_EX(
|
||||
|
|
@ -33,7 +32,7 @@ ONNX_OPERATOR_TYPED_KERNEL_EX(
|
|||
float,
|
||||
kAclExecutionProvider,
|
||||
KernelDefBuilder().TypeConstraint("T", DataTypeImpl::GetTensorType<float>()),
|
||||
FusedConv<float>);
|
||||
FusedConv);
|
||||
|
||||
} // namespace acl
|
||||
} // namespace onnxruntime
|
||||
|
|
|
|||
Loading…
Reference in a new issue