Skip to content

Commit b5e13a9

Browse files
committed
Fix assertion of pairwise potential shape, thx @Pandoro.
1 parent c15c0e5 commit b5e13a9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pydensecrf/densecrf.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ cdef class DenseCRF:
6969
del self._this
7070

7171
def addPairwiseEnergy(self, float[:,::1] features not None, compat, KernelType kernel=DIAG_KERNEL, NormalizationType normalization=NORMALIZE_SYMMETRIC):
72-
if features.shape[0] != self._nlabel or features.shape[1] != self._nvar:
73-
raise ValueError("Bad shape for pairwise energy (Need {}, got {})".format((self._nlabel, self._nvar), (features.shape[0], features.shape[1])))
72+
if features.shape[1] != self._nvar:
73+
raise ValueError("Bad shape for pairwise energy (Need (?, {}), got {})".format(self._nvar, (features.shape[0], features.shape[1])))
7474

7575
self._this.addPairwiseEnergy(eigen.c_matrixXf(features), _labelcomp(compat), kernel, normalization)
7676

0 commit comments

Comments
 (0)