| 1974 | } |
| 1975 | |
| 1976 | inline void Tanh(const RuntimeShape& input_shape, const float* input_data, |
| 1977 | const RuntimeShape& output_shape, float* output_data) { |
| 1978 | const int flat_size = MatchingFlatSize(input_shape, output_shape); |
| 1979 | |
| 1980 | for (int i = 0; i < flat_size; i++) { |
| 1981 | float val = input_data[i]; |
| 1982 | float result = std::tanh(val); |
| 1983 | output_data[i] = result; |
| 1984 | } |
| 1985 | } |
| 1986 | |
| 1987 | // Convenience version that allows, for example, generated-code calls to be |
| 1988 | // uniform between data types. |
nothing calls this directly
no test coverage detected