tvm
Public Member Functions | List of all members
tvm::relax::BlockBuilder::DisableOperatorSpecificNormalizationForTVMScript Struct Reference

A marker struct to disable FNormalize. More...

#include <block_builder.h>

Collaboration diagram for tvm::relax::BlockBuilder::DisableOperatorSpecificNormalizationForTVMScript:

Public Member Functions

 DisableOperatorSpecificNormalizationForTVMScript ()=default
 

Detailed Description

A marker struct to disable FNormalize.

This struct is used as a marker to disable the use of FNormalize by this block builder. This should only be used for TVMScript parsing, which may require producing un-normalized Relax IR for testing purposes, and to ensure that round-trips are unchanged.

The name is deliberately verbose to draw attention during a code review. The explicit default constructor prevents aggregate initialization, ensuring that the full name of the marker struct appears at the callsite.

This constructor is marked as no-lint to allow a zero-parameter constructor to be marked as explicit. The constructor must be explicit in order to disable aggregate initialization in C++17. While C++20 disables aggregate initialization when a user-declared constructor is present, C++17 only disables aggregate initialization when a user-defined constructor is present. Therefore, we need to mark the zero-parameter constructor as explicit in order to prevent aggregate initialization, and to ensure that the name appears at all callsites.

Constructor & Destructor Documentation

◆ DisableOperatorSpecificNormalizationForTVMScript()

tvm::relax::BlockBuilder::DisableOperatorSpecificNormalizationForTVMScript::DisableOperatorSpecificNormalizationForTVMScript ( )
explicitdefault

The documentation for this struct was generated from the following file: