MCPcopy Create free account
hub / github.com/apache/singa / __init__

Method __init__

python/singa/layer.py:1035–1054  ·  view source on GitHub ↗

Args: kernel_size (int or tuple): kernel size for two direction of each axis. For example, (2, 3), the first 2 means will add 2 at the beginning and also 2 at the end for its axis.and if a int is accepted, the kernel size will be i

(self, kernel_size, stride=None, padding=0, pad_mode="NOTSET")

Source from the content-addressed store, hash-verified

1033class AvgPool2d(Pooling2d):
1034
1035 def __init__(self, kernel_size, stride=None, padding=0, pad_mode="NOTSET"):
1036 """
1037 Args:
1038 kernel_size (int or tuple): kernel size for two direction of each
1039 axis. For example, (2, 3), the first 2 means will add 2 at the
1040 beginning and also 2 at the end for its axis.and if a int is
1041 accepted, the kernel size will be initiated as (int, int)
1042 stride (int or tuple): stride, the logic is the same as kernel size.
1043 padding (int): tuple, list or None, padding, the logic is the same
1044 as kernel size. However, if you set pad_mode as "SAME_UPPER" or
1045 "SAME_LOWER" mode, you can set padding as None, and the padding
1046 will be computed automatically.
1047 pad_mode (string): can be NOTSET, SAME_UPPER, or SAME_LOWER, where
1048 default value is NOTSET, which means explicit padding is used.
1049 SAME_UPPER or SAME_LOWER mean pad the input so that the output
1050 spatial size match the input. In case of odd number add the extra
1051 padding at the end for SAME_UPPER and at the beginning for SAME_LOWER.
1052 """
1053 super(AvgPool2d, self).__init__(kernel_size, stride, padding, False,
1054 pad_mode)
1055
1056
1057class MaxPool1d(Pooling2d):

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected