Initializes prefix merger state. Args: tokens: The initial live sequences, of shape [batch_size, num_decodes, max_decode_len]. When prefilling the decoding cache, this consists of the decoding prefixes padded to `max_decode_len`. Returns:
(self, *, tokens: Tensor)
| 298 | """ |
| 299 | |
| 300 | def init_state(self, *, tokens: Tensor) -> NestedTensor: |
| 301 | """Initializes prefix merger state. |
| 302 | |
| 303 | Args: |
| 304 | tokens: The initial live sequences, of shape [batch_size, num_decodes, max_decode_len]. |
| 305 | When prefilling the decoding cache, this consists of the decoding prefixes padded to |
| 306 | `max_decode_len`. |
| 307 | |
| 308 | Returns: |
| 309 | The initial state. |
| 310 | """ |
| 311 | raise NotImplementedError(type(self)) |
| 312 | |
| 313 | def compute(self, state: NestedTensor) -> Tensor: |
| 314 | """Computes the merge matrix. |
no outgoing calls