i create a prelu plugin(PreluPlugin), it has a name relu0, and has two outputs
class PreluPlugin : public nvinfer1::IPluginV2{
name = "relu0";
}
then, when it clone, we would append a “_split” suffixin into new clone name, like:
IPluginV2* PreluPlugin::clone() const {
PreluPlugin* new_prelu = new PreluPlugin();
new_prelu->name = name + "_split";
return new_prelu;
}
then, iadd some cout statements in destroymethod, like:
void PreluPlugin::destroy() {
// \brief Destroy the plugin object. This will be called when the network, builder or engine is destroyed.
std::cout << "PreluPlugin.destroy: " << name << "\n";
}
i run a example code, then found there are 3 clone objects, like:
relu0_split
relu0_split_split,
relu0_split_split_split
and the first two, i can understand why, it is that maybe tensorrt would clone relu0 twice and pass ech one of them to next two layers, and destroy them when finish builting engine
but the last one, it would be destroyed when main function return, and i can not figure why by myself?