-
Notifications
You must be signed in to change notification settings - Fork 87
/
project_gaussians.hpp
53 lines (45 loc) · 1.29 KB
/
project_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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#ifndef PROJECT_GAUSSIANS_H
#define PROJECT_GAUSSIANS_H
#include <torch/torch.h>
#include "tile_bounds.hpp"
#include "gsplat.hpp"
using namespace torch::autograd;
#if defined(USE_HIP) || defined(USE_CUDA) || defined(USE_MPS)
class ProjectGaussians : public Function<ProjectGaussians>{
public:
static variable_list forward(AutogradContext *ctx,
torch::Tensor means,
torch::Tensor scales,
float globScale,
torch::Tensor quats,
torch::Tensor viewMat,
torch::Tensor projMat,
float fx,
float fy,
float cx,
float cy,
int imgHeight,
int imgWidth,
TileBounds tileBounds,
float clipThresh = 0.01);
static tensor_list backward(AutogradContext *ctx, tensor_list grad_outputs);
};
#endif
class ProjectGaussiansCPU{
public:
static variable_list apply(
torch::Tensor means,
torch::Tensor scales,
float globScale,
torch::Tensor quats,
torch::Tensor viewMat,
torch::Tensor projMat,
float fx,
float fy,
float cx,
float cy,
int imgHeight,
int imgWidth,
float clipThresh = 0.01);
};
#endif