You would need to create a model object first and load the state_dict afterwards:
model = MyModel()
model.load_state_dict(encoder_state_dict)

where MyModel is defined in your code somewhere as a custom nn.Module class.