Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions builtin_op_importers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1062,6 +1062,8 @@ DEFINE_BUILTIN_OP_IMPORTER(Gemm)
{
auto transposedWeights = ctx->createTempWeights(weights.type, weights.shape);
ASSERT(transposeWeights(weights, {1, 0}, &transposedWeights), ErrorCode::kUNSUPPORTED_NODE);
transposedWeights.setName(weights.getName());
LOG_WARNING("Weight " << transposedWeights.getName() << " has been transposed! If you plan on overwriting this weight with the Refitter API, the new weights must be pre-transposed");
weights = transposedWeights;
// Since we've already transposed now, we can set transpose to false.
transB = false;
Expand All @@ -1070,6 +1072,7 @@ DEFINE_BUILTIN_OP_IMPORTER(Gemm)
= ctx->network()->addConstant(weights.shape, static_cast<nvinfer1::Weights>(weights));
// Map the constant layer to the weights name.
ctx->registerLayer(weightsLayer, node.input(1));
ctx->insertRefitMap(weights.getName(), weightsLayer->getName(), nvinfer1::WeightsRole::kCONSTANT);
inputB = weightsLayer->getOutput(0);
}
else
Expand Down