Skip to content
fn

weights_for

→type[WeightsEnum] or None
weights_for(model_name: str)

Return the WeightsEnum registered for model_name.

Parameters

model_namestr
Factory name, e.g. "resnet_18" — the same string passed to register_weights at module import time.

Returns

type[WeightsEnum] or None

The registered enum class, or None when the model has no pretrained weights declared yet.

Examples

>>> import lucid.models              # registers the zoo's weights enums
>>> import lucid.weights as W
>>> W.weights_for("resnet_18_cls")
<enum 'ResNet18Weights'>

Used by 1