MCPcopy Create free account
hub / github.com/NVIDIA/TensorRT / parseELU

Function parseELU

parsers/caffe/caffeParser/opParsers/parseELU.cpp:24–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22namespace nvcaffeparser1
23{
24ILayer* parseELU(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::ELUParameter& p = msg.elu_param();
32
33 float alpha = 1.f; // default parameter
34 if (p.has_alpha())
35 {
36 alpha = p.alpha();
37 }
38 auto newLayer = network.addActivation(*tensors[msg.bottom(0)], ActivationType::kELU);
39 newLayer->setAlpha(alpha);
40 return newLayer;
41}
42} //namespace nvcaffeparser1

Callers

nothing calls this directly

Calls 3

checkBlobsFunction · 0.85
addActivationMethod · 0.80
setAlphaMethod · 0.45

Tested by

no test coverage detected