PyCIL icon indicating copy to clipboard operation
PyCIL copied to clipboard

Small correction in trainer.py

Open Paul-Walcher opened this issue 7 months ago • 0 comments

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.

Paul-Walcher avatar Jul 10 '24 06:07 Paul-Walcher