'Create a tensor the right size for histogram data, with memory allocated
in the contiguous histogram buffer. Track it by tag for later reference.'

def _hist_tensor(self, tag):

    assert (self.hist_idx < self.hist_max)
    self.hist_map[tag] = self.hist_idx
    hist_buf = self.hist_buf[self.hist_idx]
    self.hist_idx += 1
    return hist_buf
