'Create a new minibatch of ticker priority sort task data.
Arguments:
in_tensor: device buffer holding inputs
out_tensor: device buffer holding outputs
mask: device buffer for the output mask'

def synthesize(self, in_tensor, out_tensor, mask):

    seq_len = np.random.randint(1, (self.seq_len_max + 1))
    time_steps = self.time_steps_func(seq_len)
    (inputs, outputs) = super(PrioritySortTask, self).fetch_io(time_steps)
    inputs[(-3), :self.be.bsz] = 1
    seq = np.random.randint(2, size=(self.nin, (seq_len * self.be.bsz))).astype(float)
    seq[(-3):, :] = 0
    priorities = np.random.uniform((-1), 1, size=((seq_len * self.be.bsz),))
    seq[(-1), :] = priorities
    stop_loc = (self.be.bsz * (seq_len + 1))
    inputs[(-2), stop_loc:(stop_loc + self.be.bsz)] = 1
    inputs[:, self.be.bsz:stop_loc] = seq
    for i in range(self.be.bsz):
        x = seq[:, i::self.be.bsz]
        x = x[:, x[(-1), :].argsort()]
        seq[:, i::self.be.bsz] = x
    outputs[:, (self.be.bsz * (seq_len + 2)):] = seq[:self.nout, :]
    super(PrioritySortTask, self).fill_buffers(time_steps, inputs, outputs, in_tensor, out_tensor, mask)
