| 242 | assert render_mode in ["RGB", "D", "ED", "RGB+D", "RGB+ED"], render_mode |
| 243 | |
| 244 | def reshape_view(C: int, world_view: torch.Tensor, N_world: list) -> torch.Tensor: |
| 245 | view_list = list( |
| 246 | map( |
| 247 | lambda x: x.split(int(x.shape[0] / C), dim=0), |
| 248 | world_view.split([C * N_i for N_i in N_world], dim=0), |
| 249 | ) |
| 250 | ) |
| 251 | return torch.stack([torch.cat(l, dim=0) for l in zip(*view_list)], dim=0) |
| 252 | |
| 253 | if sh_degree is None: |
| 254 | # treat colors as post-activation values, should be in shape [N, D] or [C, N, D] |