(self, inputs, **kwargs)
| 64 | return f"FreqEncoder: input_dim={self.input_dim} degree={self.degree} output_dim={self.output_dim}" |
| 65 | |
| 66 | def forward(self, inputs, **kwargs): |
| 67 | # inputs: [..., input_dim] |
| 68 | # return: [..., ] |
| 69 | |
| 70 | prefix_shape = list(inputs.shape[:-1]) |
| 71 | inputs = inputs.reshape(-1, self.input_dim) |
| 72 | |
| 73 | outputs = freq_encode(inputs, self.degree, self.output_dim) |
| 74 | |
| 75 | outputs = outputs.reshape(prefix_shape + [self.output_dim]) |
| 76 | |
| 77 | return outputs |
nothing calls this directly
no outgoing calls
no test coverage detected