(self, hidden_states, device, tiled=False, tile_size=(34, 34), tile_stride=(18, 16))
| 804 | |
| 805 | |
| 806 | def decode(self, hidden_states, device, tiled=False, tile_size=(34, 34), tile_stride=(18, 16)): |
| 807 | hidden_states = [hidden_state.to("cpu") for hidden_state in hidden_states] |
| 808 | videos = [] |
| 809 | for hidden_state in hidden_states: |
| 810 | hidden_state = hidden_state.unsqueeze(0) |
| 811 | if tiled: |
| 812 | video = self.tiled_decode(hidden_state, device, tile_size, tile_stride) |
| 813 | else: |
| 814 | video = self.single_decode(hidden_state, device) |
| 815 | video = video.squeeze(0) |
| 816 | videos.append(video) |
| 817 | videos = torch.stack(videos) |
| 818 | return videos |
| 819 | |
| 820 | def clear_cache(self): |
| 821 | self.model.clear_cache() |
nothing calls this directly
no test coverage detected