(self, restricted_classes_per_split=None)
Initializes a DatasetSpecification.

    Args:
      restricted_classes_per_split: A dict that specifies for each split, a
        number to restrict its classes to. This number must be no greater than
        the total number of classes of that split. By default this is None and
        no restrictions are applied (all classes are used).

    Raises:
      ValueError: Invalid file_pattern provided.
Initializes a DatasetSpecification.
Initializes a DatasetSpecification .
def initialize(self, restricted_classes_per_split=None):
    """Initializes a DatasetSpecification.

    Args:
      restricted_classes_per_split: A dict that specifies for each split, a
        number to restrict its classes to. This number must be no greater than
        the total number of classes of that split. By default this is None and
        no restrictions are applied (all classes are used).

    Raises:
      ValueError: Invalid file_pattern provided.
    """
    # Check that the file_pattern adheres to one of the allowable forms
    if self.file_pattern not in ['{}.tfrecords', '{}_{}.tfrecords']:
      raise ValueError('file_pattern must be either "{}.tfrecords" or '
                       '"{}_{}.tfrecords" to support shards or splits.')
    if restricted_classes_per_split is not None:
      _check_validity_of_restricted_classes_per_split(
          restricted_classes_per_split, self.classes_per_split)
      # Apply the restriction.
      for split, restricted_num_classes in restricted_classes_per_split.items():
        self.classes_per_split[split] = restricted_num_classes
def initialize ( self , restricted_classes_per_split = None ) : # Check that the file_pattern adheres to one of the allowable forms if self . file_pattern not in [ '{}.tfrecords' , '{}_{}.tfrecords' ] : raise ValueError ( 'file_pattern must be either "{}.tfrecords" or ' '"{}_{}.tfrecords" to support shards or splits.' ) if restricted_classes_per_split is not None : _check_validity_of_restricted_classes_per_split ( restricted_classes_per_split , self . classes_per_split ) # Apply the restriction. for split , restricted_num_classes in restricted_classes_per_split . items ( ) : self . classes_per_split [ split ] = restricted_num_classes