(self)
| 126 | return self |
| 127 | |
| 128 | def get_example_inputs(self): |
| 129 | # Input shape: (batch, num_heads, seq_len, head_dim) |
| 130 | batch_size = 2 |
| 131 | num_heads = 8 |
| 132 | seq_len = 128 |
| 133 | head_dim = 64 |
| 134 | query = torch.randn( |
| 135 | batch_size, num_heads, seq_len, head_dim, dtype=torch.bfloat16 |
| 136 | ) |
| 137 | key = torch.randn( |
| 138 | batch_size, num_heads, seq_len, head_dim, dtype=torch.bfloat16 |
| 139 | ) |
| 140 | value = torch.randn( |
| 141 | batch_size, num_heads, seq_len, head_dim, dtype=torch.bfloat16 |
| 142 | ) |
| 143 | return (query, key, value) |
no outgoing calls