MCPcopy Create free account
hub / github.com/alibaba/MNN / func

Method func

tools/train/source/demo/dataLoaderTest.cpp:32–36  ·  view source on GitHub ↗

this function is an example to use the lambda transform here we use lambda transform to normalize data from 0~255 to 0~1

Source from the content-addressed store, hash-verified

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) {

Callers 14

ConvertTfAttributeMethod · 0.45
stbiw__writefvFunction · 0.45
stbiw__putcFunction · 0.45
stbiw__write3Function · 0.45
stbiw__write_pixelFunction · 0.45
stbiw__write_pixelsFunction · 0.45
stbi_write_tga_coreFunction · 0.45
stbiw__write_run_dataFunction · 0.45
stbiw__write_dump_dataFunction · 0.45

Calls 3

_MultiplyFunction · 0.85
_ConstFunction · 0.85
_CastFunction · 0.50

Tested by

no test coverage detected