detrium.nn.backbones.utils

https://github.com/pytorch/vision/blob/main/torchvision/models/_utils.py Copyright(c) 2023 lyuwenyu. All Rights Reserved.

class IntermediateLayerGetter(nn.ModuleDict)

Module wrapper that returns intermediate layers from a model It has a strong assumption that the modules have been registered into the model in the same order as they are used. This means that one should **not** reuse the same nn.Module twice in the forward if you want this to work. Additionally, it is only able to query submodules that are directly assigned to the model. So if `model` is passed, `model.feature1` can be returned, but not `model.feature1.layer2`.

名称类型默认值
modelnn.Module—
return_layersList[str]—