'After the input and output (`self.inp` and `self.out)` have been
set this function will allocate the host and device buffers
for the mini-batches.
The host buffer is referenced as `self.mini_batch_in` and `self.mini_batch_out`, and
stored on device as `self.inbuf` and `self.outbuf`.'

def allocate(self):

    if (not self.allocated):
        self.allocate_inputs()
        self.allocate_outputs()
        self.allocated = True
