MCPcopy Create free account
hub / github.com/OpenGVLab/UniFormerV2 / __init__

Method __init__

slowfast/visualization/utils.py:163–176  ·  view source on GitHub ↗

Args: model (nn.Module): the model containing layers to obtain weights and activations from. layers (list of strings): a list of layer names to obtain weights and activations from. Names are hierarchical, separated by /. For example, If a layer follow

(self, model, layers)

Source from the content-addressed store, hash-verified

161 """
162
163 def __init__(self, model, layers):
164 """
165 Args:
166 model (nn.Module): the model containing layers to obtain weights and activations from.
167 layers (list of strings): a list of layer names to obtain weights and activations from.
168 Names are hierarchical, separated by /. For example, If a layer follow a path
169 "s1" ---> "pathway0_stem" ---> "conv", the layer path is "s1/pathway0_stem/conv".
170 """
171 self.model = model
172 self.hooks = {}
173 self.layers_names = layers
174 # eval mode
175 self.model.eval()
176 self._register_hooks()
177
178 def _get_layer(self, layer_name):
179 """

Callers

nothing calls this directly

Calls 1

_register_hooksMethod · 0.95

Tested by

no test coverage detected