this function is an example to use the lambda transform here we use lambda transform to normalize data from 0~255 to 0~1
| 30 | // this function is an example to use the lambda transform |
| 31 | // here we use lambda transform to normalize data from 0~255 to 0~1 |
| 32 | static Example func(Example example) { |
| 33 | // an easier way to do this |
| 34 | auto cast = _Cast(example.first[0], halide_type_of<float>()); |
| 35 | return {{_Multiply(cast, _Const(1.0f / 255.0f)), example.first[1]}, {example.second}}; |
| 36 | } |
| 37 | |
| 38 | virtual int run(int argc, const char* argv[]) override { |
| 39 | if (argc != 2) { |
no test coverage detected