[Mosaic] Fix assert

PiperOrigin-RevId: 560756391
This commit is contained in:
Tomás Longeri 2023-08-28 10:46:34 -07:00 committed by jax authors
parent 70206ee6cd
commit c3e624ad8a

View File

@ -184,7 +184,8 @@ class VectorLayout:
# Tiling should neatly divide the target shape, so that every vector
# register ends up having the same structure.
# Also, every tile should occupy a fixed number of sublanes.
assert self.tiling[0] * self.tiling[1] % self.packing * TARGET_SHAPE[1] == 0
assert ((self.tiling[0] * self.tiling[1]) % (self.packing * TARGET_SHAPE[1])
== 0)
# Offsets should not exceed the tile size. The data always starts within the
# first tile of a vreg.
assert all(0 <= (o or 0) < t for o, t in zip(self.offsets, self.tiling))