Someone told me the following which seems to help eliminating the AttributeError.
this is probably your culprit
class SkipEdge(Edge):
    def __init__(self):
        super().__init__()

    def f(self, x):
        return x

in all the other Edge subclass, you assign a nn.Module subclass nn.MaxPool2d, nn.Conv2d, nn.Linear, etc to self.f, which does have a parameters method ('cause it comes from nn.Module) but in this case, self.f is just a simple function, so it won’t have a parameters method
never did deep learning stuff but maybe something like that would work
class Skip(nn.Module):
    def forward(self, x):
        return x

class SkipEdge(Edge):
    def __init__(self):
        super().__init__()
        self.f = Skip()