4
0
mirror of https://github.com/nerfstudio-project/nerfstudio.git synced 2026-11-11 10:34:29 +08:00

Save RFF state to buffer

This commit is contained in:
Matt Tancik 2022-06-02 09:44:50 -07:00
parent 7791e5efe2
commit 266b470b83

View File

@ -139,6 +139,7 @@ class RFFEncoding(Encoding):
raise ValueError("RFF encoding scale should be greater than zero")
self.scale = scale
self.b_matrix = torch.normal(mean=0, std=self.scale, size=(self.in_dim, self.num_frequencies))
self.register_buffer(name="rff_scalings", tensor=self.b_matrix)
def get_out_dim(self) -> int:
return self.num_frequencies * 2