| 31 | namespace { |
| 32 | |
| 33 | template <typename T> auto LInfNorm(const T &array) -> auto { |
| 34 | using number_t = remove_reference_t<remove_cv_t<decltype(*(array.Data()))>>; |
| 35 | number_t s = 0; |
| 36 | for (const number_t item : array) { |
| 37 | if (isnan(item)) |
| 38 | return numeric_limits<number_t>::quiet_NaN(); |
| 39 | s = abs(item) > s ? abs(item) : s; |
| 40 | } |
| 41 | return s; |
| 42 | } |
| 43 | |
| 44 | bool has_vs_embedding(const ProxyFunction *proxy) { |
| 45 | return proxy->Evaluator()->GetVSEmbedding().has_value(); |