Last active
July 8, 2019 22:34
-
-
Save r7vme/a404423feb42b7564cfacb19510f45b9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IPluginV2* L2NormHelperPluginCreator::createPlugin(const char* name, const PluginFieldCollection* fc) | |
{ | |
const PluginField* fields = fc->fields; | |
for (int i = 0; i < fc->nbFields; ++i) | |
{ | |
const char* attrName = fields[i].name; | |
if (!strcmp(attrName, "op_type")) | |
{ | |
ASSERT(fields[i].type == PluginFieldType::kINT32); | |
mOpType = static_cast<int>(*(static_cast<const int*>(fields[i].data))); | |
} | |
if (!strcmp(attrName, "eps")) | |
{ | |
ASSERT(fields[i].type == PluginFieldType::kFLOAT32); | |
mEps = static_cast<float>(*(static_cast<const float*>(fields[i].data))); | |
} | |
} | |
L2NormHelper* obj = new L2NormHelper(mOpType, mEps); | |
obj->setPluginNamespace(mNamespace.c_str()); | |
return obj; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment