megengine.functional.nn.sliding_window¶
- sliding_window(inp, kernel_size, padding=0, stride=1, dilation=1)[source]¶
Extracts sliding local blocks from a batched input tensor.
Refer to
SlidingWindow
for more information.- Parameters
inp (
Tensor
) – input tensor.kernel_size (
Union
[int
,Tuple
[int
,int
]]) – size of the window.padding (
Union
[int
,Tuple
[int
,int
]]) – implicit zero padding added on both sides of input. Default: 0stride (
Union
[int
,Tuple
[int
,int
]]) – stride of the window. Default: 1dilation (
Union
[int
,Tuple
[int
,int
]]) – dilation of the window. Default: 1
- Return type