in src/speech_reps/featurize.py [0:0]
def __init__(self, params_file, gpu):
super().__init__()
from .models.decoar2 import DeCoAR2
self._model = DeCoAR2()
models = torch.load(params_file)['model']
component_state_dict = OrderedDict()
for key in models.keys():
component_state_dict[key] = models[key]
self._model.load_state_dict(component_state_dict, strict=False)
self._ctx = gpu
if self._ctx is not None:
self._model = self._model.cuda(self._ctx)