def __init__(self, sz:Optional[int]=None):
        "Output will be 2*sz or 2 if sz is None"
        super().__init__()
        self.output_size = sz or 1
        self.ap = nn.AdaptiveAvgPool2d(self.output_size)
        self.mp = nn.AdaptiveMaxPool2d(self.output_size)
def __init__ ( self , sz : Optional [ int ] = None ) : super ( ) . __init__ ( ) self . output_size = sz or 1 self . ap = nn . AdaptiveAvgPool2d ( self . output_size ) self . mp = nn . AdaptiveMaxPool2d ( self . output_size )
Output will be 2*sz or 2 if sz is None