mirror of
https://github.com/k2-fsa/icefall.git
synced 2025-09-19 05:54:20 +00:00
check whether q k v weight is None
This commit is contained in:
parent
a1a84ed148
commit
878026864c
@ -183,13 +183,13 @@ class MultiheadAttention(nn.Module):
|
||||
|
||||
if not self._qkv_same_embed_dim:
|
||||
q_proj_weight = (
|
||||
self.q_proj_weight.get_weight() if self.q_proj_weight else None
|
||||
self.q_proj_weight.get_weight() if self.q_proj_weight is not None else None
|
||||
)
|
||||
k_proj_weight = (
|
||||
self.k_proj_weight.get_weight() if self.k_proj_weight else None
|
||||
self.k_proj_weight.get_weight() if self.k_proj_weight is not None else None
|
||||
)
|
||||
v_proj_weight = (
|
||||
self.v_proj_weight.get_weight() if self.v_proj_weight else None
|
||||
self.v_proj_weight.get_weight() if self.v_proj_weight is not None else None
|
||||
)
|
||||
(
|
||||
attn_output,
|
||||
|
Loading…
x
Reference in New Issue
Block a user