(self, *inputs, **kwargs)
| 97 | self.encoder_cuda_graph_created = True |
| 98 | |
| 99 | def encode(self, *inputs, **kwargs): |
| 100 | if self.enable_cuda_graph: |
| 101 | if self.encoder_cuda_graph_created: |
| 102 | outputs = self._graph_replay_encoder(*inputs, **kwargs) |
| 103 | else: |
| 104 | self._create_cuda_graph_encoder(*inputs, **kwargs) |
| 105 | outputs = self._graph_replay_encoder(*inputs, **kwargs) |
| 106 | return outputs |
| 107 | else: |
| 108 | return self._encode(*inputs, **kwargs) |
| 109 | |
| 110 | def _graph_replay(self, *inputs, **kwargs): |
| 111 | for i in range(len(inputs)): |