Skip to content

Commit

Permalink
[CODEMOD][pytorch] replace uses of np.ndarray with npt.NDArray (#3845)
Browse files Browse the repository at this point in the history
Differential Revision: D64619891

Pull Request resolved: #3846
  • Loading branch information
igorsugak authored Oct 19, 2024
1 parent 79047bf commit a95cfa8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/torchaudio_unittest/prototype/functional/dsp_utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import numpy as np
import numpy.typing as npt


def oscillator_bank(
Expand Down Expand Up @@ -43,8 +44,8 @@ def freq_ir(magnitudes):


def exp_sigmoid(
input: np.ndarray, exponent: float = 10.0, max_value: float = 2.0, threshold: float = 1e-7
) -> np.ndarray:
input: npt.NDArray, exponent: float = 10.0, max_value: float = 2.0, threshold: float = 1e-7
) -> npt.NDArray:
"""Exponential Sigmoid pointwise nonlinearity (Numpy version).
Implements the equation:
``max_value`` * sigmoid(``input``) ** (log(``exponent``)) + ``threshold``
Expand Down

0 comments on commit a95cfa8

Please sign in to comment.