Allow string for device
argument of AccuracyCalculator
#737
Labels
enhancement
New feature or request
device
argument of AccuracyCalculator
#737
Calling
AccuracyCalculator(device="cpu")
instead ofAccuracyCalculator(device=torch.device("cpu"))
crashes with an unclear exception(AttributeError: 'str' object has no attribute 'type')
.It'd be better to check if
isinstance(device, str)
, and then dodevice=torch.device(device)
The text was updated successfully, but these errors were encountered: