Skip to content

Allow string for device argument of AccuracyCalculator #737

Open
@KevinMusgrave

Description

@KevinMusgrave

Calling AccuracyCalculator(device="cpu") instead of AccuracyCalculator(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 do device=torch.device(device)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions