From 5cb020699b6bb06ddfff54978fe2911942f592c4 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Thu, 16 Mar 2017 11:39:09 +0100 Subject: [PATCH] Undirected crf graph: Use integer for size With python3 the binary operator `/` means floating point division. This commit switches the operator to `//`, which means integer division in python2 as well as python3. --- pystruct/models/graph_crf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pystruct/models/graph_crf.py b/pystruct/models/graph_crf.py index 81860e90..84ebeb81 100644 --- a/pystruct/models/graph_crf.py +++ b/pystruct/models/graph_crf.py @@ -101,7 +101,7 @@ def _set_size_joint_feature(self): else: self.size_joint_feature = ( self.n_states * self.n_features - + self.n_states * (self.n_states + 1) / 2) + + self.n_states * (self.n_states + 1) // 2) def _get_edges(self, x): return x[1]