• Y
    Merge pull request #23047 from fengyuentau:layer_norm · 4d918ba4
    Yuantao Feng 提交于
    dnn: add layer normalization for vision transformers
    
    * add layer norm onnx parser, impl and tests
    
    * add onnx graph simplifier for layer norm expanded
    
    * handle the case when constants are of type Initializer
    
    * add test case for layer norm expanded with initializers
    
    * use CV_Assert & CV_CheckType in place of CV_Assert_N; use forward_fallback for OCL_FP16
    
    * use const ref / ref in parameters of invoker::run; extract inner const if from nested loop; use size_t in place of ull
    
    * template hasBias
    
    * remove trailing whitespace
    
    * use pointer parameter with null check; move normSize division & mean_square division outside of loop; use std::max to ensure positive value before std::sqrt
    
    * refactor implementation, optimize parallel_for
    
    * disable layer norm expanded
    
    * remove the removal of layer norm optional outputs
    4d918ba4
onnx_graph_simplifier.cpp 38.4 KB