From 59e7b2ce692103e01edba33b7a331526e1157793 Mon Sep 17 00:00:00 2001 From: nihui Date: Sat, 22 Jun 2024 21:52:28 +0800 Subject: [PATCH] Update test_multiheadattention.cpp --- tests/test_multiheadattention.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_multiheadattention.cpp b/tests/test_multiheadattention.cpp index 9cf211b5ed5..6dd108d0315 100644 --- a/tests/test_multiheadattention.cpp +++ b/tests/test_multiheadattention.cpp @@ -106,7 +106,7 @@ static int test_multiheadattention_sameqkv(const ncnn::Mat& a, int embed_dim, in pd.set(2, embed_dim * qdim); pd.set(3, qdim); pd.set(4, qdim); - pd.set(6, 0.6f); + pd.set(6, 2.f / sqrtf(embed_dim / num_heads)); std::vector weights(8); weights[0] = RandomMat(embed_dim * qdim);