This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
import torch.nn as nn | |
import torch.nn.functional as F | |
from torchaudio.functional import lfilter as torch_lfilter | |
from torch.autograd import Function, gradcheck | |
class lfilter(Function): | |
@staticmethod |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyReLU(torch.autograd.Function): | |
""" | |
We can implement our own custom autograd Functions by subclassing | |
torch.autograd.Function and implementing the forward and backward passes | |
which operate on Tensors. | |
""" | |
@staticmethod | |
def forward(ctx, input): | |
""" |