(split, classes_per_split)
return range(offset, offset + num_classes)
Gets the sequence of class labels for a split.

  Class id's are returned ordered and without gaps.

  Args:
    split: A Split, the split for which to get classes.
    classes_per_split: Matches each Split to the number of its classes.

  Returns:
    The sequence of classes for the split.

  Raises:
    ValueError: An invalid split was specified.
Gets the sequence of class labels for a split.
Gets the sequence of class labels for a split .
def get_classes(split, classes_per_split):
  """Gets the sequence of class labels for a split.

  Class id's are returned ordered and without gaps.

  Args:
    split: A Split, the split for which to get classes.
    classes_per_split: Matches each Split to the number of its classes.

  Returns:
    The sequence of classes for the split.

  Raises:
    ValueError: An invalid split was specified.
  """
  num_classes = classes_per_split[split]

  # Find the starting index of classes for the given split.
  if split == learning_spec.Split.TRAIN:
    offset = 0
  elif split == learning_spec.Split.VALID:
    offset = classes_per_split[learning_spec.Split.TRAIN]
  elif split == learning_spec.Split.TEST:
    offset = (
        classes_per_split[learning_spec.Split.TRAIN] +
        classes_per_split[learning_spec.Split.VALID])
  else:
    raise ValueError('Invalid dataset split.')

  # Get a contiguous range of classes from split.
  return range(offset, offset + num_classes)
def get_classes ( split , classes_per_split ) : num_classes = classes_per_split [ split ] # Find the starting index of classes for the given split. if split == learning_spec . Split . TRAIN : offset = 0 elif split == learning_spec . Split . VALID : offset = classes_per_split [ learning_spec . Split . TRAIN ] elif split == learning_spec . Split . TEST : offset = ( classes_per_split [ learning_spec . Split . TRAIN ] + classes_per_split [ learning_spec . Split . VALID ] ) else : raise ValueError ( 'Invalid dataset split.' ) # Get a contiguous range of classes from split. return range ( offset , offset + num_classes )