def split_spo(triples):
    """ Splits tensor into subject, predicate and object """
    if len(triples.shape) == 2:
        return triples[:, 0], triples[:, 1], triples[:, 2]
    else:
        return triples[:, :, 0], triples[:, :, 1], triples[:, :, 2]