Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[transformer] remove pe to device #2413

Merged
merged 2 commits into from
Mar 15, 2024
Merged

[transformer] remove pe to device #2413

merged 2 commits into from
Mar 15, 2024

Conversation

Mddct
Copy link
Collaborator

@Mddct Mddct commented Mar 15, 2024

48self.pe = torch.zeros(self.max_len, self.d_model)
模型初始化的时候这个成员在cpu上
73self.pe = self.pe.to(x.device)

fsd的时候, self.pe 被注册为cpu, 等号不能成立,报错

@xingchensong xingchensong merged commit 761db08 into main Mar 15, 2024
6 checks passed
@xingchensong xingchensong deleted the Mddct-register-buffer branch March 15, 2024 12:34
@Mddct Mddct mentioned this pull request Mar 23, 2024
24 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants