Skip to content

Potentially wrong device using_cuda variable status in monai/auto3dseg/analyzer.py #8800

@benediktjohannes

Description

@benediktjohannes

We set the label_tensor device to the device of the image_tensor here, but we already determined whether cuda is set or not (using_cuda) above by checking whether any of both tensors uses cuda. So in case we got label_tensor to use cuda and image_tensor not, then we would first set using_cuda to True, but then we check whether if label_tensor.device is != image_tensor.device which is True and therefore we set the device of label_tensor to non-cuda (e.g. cpu) which means that now both tensors use cpu while using_cuda is still wrongly set to True.

(see the detailed explaination in #8708, I just opened this issue here so that we don't forget about this since #8708 is already merged, but still got this potential issue open)

Metadata

Metadata

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions