Closed kumatheworld closed 1 year ago
You can define a module that looks something like the following.
class FunctionalModule(nn.Module): def __init__(self, func: Callable) -> None: super().__init__() self.forward = func
Then View and Interpolate can be made class methods rather than separate classes. It will be nice to support type hints and override __repr__() to describe the function clearly.
__repr__()
You can define a module that looks something like the following.
Then View and Interpolate can be made class methods rather than separate classes. It will be nice to support type hints and override
__repr__()
to describe the function clearly.