(
        self, in_channels_list, out_channels, conv_block, top_blocks=None
    )
Arguments:
            in_channels_list (list[int]): number of channels for each feature map that
                will be fed
            out_channels (int): number of channels of the FPN representation
            top_blocks (nn.Module or None): if provided, an extra operation will
                be performed on the output of the last (smallest resolution)
                FPN output, and the result will extend the result list
Arguments:
            in_channels_list (list[int]): number of channels for each feature map that
                will be fed
            out_channels (int): number of channels of the FPN representation
            top_blocks (nn.Module or None): if provided, an extra operation will
                be performed on the output of the last (smallest resolution)
                FPN output, and the result will extend the result list
Arguments : in_channels_list ( list [ int ] ) : number of channels for each feature map that will be fed out_channels ( int ) : number of channels of the FPN representation top_blocks ( nn . Module or None ) : if provided an extra operation will be performed on the output of the last ( smallest resolution ) FPN output and the result will extend the result list
def __init__(
        self, in_channels_list, out_channels, conv_block, top_blocks=None
    ):
        """
        Arguments:
            in_channels_list (list[int]): number of channels for each feature map that
                will be fed
            out_channels (int): number of channels of the FPN representation
            top_blocks (nn.Module or None): if provided, an extra operation will
                be performed on the output of the last (smallest resolution)
                FPN output, and the result will extend the result list
        """
        super(FPN, self).__init__()
        self.inner_blocks = []
        self.layer_blocks = []
        for idx, in_channels in enumerate(in_channels_list, 1):
            inner_block = "fpn_inner{}".format(idx)
            layer_block = "fpn_layer{}".format(idx)

            if in_channels == 0:
                continue
            inner_block_module = conv_block(in_channels, out_channels, 1)
            layer_block_module = conv_block(out_channels, out_channels, 3, 1)
            self.add_module(inner_block, inner_block_module)
            self.add_module(layer_block, layer_block_module)
            self.inner_blocks.append(inner_block)
            self.layer_blocks.append(layer_block)
        self.top_blocks = top_blocks
def __init__ ( self , in_channels_list , out_channels , conv_block , top_blocks = None ) : super ( FPN , self ) . __init__ ( ) self . inner_blocks = [ ] self . layer_blocks = [ ] for idx , in_channels in enumerate ( in_channels_list , 1 ) : inner_block = "fpn_inner{}" . format ( idx ) layer_block = "fpn_layer{}" . format ( idx ) if in_channels == 0 : continue inner_block_module = conv_block ( in_channels , out_channels , 1 ) layer_block_module = conv_block ( out_channels , out_channels , 3 , 1 ) self . add_module ( inner_block , inner_block_module ) self . add_module ( layer_block , layer_block_module ) self . inner_blocks . append ( inner_block ) self . layer_blocks . append ( layer_block ) self . top_blocks = top_blocks