UniqueNameSupply can be used to generate unique names.
More...
#include <unique_name_supply.h>
UniqueNameSupply can be used to generate unique names.
◆ UniqueNameSupplyNode() [1/2]
| tvm::UniqueNameSupplyNode::UniqueNameSupplyNode |
( |
| ) |
|
|
default |
Empty constructor. Needed by the TVM_REGISTER_NODE_TYPE macro.
◆ UniqueNameSupplyNode() [2/2]
| tvm::UniqueNameSupplyNode::UniqueNameSupplyNode |
( |
const ffi::String & |
prefix, |
|
|
ffi::Map< ffi::String, int64_t > |
name_map |
|
) |
| |
|
inline |
Constructor.
- Parameters
-
| prefix | The prefix to be used with this UniqueNameSupply. |
| name_map | The map used to guarantee uniqueness. |
◆ ContainsName()
| bool tvm::UniqueNameSupplyNode::ContainsName |
( |
const ffi::String & |
name, |
|
|
bool |
add_prefix = true |
|
) |
| |
Checks if this UniqueNameSupply already generated a name.
- Parameters
-
| name | The name to check. |
| add_prefix | If set to true, then the prefix of this UniqueNameSupply will be prepended to the name before checking for it. |
- Returns
- True if the name has already been generated. False otherwise.
◆ FreshName()
| ffi::String tvm::UniqueNameSupplyNode::FreshName |
( |
const ffi::String & |
name, |
|
|
bool |
add_prefix = true, |
|
|
bool |
add_underscore = true |
|
) |
| |
Generates a unique name from this UniqueNameSupply.
- Parameters
-
| name | The name from which the generated name is derived. |
| add_prefix | If set to true, then the prefix of this UniqueNameSupply will be prepended to the name. |
| add_underscore | If set to true, add '_' between prefix and a digit. |
- Returns
- A unique name.
◆ RegisterReflection()
| static void tvm::UniqueNameSupplyNode::RegisterReflection |
( |
| ) |
|
|
inlinestatic |
◆ ReserveName()
| ffi::String tvm::UniqueNameSupplyNode::ReserveName |
( |
const ffi::String & |
name, |
|
|
bool |
add_prefix = true |
|
) |
| |
Reserves an existing name with this UniqueNameSupply.
- Parameters
-
| name | The name to be reserved. |
| add_prefix | If set to true, then the prefix of this UniqueNameSupply will be prepended to the name before reserving it. |
- Returns
- The name that was reserved with the UniqueNameSupply. It can be different if a prefix is added.
◆ TVM_FFI_DECLARE_OBJECT_INFO_FINAL()
| tvm::UniqueNameSupplyNode::TVM_FFI_DECLARE_OBJECT_INFO_FINAL |
( |
"ir.UniqueNameSupply" |
, |
|
|
UniqueNameSupplyNode |
, |
|
|
ffi::Object |
|
|
) |
| |
◆ _type_mutable
| constexpr const bool tvm::UniqueNameSupplyNode::_type_mutable = true |
|
staticconstexpr |
◆ prefix_
| std::string tvm::UniqueNameSupplyNode::prefix_ |
The documentation for this class was generated from the following file: