Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix return types #27

Merged
merged 1 commit into from
Oct 5, 2023
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
12 changes: 7 additions & 5 deletions diff_rast/bin_and_sort_gaussians.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@ class BinAndSortGaussians(Function):
tile_bounds (Tuple): tile dimensions as a len 3 tuple (tiles.x , tiles.y, 1).

Returns:
isect_ids_unsorted (Tensor): unique IDs for each gaussian in the form (tile | depth id).
gaussian_ids_unsorted (Tensor): Tensor that maps isect_ids back to cum_tiles_hit. Useful for identifying gaussians.
isect_ids_sorted (Tensor): sorted unique IDs for each gaussian in the form (tile | depth id).
gaussian_ids_sorted (Tensor): sorted Tensor that maps isect_ids back to cum_tiles_hit. Useful for identifying gaussians.
tile_bins (Tensor): range of gaussians hit per tile.
A tuple of {Tensor, Tensor, Tensor, Tensor, Tensor}:

- **isect_ids_unsorted** (Tensor): unique IDs for each gaussian in the form (tile | depth id).
- **gaussian_ids_unsorted** (Tensor): Tensor that maps isect_ids back to cum_tiles_hit. Useful for identifying gaussians.
- **isect_ids_sorted** (Tensor): sorted unique IDs for each gaussian in the form (tile | depth id).
- **gaussian_ids_sorted** (Tensor): sorted Tensor that maps isect_ids back to cum_tiles_hit. Useful for identifying gaussians.
- **tile_bins** (Tensor): range of gaussians hit per tile.
"""

@staticmethod
Expand Down
6 changes: 4 additions & 2 deletions diff_rast/compute_cumulative_intersects.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ class ComputeCumulativeIntersects(Function):
num_tiles_hit (Tensor): number of intersected tiles per gaussian.

Returns:
num_intersects (int): total number of tile intersections.
cum_tiles_hit (Tensor): a tensor of cumulated intersections (used for sorting).
A tuple of {int, Tensor}:

- **num_intersects** (int): total number of tile intersections.
- **cum_tiles_hit** (Tensor): a tensor of cumulated intersections (used for sorting).
"""

@staticmethod
Expand Down
6 changes: 4 additions & 2 deletions diff_rast/cov2d_bounds.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ class ComputeCov2dBounds(Function):
cov2d (Tensor): input cov2d of size (batch, 3) of upper triangular 2D covariance values

Returns:
conic (Tensor): conic parameters for 2D gaussian.
radii (Tensor): radii of 2D gaussian projections.
A tuple of {Tensor, Tensor}:

- **conic** (Tensor): conic parameters for 2D gaussian.
- **radii** (Tensor): radii of 2D gaussian projections.
"""

@staticmethod
Expand Down
12 changes: 7 additions & 5 deletions diff_rast/get_tile_bin_edges.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ class GetTileBinEdges(Function):

Indexing into tile_bins[tile_idx] returns the range (lower,upper) of gaussian IDs that hit tile_idx.

Args:
num_intersects (int): total number of gaussian intersects.
isect_ids_sorted (Tensor): sorted unique IDs for each gaussian in the form (tile | depth id).
Args:
num_intersects (int): total number of gaussian intersects.
isect_ids_sorted (Tensor): sorted unique IDs for each gaussian in the form (tile | depth id).

Returns:
tile_bins (Tensor): range of gaussians IDs hit per tile.
Returns:
A Tensor:

- **tile_bins** (Tensor): range of gaussians IDs hit per tile.
"""

@staticmethod
Expand Down
6 changes: 4 additions & 2 deletions diff_rast/map_gaussian_to_intersects.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ class MapGaussiansToIntersects(Function):
tile_bounds (Tuple): tile dimensions as a len 3 tuple (tiles.x , tiles.y, 1).

Returns:
isect_ids (Tensor): unique IDs for each gaussian in the form (tile | depth id).
gaussian_ids (Tensor): Tensor that maps isect_ids back to cum_tiles_hit. Useful for identifying gaussians.
A tuple of {Tensor, Tensor}:

- **isect_ids** (Tensor): unique IDs for each gaussian in the form (tile | depth id).
- **gaussian_ids** (Tensor): Tensor that maps isect_ids back to cum_tiles_hit.
"""

@staticmethod
Expand Down
14 changes: 8 additions & 6 deletions diff_rast/project_gaussians.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@ class ProjectGaussians(Function):
tile_bounds (Tuple): tile dimensions as a len 3 tuple (tiles.x , tiles.y, 1).

Returns:
xys (Tensor): x,y locations of 2D gaussian projections.
depths (Tensor): z depth of gaussians.
radii (Tensor): radii of 2D gaussian projections.
conics (Tensor): conic parameters for 2D gaussian.
num_tiles_hit (int): number of tiles hit.
cov3d (Tensor): 3D covariances.
A tuple of {Tensor, Tensor, Tensor, Tensor, int, Tensor}:

- **xys** (Tensor): x,y locations of 2D gaussian projections.
- **depths** (Tensor): z depth of gaussians.
- **radii** (Tensor): radii of 2D gaussian projections.
- **conics** (Tensor): conic parameters for 2D gaussian.
- **num_tiles_hit** (int): number of tiles hit.
- **cov3d** (Tensor): 3D covariances.
"""

@staticmethod
Expand Down
4 changes: 3 additions & 1 deletion diff_rast/rasterize.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ class RasterizeGaussians(Function):
background (Tensor): background color

Returns:
out_img (Tensor): the rendered output image.
A Tensor:

- **out_img** (Tensor): the rendered output image.
"""

@staticmethod
Expand Down