HHousen / lecture2notes

Re-definition found for builtin function PYL-W0622
Anti-pattern
Minor
3 years ago4 years old
 13class Frame:
 14    """Represents a "frame" of audio data."""
 15
 16    def __init__(self, bytes, timestamp, duration): 17        self.bytes = bytes
 18        self.timestamp = timestamp
 19        self.duration = duration
37        super().__init__()
38        self.inplace = inplace
39
40    def forward(self, input):41        """
42        Forward pass of the function.
43        """
 4
 5
 6# implement mish activation function
 7def f_mish(input, inplace=False): 8    """
 9    Applies the mish function element-wise:
10    :math:`mish(x) = x * tanh(softplus(x)) = x * tanh(ln(1 + exp(x)))`
116        self.candidate_layers = candidate_layers  # list
117
118        def save_fmaps(key):
119            def forward_hook(module, input, output):120                self.fmap_pool[key] = output.detach()
121
122            return forward_hook