forked from pierotofy/OpenSplat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rasterize_gaussians.hpp
36 lines (31 loc) · 1.18 KB
/
rasterize_gaussians.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef RASTERIZE_GAUSSIANS_H
#define RASTERIZE_GAUSSIANS_H
#include <torch/torch.h>
#include "tile_bounds.hpp"
using namespace torch::autograd;
std::tuple<torch::Tensor,
torch::Tensor,
torch::Tensor,
torch::Tensor,
torch::Tensor> binAndSortGaussians(int numPoints, int numIntersects,
torch::Tensor xys,
torch::Tensor depths,
torch::Tensor radii,
torch::Tensor cumTilesHit,
TileBounds tileBounds);
class RasterizeGaussians : public Function<RasterizeGaussians>{
public:
static torch::Tensor forward(AutogradContext *ctx,
torch::Tensor xys,
torch::Tensor depths,
torch::Tensor radii,
torch::Tensor conics,
torch::Tensor numTilesHit,
torch::Tensor colors,
torch::Tensor opacity,
int imgHeight,
int imgWidth,
torch::Tensor background);
static tensor_list backward(AutogradContext *ctx, tensor_list grad_outputs);
};
#endif