def __init__(
        self,
        levels,
        channels,
        block=BasicBlock,
        residual_root=False,
        # return_levels=False,
        out_features=None,
        norm="BN",
    ):
        """
        configurable is experimental.

            out_features (list[str]): name of the layers whose outputs should
                be returned in forward. Can be anything in "level0", "level1", "level2", ...
                If None, will return the output of the last layer.
        """
        super(DLA, self).__init__()
        self.channels = channels
        self.base_layer = Conv2d(
            3,
            channels[0],
            kernel_size=7,
            stride=1,
            padding=3,
            bias=norm == "",
            norm=get_norm(norm, channels[0]),
            activation=F.relu_
        )
        self.level0 = self._make_conv_level(channels[0], channels[0], levels[0], norm=norm)
        self.level1 = self._make_conv_level(channels[0], channels[1], levels[1], stride=2, norm=norm)
        self.level2 = Tree(
            levels[2], block, channels[1], channels[2], 2, level_root=False, root_residual=residual_root, norm=norm
        )
        self.level3 = Tree(
            levels[3], block, channels[2], channels[3], 2, level_root=True, root_residual=residual_root, norm=norm
        )
        self.level4 = Tree(
            levels[4], block, channels[3], channels[4], 2, level_root=True, root_residual=residual_root, norm=norm
        )
        self.level5 = Tree(
            levels[5], block, channels[4], channels[5], 2, level_root=True, root_residual=residual_root, norm=norm
        )

        for m in self.modules():
            if isinstance(m, nn.Conv2d):
                weight_init.c2_msra_fill(m)

        if out_features is None:
            out_features = ['level5']
        self._out_features = out_features
        assert len(self._out_features)
        children = [x[0] for x in self.named_children()]
        for out_feature in self._out_features:
            assert out_feature in children, "Available children: {}".format(", ".join(children))

        out_feature_channels, out_feature_strides = {}, {}
        for lvl in range(6):
            name = f"level{lvl}"
            out_feature_channels[name] = channels[lvl]
            out_feature_strides[name] = 2**lvl

        self._out_feature_channels = {name: out_feature_channels[name] for name in self._out_features}
        self._out_feature_strides = {name: out_feature_strides[name] for name in self._out_features}

        configurable is experimental.

            out_features (list[str]): name of the layers whose outputs should
                be returned in forward. Can be anything in "level0", "level1", "level2", ...
                If None, will return the output of the last layer.
        
tridet/modeling/feature_extractor/dla.py