| 160 | } |
| 161 | |
| 162 | void TestClamp() { |
| 163 | Tensor input_tensor(DT_QUINT8, {1, 4, 4, 32}); |
| 164 | auto input = input_tensor.flat<quint8>(); |
| 165 | input = input.random(Eigen::internal::UniformRandomGenerator<quint8>()); |
| 166 | |
| 167 | // Tests that negative outputs are clamped at 0.0, as the output range is |
| 168 | // given to be (0.0, 1.0). |
| 169 | Expect(input_tensor, -10.0f, 10.0f, true, 0.0f, 1.0f); |
| 170 | } |
| 171 | |
| 172 | } // namespace |
| 173 | } // namespace ops |