| 22 | namespace nvcaffeparser1 |
| 23 | { |
| 24 | ILayer* parseReLU(INetworkDefinition& network, const trtcaffe::LayerParameter& msg, CaffeWeightFactory& /*weightFactory*/, BlobNameToTensor& tensors) |
| 25 | { |
| 26 | if (!checkBlobs(msg, 1, 1)) |
| 27 | { |
| 28 | return nullptr; |
| 29 | } |
| 30 | |
| 31 | const trtcaffe::ReLUParameter& p = msg.relu_param(); |
| 32 | |
| 33 | if (p.has_negative_slope() && p.negative_slope() != 0) |
| 34 | { |
| 35 | auto newLayer = network.addActivation(*tensors[msg.bottom(0)], ActivationType::kLEAKY_RELU); |
| 36 | newLayer->setAlpha(p.negative_slope()); |
| 37 | return newLayer; |
| 38 | } |
| 39 | return network.addActivation(*tensors[msg.bottom(0)], ActivationType::kRELU); |
| 40 | } |
| 41 | } //namespace nvcaffeparser1 |
nothing calls this directly
no test coverage detected