def activation_value_hook(name, activation_register):
    """Create a torch hook that updates a register with the values of the layer's activations 

    :param name: layer name
    :type name: string
    :param activation_register: register storing the activation
    :type activation_register: dictionary
    """
    def hook(model, input, output):
        activation_register[name] = output.data
    return hook