From 7dae4a11fdafc4b0f50c13677389526fd924d6a2 Mon Sep 17 00:00:00 2001 From: pkufool Date: Fri, 7 Jan 2022 20:25:57 +0800 Subject: [PATCH] Minor fixes --- .flake8 | 2 ++ icefall/utils.py | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.flake8 b/.flake8 index 19c3a9bd6..c56cd6fba 100644 --- a/.flake8 +++ b/.flake8 @@ -6,6 +6,8 @@ per-file-ignores = # line too long egs/librispeech/ASR/*/conformer.py: E501, egs/aishell/ASR/*/conformer.py: E501, + # invalid escape sequence (cause by tex formular), W605 + icefall/utils.py: E501, W605 exclude = .git, diff --git a/icefall/utils.py b/icefall/utils.py index fa8f4d334..7e504108e 100644 --- a/icefall/utils.py +++ b/icefall/utils.py @@ -25,13 +25,15 @@ from collections import defaultdict from contextlib import contextmanager from datetime import datetime from pathlib import Path -from typing import Dict, Iterable, List, TextIO, Tuple, Union +from typing import Dict, Iterable, List, TextIO, Optional, Tuple, Union import k2 import k2.version import kaldialign import torch +import torch.nn as nn import torch.distributed as dist +from torch.cuda.amp import GradScaler from torch.utils.tensorboard import SummaryWriter Pathlike = Union[str, Path]