Regular Expressions 101

Community Patterns

cuda with gpu-number regex

0

Regular Expression
Python

r"
^(cuda)(:\d+)?$
"
gm

Description

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

Submitted by Ilya Lubenets - a year ago (Last modified a year ago)