Elffuss BraidHub

kikocis/ncnn public

onnx2pnnx do not fold single constant for gemm weight (#5634)

Changesetb2ca57dc6b91b39d7374154cf6eb9ace04c8cb4a40fbcdd296a049773b01fcd8
Authornihui <nihuini@tencent.com> · 2024-08-17 10:39 +08:00
CommitterGitHub <noreply@github.com> · 2024-08-17 10:39 +08:00
Parentsb428072b6350

Browse the files at this changeset

1 file changed

modified tools/pnnx/src/pass_onnx.cpp +2 −0
@@ -820,6 +820,8 @@
820820 is_attr_weight = true;
821821 if (sim_op_type == "Gather" && j == 0)
822822 is_attr_weight = true;
823+ if (sim_op_type == "Gemm" && (j == 1 || j == 2))
824+ is_attr_weight = true;
823825 if (sim_op_type == "GroupNormalization" && (j == 1 || j == 2))
824826 is_attr_weight = true;
825827 if (sim_op_type == "GRU" && (j == 1 || j == 2 || j == 3 || j == 5))