Skip to content

Commit 560c082

Browse files
authored
[Fbsync] Lint fix (#1726)
1 parent 4915524 commit 560c082

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

examples/pipeline_tacotron2/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,4 +253,4 @@ python inference.py --checkpoint-path ${model_path} \
253253
--input-text "Hello world!" \
254254
--text-preprocessor english_characters \
255255
--output-path "./outputs.wav"
256-
```
256+
```

test/torchaudio_unittest/common_utils/rnnt_utils.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
from torchaudio.functional import rnnt_loss
66

77

8+
CPU_DEVICE = torch.device("cpu")
9+
10+
811
class _NumpyTransducer(torch.autograd.Function):
912
@staticmethod
1013
def forward(
@@ -240,7 +243,7 @@ def get_basic_data(device):
240243
def get_B1_T10_U3_D4_data(
241244
random=False,
242245
dtype=torch.float32,
243-
device=torch.device("cpu"),
246+
device=CPU_DEVICE,
244247
):
245248
B, T, U, D = 2, 10, 3, 4
246249

@@ -263,7 +266,7 @@ def grad_hook(grad):
263266
return data
264267

265268

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):
267270
logits = torch.tensor(
268271
[
269272
0.1,
@@ -360,7 +363,7 @@ def grad_hook(grad):
360363
return data, ref_costs, ref_gradients
361364

362365

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):
364367
# Test from D21322854
365368
logits = torch.tensor(
366369
[
@@ -550,7 +553,7 @@ def get_random_data(
550553
max_D=40,
551554
blank=-1,
552555
dtype=torch.float32,
553-
device=torch.device("cpu"),
556+
device=CPU_DEVICE,
554557
seed=None,
555558
):
556559
if seed is not None:

0 commit comments

Comments
 (0)