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

Method clone

plugin/bertQKVToContextPlugin/qkvToContextPlugin.cpp:126–148  ·  view source on GitHub ↗

IPluginV2DynamicExt Methods

Source from the content-addressed store, hash-verified

124
125// IPluginV2DynamicExt Methods
126nvinfer1::IPluginV2DynamicExt* QKVToContextPluginDynamic::clone() const noexcept
127{
128 BERT_DEBUG_MSG("QKV Clone");
129
130 QKVToContextPluginDynamic* ret = nullptr;
131 // the workspacesize is 0 if we have not call setup the dispatcher yet.
132 if (unfusedDispatcher.get() && unfusedDispatcher->getWorkspaceSize())
133 {
134 std::vector<char> buff;
135 buff.resize(getSerializationSize());
136 serialize(buff.data());
137
138 ret = new QKVToContextPluginDynamic(mLayerName, buff.data(), buff.size());
139 }
140 else
141 {
142 ret = new QKVToContextPluginDynamic(mLayerName, mType, mHiddenSize, mNumHeads, mDqProbs, mHasImask);
143 }
144
145 ret->setPluginNamespace(mNamespace.c_str());
146 BERT_DEBUG_MSG("QKV Clone done");
147 return ret;
148}
149
150DimsExprs QKVToContextPluginDynamic::getOutputDimensions(
151 int32_t outputIndex, DimsExprs const* inputs, int32_t /*nbInputs*/, IExprBuilder& exprBuilder) noexcept

Callers

nothing calls this directly

Calls 7

c_strMethod · 0.80
getMethod · 0.45
getWorkspaceSizeMethod · 0.45
resizeMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45
setPluginNamespaceMethod · 0.45

Tested by

no test coverage detected