def to_inferlo_factor(self) -> DiscreteFactor:
    'Converts LDFactor to inferlo.DiscreteFactor.'
    sizes = [self.model.get_variable(i).domain.size() for i in self.var_idx[::(- 1)]]
    libdai_tensor = self.p.p.reshape(sizes)
    rev_perm = list(range(len(self.var_idx)))[::(- 1)]
    inferlo_tensor = libdai_tensor.transpose(rev_perm)
    return DiscreteFactor(self.model, self.var_idx, inferlo_tensor)
Converts LDFactor to inferlo.DiscreteFactor.
def to_inferlo_factor(self) -> DiscreteFactor:
    
    sizes = [self.model.get_variable(i).domain.size() for i in self.var_idx[::(- 1)]]
    libdai_tensor = self.p.p.reshape(sizes)
    rev_perm = list(range(len(self.var_idx)))[::(- 1)]
    inferlo_tensor = libdai_tensor.transpose(rev_perm)
    return DiscreteFactor(self.model, self.var_idx, inferlo_tensor)