mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Follows #131034 Pull Request resolved: https://github.com/pytorch/pytorch/pull/131735 Approved by: https://github.com/ezyang
26 lines
630 B
C++
26 lines
630 B
C++
#pragma once
|
|
|
|
#include <ATen/core/qualified_name.h>
|
|
#include <torch/csrc/Export.h>
|
|
|
|
namespace torch::jit {
|
|
|
|
/**
|
|
* class NameMangler
|
|
*
|
|
* Utility to mangle qualified names in order to make them unique. We use this
|
|
* in various places where we to de-duplicate qualified names.
|
|
*/
|
|
class TORCH_API NameMangler {
|
|
public:
|
|
// Given a qualified name, return a mangled version that is guaranteed to be
|
|
// unique with respect to previous/future calls of `mangled()` on this name
|
|
// mangler instance.
|
|
c10::QualifiedName mangle(const c10::QualifiedName& name);
|
|
|
|
private:
|
|
size_t mangleIndex_ = 0;
|
|
};
|
|
|
|
} // namespace torch::jit
|