Does anyone know of a way to generate a \'segment label\' for a Tensor, given a unique value that represents segment boundaries within the Tensor?
For example, given