|
sed -i '' "s/[[:space:]]*device = torch\.device('cuda:{}'/ if hasattr(torch.backends, 'mps') and torch.backends.mps.is_available() and torch.backends.mps.is_built():\n device = torch.device('mps:{}'.format(str(gpu_id)))\n else:\n device = torch.device('cuda:{}'/" nets/__init__.py
|
|
sed -i '' "s/[[:space:]]*device = torch\.device('cuda:{}'/ if hasattr(torch.backends, 'mps') and torch.backends.mps.is_available() and torch.backends.mps.is_built():\n device = torch.device('mps:{}'.format(str(gpu_id)))\n else:\n device = torch.device('cuda:{}'/" nets/__init__.py
|