MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / set_tag

Method set_tag

src/custom/impl/param.cpp:85–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83CUSTOM_PIMPL_CLS_DEFINE(ParamInfo)
84
85void ParamInfo::set_tag(const std::string& hash_str) {
86 const char* ptr = hash_str.c_str();
87 TypedRef(ParamInfoImpl, m_impl.get()).TAG = 0;
88 for (size_t i = 0; i < hash_str.size(); i++) {
89 TypedRef(ParamInfoImpl, m_impl.get()).TAG =
90 mgb::hash_pair_combine(
91 TypedRef(ParamInfoImpl, m_impl.get()).TAG,
92 mgb::hash(*(ptr++))) %
93 std::numeric_limits<uint32_t>::max();
94 }
95}
96
97void ParamInfo::set_meta(const std::vector<ParamSchema>& meta) {
98 TypedRef(ParamInfoImpl, m_impl.get()).m_meta = meta;

Callers 2

TESTFunction · 0.80
CustomOpImplMethod · 0.80

Calls 5

maxFunction · 0.85
hash_pair_combineFunction · 0.50
hashFunction · 0.50
getMethod · 0.45
sizeMethod · 0.45

Tested by 1

TESTFunction · 0.64