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

Method Param

src/custom/impl/param.cpp:115–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

113CUSTOM_PIMPL_CLS_DEFINE(Param)
114
115Param::Param(const ParamInfo& info) : m_impl(new ParamImpl(), impl_deleter<ParamImpl>) {
116 for (const auto& schema : info.meta()) {
117 TypedRef(ParamImpl, m_impl.get())
118 .m_vals.emplace(schema.name(), schema.default_val());
119 }
120}
121
122ParamVal& Param::operator[](const std::string& name) {
123 return TypedRef(ParamImpl, m_impl.get()).m_vals.find(name)->second;

Callers

nothing calls this directly

Calls 4

metaMethod · 0.45
emplaceMethod · 0.45
getMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected