import torch


def normalized_state_to_tensor(state, building):
    """
    Transforms a state dict to a pytorch tensor.
    The function ensures the correct ordering of the elements according to the list building.global_state_variables.

    It expects a **normalized** state as input.
    """
    ten = [[ state[sval] for sval in building.global_state_variables ]]
    return torch.tensor(ten)