MCPcopy Create free account
hub / github.com/Oneflow-Inc/oneflow / __init__

Method __init__

python/oneflow/nn/modules/pooling.py:84–101  ·  view source on GitHub ↗
(
        self,
        kernel_size: _size_1_t,
        stride: Optional[_size_1_t] = None,
        padding: _size_1_t = 0,
        dilation: _size_1_t = 1,
        return_indices: bool = False,
        ceil_mode: bool = False,
    )

Source from the content-addressed store, hash-verified

82 """
83
84 def __init__(
85 self,
86 kernel_size: _size_1_t,
87 stride: Optional[_size_1_t] = None,
88 padding: _size_1_t = 0,
89 dilation: _size_1_t = 1,
90 return_indices: bool = False,
91 ceil_mode: bool = False,
92 ):
93 super().__init__()
94 self.kernel_size = _single(kernel_size)
95 self.stride = _single(stride) if stride is not None else self.kernel_size
96 data_format = "NCL" # only support "NCL" for now !
97 self.channel_pos = "channels_first" if data_format == "NCL" else "channels_last"
98 self.dilation = _single(dilation)
99 self.padding = _single(padding)
100 self.return_indices = return_indices
101 self.ceil_mode = ceil_mode
102
103 def forward(self, x):
104 y, indice = flow._C.max_pool1d(

Callers 13

__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected