-
Notifications
You must be signed in to change notification settings - Fork 39
Open
Description
您好,在 ContextManager 的 get_global_hidden_and_mask 方法中(代码位置),对 sliding_window 赋值为:
sliding_window = (self.global_remainder[0].size(-2) + rmd_st, self.n_local)我认为这里是不是用错了?我的理解应该是:
sliding_window = (rmd_st + self._global_remainder_ed - self._global_remainder_st, self.n_local)理由如下:
在刚开始执行 append 方法时,对 self.global_remainder 进行了拼接,这时 self.global_remainder[0].size(-2) 指的应该是它的物理存储长度。但是在处理某一个 exc_block 时,我们关注的应该是 self._global_remainder_ed - self._global_remainder_st 这个指针代表的逻辑长度,以这个逻辑长度构建 sliding_window 时,才能提供正确的偏移量,从而刚好跟local计算时的mask互补。我画了一个示意图如下,不知我理解的是否正确?

Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels