Helper to check if values are in expected range
| 114 | |
| 115 | // Helper to check if values are in expected range |
| 116 | bool check_range(const Tensor& tensor, float min, float max) { |
| 117 | auto values = tensor.to_vector(); |
| 118 | for (float val : values) { |
| 119 | if (val < min || val > max) { |
| 120 | return false; |
| 121 | } |
| 122 | } |
| 123 | return true; |
| 124 | } |
| 125 | |
| 126 | // Helper to compute mean and std |
| 127 | std::pair<float, float> compute_stats(const Tensor& tensor) { |