meddlr.modeling.layers.get_layer_type#
- meddlr.modeling.layers.get_layer_type(name: str, dimension: Optional[int] = None) type[source]#
Returns the layer type based on the name and, in some cases, the dimension.
This function searches both the default PyTorch layers and the custom layers registered in
CUSTOM_LAYERS_REGISTRY.- Parameters
name (str) – Name of the layer.
dimension (int, optional) – Dimension of the layer. Note, not all layers require this argument (e.g. ReLU), but it may be safe to pass it regardless.
- Returns
Layer type.
- Return type
type
- Raises
ValueError – If the layer type is not found with the name/dimension pair.