def extract_tensors(tf_graph):
    """
    Get input, initial state, final state, and probabilities tensor from the graph
    :param loaded_graph: TensorFlow graph loaded from file
    :return: Tuple (tensor_input,tensor_initial_state,tensor_final_state, tensor_probs)
    """
    tensor_input = tf_graph.get_tensor_by_name("Input/input:0")
    tensor_initial_state = tf_graph.get_tensor_by_name("Network/initial_state:0")
    tensor_final_state = tf_graph.get_tensor_by_name("Network/final_state:0")
    tensor_probs = tf_graph.get_tensor_by_name("Network/probs:0")
    return tensor_input, tensor_initial_state, tensor_final_state, tensor_probs