()
| 78 | |
| 79 | |
| 80 | def _inputs() -> StatelessForwardInputs: |
| 81 | input_ids = torch.tensor( |
| 82 | [ |
| 83 | [0, 1, 2, 3, 0], |
| 84 | [0, 2, 1, 4, 5], |
| 85 | ], |
| 86 | dtype=torch.long, |
| 87 | ) |
| 88 | attention_mask = torch.tensor( |
| 89 | [ |
| 90 | [1, 1, 1, 1, 0], |
| 91 | [1, 1, 1, 1, 1], |
| 92 | ], |
| 93 | dtype=torch.bool, |
| 94 | ) |
| 95 | completion_mask = torch.tensor( |
| 96 | [ |
| 97 | [False, False, True, True, False], |
| 98 | [False, False, True, True, True], |
| 99 | ] |
| 100 | ) |
| 101 | return StatelessForwardInputs( |
| 102 | input_ids=input_ids, |
| 103 | attention_mask=attention_mask, |
| 104 | completion_mask=completion_mask, |
| 105 | ) |
| 106 | |
| 107 | |
| 108 | def _logits_for(inputs: StatelessForwardInputs, vocab_size: int = 8) -> torch.Tensor: |
no test coverage detected