Save RFF state to buffer

This commit is contained in:
Matt Tancik committed 2022-06-02 09:44:50 -07:00
1 parent 7791e5efe2
commit 266b470b83
1 file changed
+1
+1
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