Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion hackable_diffusion/lib/corruption/discrete.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ class CategoricalProcess(CorruptionProcess):
"""

schedule: DiscreteSchedule
invariant_probs: Sequence[float]
invariant_probs: Sequence[float] = dataclasses.field(repr=False)
num_categories: int
unused_token: int = UNUSED_TOKEN
post_corruption_fn: PostCorruptionFn = IdentityPostCorruptionFn()
Expand Down
8 changes: 8 additions & 0 deletions hackable_diffusion/lib/corruption/discrete_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,14 @@ def test_unused_mask_gives_always_false_on_other_masks(self, process_type):
self.assertFalse(is_corrupted_mask[1])
self.assertFalse(is_corrupted_mask[3])

def test_repr_does_not_include_invariant_probs(self):
process = discrete.CategoricalProcess.uniform_process(
schedule=self.schedule, num_categories=self.num_categories
)
process_repr = repr(process)
self.assertNotIn('invariant_probs', process_repr)
self.assertIn('num_categories', process_repr)


if __name__ == '__main__':
absltest.main()
Loading