@@ -85,7 +85,7 @@ def exponential(window_length: int,
8585 constant = 1 / tau
8686
8787 """
88- Note that non-integer step is subject to floating point rounding errors when comparing against end;
88+ Note that non-integer step is subject to floating point rounding errors when comparing against end;
8989 to avoid inconsistency, we advise adding a small epsilon to end in such cases.
9090 """
9191 k = torch .arange (center * constant ,
@@ -122,7 +122,7 @@ def cosine(window_length: int,
122122 constant = torch .pi / (window_length + 1 if periodic else window_length )
123123
124124 """
125- Note that non-integer step is subject to floating point rounding errors when comparing against end;
125+ Note that non-integer step is subject to floating point rounding errors when comparing against end;
126126 to avoid inconsistency, we advise adding a small epsilon to end in such cases.
127127 """
128128 k = torch .arange (start * constant ,
@@ -133,6 +133,8 @@ def cosine(window_length: int,
133133 device = device ,
134134 requires_grad = requires_grad )
135135
136+ _window_length_check (window_length , k .size ()[0 ])
137+
136138 return torch .sin (k )
137139
138140
@@ -159,7 +161,7 @@ def gaussian(window_length: int,
159161 constant = 1 / (std * np .sqrt (2 ))
160162
161163 """
162- Note that non-integer step is subject to floating point rounding errors when comparing against end;
164+ Note that non-integer step is subject to floating point rounding errors when comparing against end;
163165 to avoid inconsistency, we advise adding a small epsilon to end in such cases.
164166 """
165167 k = torch .arange (start * constant ,
0 commit comments