Skip to content

Commit

Permalink
Rename kVERSION_COMPATIBLE to kNATIVE_INSTANCENORM
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Chen <[email protected]>
  • Loading branch information
kevinch-nv committed Mar 24, 2023
1 parent 6872a94 commit 8af13d1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions NvOnnxParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ using OnnxParserFlags = uint32_t;

enum class OnnxParserFlag : int32_t
{
//! Parse the ONNX model into the INetworkDefinition with the intention of building a version-compatible engine in
//! TensorRT 8.6. This flag is planned to be deprecated in TensorRT 8.7, and removed in TensorRT 9.0. This will
//! choose TensorRT's native InstanceNormalization implementation over the plugin implementation. There may be
//! performance degradations when this flag is enabled.
kVERSION_COMPATIBLE = 0
//! Parse the ONNX model into the INetworkDefinition with the intention of using TensorRT's native layer
//! implementation over the plugin implementation for InstanceNormalization nodes. This flag is planned to be
//! deprecated in TensorRT 8.7 and removed in TensorRT 9.0. This flag is required when building version-compatible
//! or hardware-compatible engines. There may be performance degradations when this flag is enabled.
kNATIVE_INSTANCENORM = 0
};

//!
Expand Down
8 changes: 4 additions & 4 deletions builtin_op_importers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2204,11 +2204,11 @@ DEFINE_BUILTIN_OP_IMPORTER(ImageScaler)

DEFINE_BUILTIN_OP_IMPORTER(InstanceNormalization)
{
// Choose plugin implementation for non-VC engines, and native implementation
// for VC engines.
// Choose plugin implementation for non-VC and non-HC engines, and native implementation
// for VC and HC engines.
auto flags = ctx->getFlags();
uint32_t vcFlag = 1U << static_cast<uint32_t>(nvonnxparser::OnnxParserFlag::kVERSION_COMPATIBLE);
if (flags & vcFlag)
uint32_t nativeInstanceNormFlag = 1U << static_cast<uint32_t>(nvonnxparser::OnnxParserFlag::kNATIVE_INSTANCENORM);
if (flags & nativeInstanceNormFlag)
{
return normalizationHelper(ctx, node, inputs);
}
Expand Down

0 comments on commit 8af13d1

Please sign in to comment.