(arr: number[])
| 148 | } |
| 149 | |
| 150 | private median(arr: number[]): number | null { |
| 151 | if (arr.length < 3) return null; // need a few samples |
| 152 | const s = [...arr].sort((a, b) => a - b); |
| 153 | const mid = Math.floor(s.length / 2); |
| 154 | return s.length % 2 ? s[mid]! : (s[mid - 1]! + s[mid]!) / 2; |
| 155 | } |
| 156 | |
| 157 | /** |
| 158 | * Returns a warning string if speculative decoding appears to be HURTING |
no outgoing calls
no test coverage detected