SHARE
TWEET

Untitled

a guest Jul 20th, 2019 80 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. IPluginV2* L2NormHelperPluginCreator::createPlugin(const char* name, const PluginFieldCollection* fc)
  2. {
  3.     const PluginField* fields = fc->fields;
  4.     for (int i = 0; i < fc->nbFields; ++i)
  5.     {
  6.         const char* attrName = fields[i].name;
  7.         if (!strcmp(attrName, "op_type"))
  8.         {
  9.             ASSERT(fields[i].type == PluginFieldType::kINT32);
  10.             mOpType = static_cast<int>(*(static_cast<const int*>(fields[i].data)));
  11.         }
  12.         if (!strcmp(attrName, "eps"))
  13.         {
  14.             ASSERT(fields[i].type == PluginFieldType::kFLOAT32);
  15.             mEps = static_cast<float>(*(static_cast<const float*>(fields[i].data)));
  16.         }
  17.     }
  18.     L2NormHelper* obj = new L2NormHelper(mOpType, mEps);
  19.     obj->setPluginNamespace(mNamespace.c_str());
  20.     return obj;
  21. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top