Regular Expressions 101

Community Library Entry

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 - 2 years ago (Last modified 2 years ago)