From 87384c60085ec4e27879ac2995d0dd219e23d01d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eren=20G=C3=B6lge?= Date: Mon, 10 May 2021 15:24:34 +0200 Subject: [PATCH] get_device_id() for tests --- tests/__init__.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/__init__.py b/tests/__init__.py index f1445c92..c7930ef9 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1,5 +1,16 @@ import os +from TTS.utils.generic_utils import get_cuda + + +def get_device_id(): + use_cuda, _ = get_cuda() + if use_cuda: + GPU_ID = "0" + else: + GPU_ID = "" + return GPU_ID + def get_tests_path(): """Returns the path to the test directory."""