镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Small correction in trainer.py - #88

Open
Paul-Walcher wants to merge 1 commit into
LAMDA-CL:masterfrom
Paul-Walcher:master
Open

Paul-Walcher wants to merge 1 commit into
LAMDA-CL:masterfrom
Paul-Walcher:master

Conversation

@Paul-Walcher

Copy link
Copy Markdown

In trainer.py in the function "_set_device", the comparison to determine whether to use cpu or gpu is done inside the loop with the variable "device_type". If "device_type" is -1, "cpu" would have been added to the list of devices.

However, if "device_type" is -1, an error would have been thrown beforehand, since we tried to iterate over -1.

I assume this is a typo, so changing the variable to compare from "device_type" to the local variable "device" will probably have the intended behaviour.

In trainer.py renamed "device_type"-variable inside comparison to "device".
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.

1 participant