def generate_distinct_objects(self, referred_size, referred_color,
                                referred_shape, actual_size, actual_color):
    """Similar to parent's function but generate more disntict for the general case."""
    objects = []
    obligatory_objects = []
    # E.g. distinct from 'circle' -> no other circles;
    # generate some random objects of each other shape.
    if not referred_size and not referred_color:
      all_shapes = self._object_vocabulary.object_shapes
      all_shapes.remove(referred_shape)
      for shape in all_shapes:
        shapes = []
        for _ in range(2):
          shapes.append((self._object_vocabulary.sample_size(),
                         self._object_vocabulary.sample_color(), shape))
        objects.append(shapes)
      return objects, obligatory_objects
    return super().generate_distinct_objects(referred_size, referred_color,
                                             referred_shape, actual_size,
                                             actual_color)
Similar to parent's function but generate more disntict for the general case.
language/gscan/data/dataset.py