From b0d8771faf35c98419de795e7f2bc0628ac84b06 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 22 Aug 2024 04:04:50 +0000 Subject: [PATCH] fix --- impl/ascend/aclnn/adaptor.hpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/impl/ascend/aclnn/adaptor.hpp b/impl/ascend/aclnn/adaptor.hpp index 1e6c8aeb6..558240b35 100644 --- a/impl/ascend/aclnn/adaptor.hpp +++ b/impl/ascend/aclnn/adaptor.hpp @@ -209,12 +209,15 @@ decltype(auto) convertType(T&& param) { } } -// For the case that the input is not a class or a pointer, do nothing. -template , std::enable_if_t && !std::is_pointer_v, int> = 0> -void releaseConverted(T&& param [[maybe_unused]]) {} // no conversion, do nothing +template +struct NeedReleaseType : std::disjunction, aclTensor*>, std::is_same, aclTensorList*>, + std::is_same, aclScalar*>, std::is_same, aclScalarList*>, + std::is_same, aclIntArray*>, std::is_same, aclBoolArray*>, + std::is_same, aclFloatArray*>> {}; -// Overload for const char* const& -inline void releaseConverted(const char* const& param [[maybe_unused]]) {} +// For the case that the input is not a class or a pointer, do nothing. +template ::value, int> = 0> +void releaseConverted(T param) {} // no conversion, do nothing #define IMPL_ASCEND_ACLNN_REGISTER_DESTRUCTOR(Type) \ inline void releaseConverted(const acl##Type* param) { \