(self, x, smooth_scale = 0.6)
| 1012 | return x |
| 1013 | |
| 1014 | def mix(self, x, smooth_scale = 0.6): |
| 1015 | remain_scale = smooth_scale |
| 1016 | mix_scale = 1. - remain_scale |
| 1017 | front = slice(self.frame_len - 1, x.size(1) - 1, self.frame_len) |
| 1018 | back = slice(self.frame_len, x.size(1), self.frame_len) |
| 1019 | x[:, front], x[:, back] = ( |
| 1020 | x[:, front] * remain_scale + x[:, back] * mix_scale, |
| 1021 | x[:, back] * remain_scale + x[:, front] * mix_scale |
| 1022 | ) |
| 1023 | return x |
| 1024 | |
| 1025 | def single_decode(self, hidden_states, device): |
| 1026 | chunks = list(hidden_states.split(self.latent_len, dim=1)) |
no outgoing calls
no test coverage detected