File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed
examples/pipeline_tacotron2
test/torchaudio_unittest/common_utils Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -253,4 +253,4 @@ python inference.py --checkpoint-path ${model_path} \
253
253
--input-text " Hello world!" \
254
254
--text-preprocessor english_characters \
255
255
--output-path " ./outputs.wav"
256
- ```
256
+ ```
Original file line number Diff line number Diff line change 5
5
from torchaudio .functional import rnnt_loss
6
6
7
7
8
+ CPU_DEVICE = torch .device ("cpu" )
9
+
10
+
8
11
class _NumpyTransducer (torch .autograd .Function ):
9
12
@staticmethod
10
13
def forward (
@@ -240,7 +243,7 @@ def get_basic_data(device):
240
243
def get_B1_T10_U3_D4_data (
241
244
random = False ,
242
245
dtype = torch .float32 ,
243
- device = torch . device ( "cpu" ) ,
246
+ device = CPU_DEVICE ,
244
247
):
245
248
B , T , U , D = 2 , 10 , 3 , 4
246
249
@@ -263,7 +266,7 @@ def grad_hook(grad):
263
266
return data
264
267
265
268
266
- def get_B1_T2_U3_D5_data (dtype = torch .float32 , device = torch . device ( "cpu" ) ):
269
+ def get_B1_T2_U3_D5_data (dtype = torch .float32 , device = CPU_DEVICE ):
267
270
logits = torch .tensor (
268
271
[
269
272
0.1 ,
@@ -360,7 +363,7 @@ def grad_hook(grad):
360
363
return data , ref_costs , ref_gradients
361
364
362
365
363
- def get_B2_T4_U3_D3_data (dtype = torch .float32 , device = torch . device ( "cpu" ) ):
366
+ def get_B2_T4_U3_D3_data (dtype = torch .float32 , device = CPU_DEVICE ):
364
367
# Test from D21322854
365
368
logits = torch .tensor (
366
369
[
@@ -550,7 +553,7 @@ def get_random_data(
550
553
max_D = 40 ,
551
554
blank = - 1 ,
552
555
dtype = torch .float32 ,
553
- device = torch . device ( "cpu" ) ,
556
+ device = CPU_DEVICE ,
554
557
seed = None ,
555
558
):
556
559
if seed is not None :
You can’t perform that action at this time.
0 commit comments