Skip to content

Commit 6b72c12

Browse files
authored
Fixes typo when indexing after self.conv1d (#580)
Original version indexes sequence to the padding, not the sequence length (and has a typo when refering self.dconv instead of self.d_conv).
1 parent 3b0dde5 commit 6b72c12

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mamba_ssm/modules/mamba2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ def forward(self, u, seqlen=None, seq_idx=None, cu_seqlens=None, inference_param
230230
if causal_conv1d_fn is None or self.activation not in ["silu", "swish"]:
231231
assert seq_idx is None, "varlen conv1d requires the causal_conv1d package"
232232
xBC = self.act(
233-
self.conv1d(xBC.transpose(1, 2)).transpose(1, 2)[:, -(self.dconv - 1):]
233+
self.conv1d(xBC.transpose(1, 2)).transpose(1, 2)[:, :-(self.d_conv - 1)]
234234
) # (B, L, self.d_ssm + 2 * ngroups * d_state)
235235
else:
236236
xBC = causal_conv1d_fn(

0 commit comments

Comments
 (0)