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

Method __init__

python/oneflow/nn/modules/pooling.py:608–627  ·  view source on GitHub ↗
(
        self,
        kernel_size: _size_3_t,
        stride: Optional[_size_3_t] = None,
        padding: _size_3_t = 0,
        ceil_mode: bool = False,
        count_include_pad: bool = True,
        divisor_override: int = 0,
    )

Source from the content-addressed store, hash-verified

606 """
607
608 def __init__(
609 self,
610 kernel_size: _size_3_t,
611 stride: Optional[_size_3_t] = None,
612 padding: _size_3_t = 0,
613 ceil_mode: bool = False,
614 count_include_pad: bool = True,
615 divisor_override: int = 0,
616 ):
617 super().__init__()
618 self.kernel_size = _triple(kernel_size)
619 data_format = "NCHW" # only support "NCHW" for now !
620 self.channel_pos = (
621 "channels_first" if data_format == "NCHW" else "channels_last"
622 )
623 self.stride = _triple(stride) if (stride is not None) else _triple(kernel_size)
624 self.ceil_mode = ceil_mode
625 self.count_include_pad = count_include_pad
626 self.divisor_override = int(divisor_override)
627 self.padding = _triple(padding)
628
629 def forward(self, x):
630 return flow._C.avg_pool3d(

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected