Fix ACL EP convolution-activation fusion optimization (#3896)

Co-authored-by: Andrei-Alexandru <andrei-alexandru.avram@nxp.com>
This commit is contained in:
Andrews548 2020-05-13 00:06:48 +03:00 committed by GitHub
parent f170f31e1d
commit 475ea382f9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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