def __init__(self, X, y=None, nclass=None, lshape=None, make_onehot=True, name=None):
        """
        Implements loading of given data into backend tensor objects. If the
        backend is specific to an accelarator device, the data is copied over
        to that device.

        Args:
            X (ndarray, shape: [# examples, feature size]): Input features within the
                dataset.
            y (ndarray, shape:[# examples, 1], optional): Labels corresponding to the
                input features.
                If absent, the input features themselves will be returned as
                target values (AutoEncoder)
            nclass (int, optional): The number of possible types of labels.
                (not necessary if not providing labels)
            lshape (tuple, optional): Local shape for the input features
                (e.g. height, width, channel for images)
            make_onehot (bool, optional): True if y is a label that has to be converted to one hot
                            False if y doesn't need to be converted to one hot
                            (e.g. in a CAE)

        """
        # Treat singletons like list so that iteration follows same syntax
        super(ArrayIterator, self).__init__(name=name)
        X = X if isinstance(X, list) else [X]
        self.ndata = len(X[0])
        assert self.be.bsz >= self.ndata
        self.start = 0
        self.nclass = nclass
        self.ybuf = None

        if make_onehot and nclass is None and y is not None:
            raise AttributeError('Must provide number of classes when creating onehot labels')

        # store shape of the input data
        self.shape = [x.shape[1] if lshape is None else lshape for x in X]
        if len(self.shape) == 1:
            self.shape = self.shape[0]
            self.lshape = lshape

        # Helpers to make dataset, minibatch, unpacking function for transpose and onehot
        def transpose_gen(z):
            return (self.be.array(z), self.be.iobuf(z.shape[1]),
                    lambda _in, _out: self.be.copy_transpose(_in, _out))

        def onehot_gen(z):
            return (self.be.array(z.reshape((-1, 1)), dtype=np.int32), self.be.iobuf(nclass),
                    lambda _in, _out: self.be.onehot(_in, axis=0, out=_out))

        self.Xdev, self.Xbuf, self.unpack_func = zip(*[transpose_gen(x) for x in X])

        # Shallow copies for appending, iterating
        self.dbuf, self.hbuf = list(self.Xdev), list(self.Xbuf)
        self.unpack_func = list(self.unpack_func)

        if y is not None:
            self.ydev, self.ybuf, yfunc = onehot_gen(y) if make_onehot else transpose_gen(y)
            self.dbuf.append(self.ydev)
            self.hbuf.append(self.ybuf)
            self.unpack_func.append(yfunc)
dataset/ETHPy150Open NervanaSystems/neon/neon/data/dataiterator.py/ArrayIterator.__init__/swapped operands of `>=`