-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f666bc8
commit 2d4c477
Showing
2 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
from torch import nn | ||
from refiners.fluxion.layers.module import Module | ||
|
||
|
||
class MaxPool1d(nn.MaxPool1d, Module): | ||
def __init__( | ||
self, | ||
kernel_size: int, | ||
stride: int | None = None, | ||
padding: int = 0, | ||
dilation: int = 1, | ||
return_indices: bool = False, | ||
ceil_mode: bool = False, | ||
) -> None: | ||
super().__init__( | ||
kernel_size=kernel_size, | ||
stride=stride, | ||
padding=padding, | ||
dilation=dilation, | ||
return_indices=return_indices, | ||
ceil_mode=ceil_mode, | ||
) | ||
|
||
|
||
class MaxPool2d(nn.MaxPool2d, Module): | ||
def __init__( | ||
self, | ||
kernel_size: int | tuple[int, int], | ||
stride: int | tuple[int, int] | None = None, | ||
padding: int | tuple[int, int] = (0, 0), | ||
dilation: int | tuple[int, int] = (1, 1), | ||
return_indices: bool = False, | ||
ceil_mode: bool = False, | ||
) -> None: | ||
super().__init__( | ||
kernel_size=kernel_size, | ||
stride=stride, | ||
padding=padding, # type: ignore | ||
dilation=dilation, | ||
return_indices=return_indices, | ||
ceil_mode=ceil_mode, | ||
) |