Skip to content

Commit

Permalink
simplified padding
Browse files Browse the repository at this point in the history
Signed-off-by: Dan <Dan@DESKTOP-UQ7GDK9>
  • Loading branch information
SmerkyG committed Jan 31, 2024
1 parent ded473e commit fd0342f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion RWKV-v5/src/module/rwkv_inner.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def rwkv_inner(r,k,v,w,u,kv_state,chunk_len:int=24,precision_dtype:torch.dtype=t
wc_log_cum = wc_log.cumsum(dim=-2)

# chunked view of shifted_w_log
shifted_wc_log_cum = torch.cat([torch.zeros_like(wc_log_cum[:,:,:,:1,:]), wc_log_cum[:,:,:,:-1,:]], dim=-2)
shifted_wc_log_cum = F.pad(wc_log_cum, (0, 0, 1, -1))


# NOTE - we have to apply the decay weight from TWO ahead.. ONE ahead gets no decay (log==0)
Expand Down

0 comments on commit fd0342f

Please sign in to comment.