《三国志13威力加强版》公开PSV版PV宣传影像
- class paddle.nn. Fold ( output_sizes: Size2, kernel_sizes: Size2, dilations: Size2 = 1, paddings: Size2 | Size4 = 0, strides: Size2 = 1, name: str | None = None ) [source]
-
百度 隔着时差,在全英文环境下,他向来自不同领域的评委阐述自己的主张、竞选成功后的打算。
Combines an array of sliding local blocks into a large containing tensor. also known as col2im when operated on batched 2D image tensor. Fold calculates each combined value in the resulting large tensor by summing all values from all containing blocks.
For each input \(x\) with shape [N, C_in , L], the output shape [N, C_out, H_out, W_out] can be calculated as following.
\[\begin{split}H_{out} &= output\_size[0] \\ W_{out} &= output\_size[1] \\ C_{out} &= \frac{C_{in}}{kernel\_sizes[0]\times kernel\_sizes[1]} \\\end{split}\]- Parameters
-
output_sizes (list) – The size of output size, should be [output_size_h, output_size_w] or an integer o treated as [o, o].
kernel_sizes (int|list|tuple) – The size of convolution kernel, should be [k_h, k_w] or an integer k treated as [k, k].
strides (int|list|tuple, optional) – The strides, should be [stride_h, stride_w] or an integer stride treated as [stride, stride]. For default, strides will be [1, 1].
paddings (int|list|tuple, optional) – The paddings of each dimension, should be [padding_top, padding_left, padding_bottom, padding_right] or [padding_h, padding_w] or an integer padding. If [padding_h, padding_w] was given, it will expanded to [padding_h, padding_w, padding_h, padding_w]. If an integer padding was given, [padding, padding, padding, padding] will be used. For default, paddings will be [0, 0, 0, 0]
dilations (int|list|tuple, optional) – The dilations of convolution kernel, should be [dilation_h, dilation_w], or an integer dilation treated as [dilation, dilation]. For default, it will be [1, 1].
name (str|None, optional) – The default value is None. Normally there is no need for user to set this property. For more information, please refer to Name
- Returns
-
The tensor formed by combining a group of sliding local blocks The output shape is [N, Cout, H, W] as decriabled above.
Examples
>>> import paddle >>> import paddle.nn as nn >>> x = paddle.randn([2, 3*2*2, 12]) >>> fold = nn.Fold(output_sizes=[4, 5], kernel_sizes=2) >>> y = fold(x) >>> print(y.shape) [2, 3, 4, 5]
-
forward
(
input: Tensor
)
Tensor
forward?
-
Defines the computation performed at every call. Should be overridden by all subclasses.
- Parameters
-
*inputs (tuple) – unpacked tuple arguments
**kwargs (dict) – unpacked dict arguments
-
extra_repr
(
)
str
extra_repr?
-
Extra representation of this layer, you can have custom implementation of your own layer.