Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
Created·2023-02-10 13:22
Updated·2023-02-12 11:38
Flavor·Python

r"
^(cuda)(:\d+)?$
"
gm
Open regex in editor

Description

Used for torch.device handling, so 'cuda' and 'cuda:0' both valid and can be used

Submitted by Ilya Lubenets