Skip to content

Commit

Permalink
support non-square grids (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
w-m committed May 8, 2024
1 parent ee2d150 commit 37d2b9a
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions plas.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,12 +511,9 @@ def sort_with_plas(
grid_shape = params.shape[1:]
H, W = grid_shape

# not implemented for non-square aspect ratios
assert H == W

start_time = time.time()

radius_f = max(H, W) / 2 - 1
radius_f = min(H, W) / 2 - 1
radii = list(radius_seq(max_radius=radius_f, min_radius=min_blur_radius, radius_update=0.95))

if verbose:
Expand Down Expand Up @@ -560,7 +557,7 @@ def sort_with_plas(

if verbose:
print(
f"\nSorted {params.shape[2]}x{params.shape[2]}={params.shape[1] * params.shape[2]} Gaussians @ {params.shape[0]} dimensions with PLAS in {duration:.3f} seconds \n with {total_num_reorders} reorders at a rate of {total_num_reorders / duration:.3f} reorders per second"
f"\nSorted {params.shape[2]}x{params.shape[1]}={params.shape[1] * params.shape[2]} vectors @ {params.shape[0]} dimensions with PLAS in {duration:.3f} seconds \n with {total_num_reorders} reorders at a rate of {total_num_reorders / duration:.3f} reorders per second"
)

return params, grid_indices

0 comments on commit 37d2b9a

Please sign in to comment.