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

Method __init__

python/singa/layer.py:1011–1030  ·  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

1009 """
1010
1011 def __init__(self, kernel_size, stride=None, padding=0, pad_mode="NOTSET"):
1012 """
1013 Args:
1014 kernel_size (int or tuple): kernel size for two direction of each
1015 axis. For example, (2, 3), the first 2 means will add 2 at the
1016 beginning and also 2 at the end for its axis.and if a int is
1017 accepted, the kernel size will be initiated as (int, int)
1018 stride (int or tuple): stride, the logic is the same as kernel size.
1019 padding (int): tuple, list or None, padding, the logic is the same
1020 as kernel size. However, if you set pad_mode as "SAME_UPPER" or
1021 "SAME_LOWER" mode, you can set padding as None, and the padding
1022 will be computed automatically.
1023 pad_mode (string): can be NOTSET, SAME_UPPER, or SAME_LOWER, where
1024 default value is NOTSET, which means explicit padding is used.
1025 SAME_UPPER or SAME_LOWER mean pad the input so that the output
1026 spatial size match the input. In case of odd number add the extra
1027 padding at the end for SAME_UPPER and at the beginning for SAME_LOWER.
1028 """
1029 super(MaxPool2d, self).__init__(kernel_size, stride, padding, True,
1030 pad_mode)
1031
1032
1033class AvgPool2d(Pooling2d):

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected