'Allocates the host and device input data buffers
and any other associated storage.
`self.inpbuf` is the on-device buffer for the input minibatch
`self.mini_batch_in` is the on-host buffer for the input minibatch
`self.mean` is the on-device buffer of the mean array'

def allocate_inputs(self):

    self.inpbuf = self.be.iobuf(self.inp.shape[1])
    self.mini_batch_in = np.zeros(self.inpbuf.shape)
    self.mean = None
    if ('mean' in self.hdf_file):
        mns_ = np.array(self.hdf_file['mean']).flatten()
        if (mns_.size != self.inp.shape[1]):
            assert (mns_.size == self.lshape[0]), 'mean    image    size    mismatch'
            mns_ = mns_.reshape((self.lshape[0], 1)).copy()
            self.meansub_view = self.inpbuf.reshape((self.lshape[0], (-1)))
        else:
            self.meansub_view = self.inpbuf
        self.mean = self.be.array(mns_)
