shortcut rt test

This commit is contained in:
Francesco Gatti
2018-12-21 15:53:39 +01:00
parent 7a51b4382d
commit 64626bf547
4 changed files with 97 additions and 3 deletions
+15
View File
@@ -14,6 +14,7 @@ using namespace nvinfer1;
#include "pluginsRT/ActivationLeakyRT.cpp"
#include "pluginsRT/ReorgRT.cpp"
#include "pluginsRT/RegionRT.cpp"
#include "pluginsRT/ShortcutRT.cpp"
#include "pluginsRT/Int8Calibrator.cpp"
// Logger for info/warning/errors
@@ -167,6 +168,8 @@ ILayer* NetworkRT::convert_layer(ITensor *input, Layer *l) {
return convert_layer(input, (Reorg*) l);
if(type == LAYER_REGION)
return convert_layer(input, (Region*) l);
if(type == LAYER_SHORTCUT)
return convert_layer(input, (Shortcut*) l);
FatalError("Layer not implemented in tensorRT");
return NULL;
@@ -321,6 +324,18 @@ ILayer* NetworkRT::convert_layer(ITensor *input, Region *l) {
return lRT;
}
ILayer* NetworkRT::convert_layer(ITensor *input, Shortcut *l) {
//std::cout<<"convert Shortcut\n";
//std::cout<<"New plugin Shortcut\n";
ITensor *tens = tensors[l->backLayer];
IPlugin *plugin = new ShortcutRT(tens);
IPluginLayer *lRT = networkRT->addPlugin(&input, 1, *plugin);
checkNULL(lRT);
return lRT;
}
bool NetworkRT::serialize(const char *filename) {
std::ofstream p(filename);