Llilinjiebug fix sync
42212d11创建于 2025年8月5日历史提交
From dc794aa2bd4c970a64d931b82db026d4900de18f Mon Sep 17 00:00:00 2001
From: lilinjie <lilinjie11@huawei.com>
Date: Mon, 4 Aug 2025 20:14:37 +0800
Subject: [PATCH] fix softmax bug

---
 src/cpu/aarch64/acl_softmax.hpp | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/cpu/aarch64/acl_softmax.hpp b/src/cpu/aarch64/acl_softmax.hpp
index a4bfd0c3bd..a45919903d 100644
--- a/src/cpu/aarch64/acl_softmax.hpp
+++ b/src/cpu/aarch64/acl_softmax.hpp
@@ -94,11 +94,12 @@ struct acl_softmax_fwd_t : public primitive_t {
         status_t init(engine_t *engine) {
 
             bool ok = is_fwd()
-                    // ACL only supports matching src/dst data types
-                    && src_md()->data_type == dst_md()->data_type
+                    && set_default_formats() == status::success
+                    // ACL only supports matching src/dst (this must come after
+                    // set_default_formats() to handle format_kind::any)
+                    && *src_md() == *dst_md()
                     && utils::one_of(src_md()->data_type, data_type::f32)
-                    && attr()->has_default_values()
-                    && set_default_formats() == status::success;
+                    && attr()->has_default_values();
             if (!ok) return status::unimplemented;
 
             // Get memory desc to find sizes and dims
-- 
2.24.3 (Apple Git-128)