mirror of
https://github.com/opencv/opencv.git
synced 2025-06-11 20:09:23 +08:00
Merge pull request #20674 from rogday:prelu_slope
Fix PReLU negative slope access pattern * fix prelu negative slope access pattern * change begin() to ptr()
This commit is contained in:
parent
ac0fd6aa9a
commit
d31b93b513
@ -1542,7 +1542,7 @@ Ptr<Layer> ChannelsPReLULayer::create(const LayerParams& params)
|
||||
if (params.blobs[0].total() == 1)
|
||||
{
|
||||
LayerParams reluParams = params;
|
||||
reluParams.set("negative_slope", params.blobs[0].at<float>(0));
|
||||
reluParams.set("negative_slope", *params.blobs[0].ptr<float>());
|
||||
return ReLULayer::create(reluParams);
|
||||
}
|
||||
Ptr<ChannelsPReLULayer> l(new ElementWiseLayer<ChannelsPReLUFunctor>(ChannelsPReLUFunctor(params.blobs[0])));
|
||||
|
@ -250,6 +250,11 @@ TEST_P(Test_ONNX_layers, ReLU)
|
||||
testONNXModels("ReLU");
|
||||
}
|
||||
|
||||
TEST_P(Test_ONNX_layers, PReLU)
|
||||
{
|
||||
testONNXModels("PReLU_slope");
|
||||
}
|
||||
|
||||
TEST_P(Test_ONNX_layers, Clip)
|
||||
{
|
||||
testONNXModels("clip", npy);
|
||||
|
Loading…
Reference in New Issue
Block a user