def prepare(self):
        self.lengths = [self.captions_len[i,-1] for i in xrange(self.captions_len.shape[0])]
        self.len_unique = np.unique(self.lengths)
        if self.minlen != None and self.maxlen != None:
            self.len_unique = [ll for ll in self.len_unique if ll >= self.minlen and self.maxlen < ll]
        else:
            self.len_unique = [ll for ll in self.len_unique]

        self.len2cap = dict()

        for ll in self.len_unique:
            self.len2cap[ll] = np.where(self.lengths == ll)[0]
dataset/ETHPy150Open emansim/text2image/coco/homogeneous-data.py/HomogeneousData.prepare/swapped operands of `<`