6
6
import torch
7
7
from torch import Tensor
8
8
from torchaudio ._internal import module_utils as _mod_utils
9
+ from torchaudio ._internal .module_utils import dropping_support
9
10
10
11
if _mod_utils .is_module_available ("numpy" ):
11
12
import numpy as np
@@ -41,6 +42,7 @@ def _convert_method_output_to_tensor(
41
42
yield key , torch .from_numpy (np_arr )
42
43
43
44
45
+ @dropping_support
44
46
@_mod_utils .requires_module ("kaldi_io" , "numpy" )
45
47
def read_vec_int_ark (file_or_fd : Any ) -> Iterable [Tuple [str , Tensor ]]:
46
48
r"""Create generator of (key,vector<int>) tuples, which reads from the ark file/stream.
@@ -64,6 +66,7 @@ def read_vec_int_ark(file_or_fd: Any) -> Iterable[Tuple[str, Tensor]]:
64
66
return _convert_method_output_to_tensor (file_or_fd , kaldi_io .read_vec_int_ark , convert_contiguous = True )
65
67
66
68
69
+ @dropping_support
67
70
@_mod_utils .requires_module ("kaldi_io" , "numpy" )
68
71
def read_vec_flt_scp (file_or_fd : Any ) -> Iterable [Tuple [str , Tensor ]]:
69
72
r"""Create generator of (key,vector<float32/float64>) tuples, read according to Kaldi scp.
@@ -84,6 +87,7 @@ def read_vec_flt_scp(file_or_fd: Any) -> Iterable[Tuple[str, Tensor]]:
84
87
return _convert_method_output_to_tensor (file_or_fd , kaldi_io .read_vec_flt_scp )
85
88
86
89
90
+ @dropping_support
87
91
@_mod_utils .requires_module ("kaldi_io" , "numpy" )
88
92
def read_vec_flt_ark (file_or_fd : Any ) -> Iterable [Tuple [str , Tensor ]]:
89
93
r"""Create generator of (key,vector<float32/float64>) tuples, which reads from the ark file/stream.
@@ -104,6 +108,7 @@ def read_vec_flt_ark(file_or_fd: Any) -> Iterable[Tuple[str, Tensor]]:
104
108
return _convert_method_output_to_tensor (file_or_fd , kaldi_io .read_vec_flt_ark )
105
109
106
110
111
+ @dropping_support
107
112
@_mod_utils .requires_module ("kaldi_io" , "numpy" )
108
113
def read_mat_scp (file_or_fd : Any ) -> Iterable [Tuple [str , Tensor ]]:
109
114
r"""Create generator of (key,matrix<float32/float64>) tuples, read according to Kaldi scp.
@@ -124,6 +129,7 @@ def read_mat_scp(file_or_fd: Any) -> Iterable[Tuple[str, Tensor]]:
124
129
return _convert_method_output_to_tensor (file_or_fd , kaldi_io .read_mat_scp )
125
130
126
131
132
+ @dropping_support
127
133
@_mod_utils .requires_module ("kaldi_io" , "numpy" )
128
134
def read_mat_ark (file_or_fd : Any ) -> Iterable [Tuple [str , Tensor ]]:
129
135
r"""Create generator of (key,matrix<float32/float64>) tuples, which reads from the ark file/stream.
0 commit comments