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

Function is_same_st

imperative/src/impl/ops/utility.cpp:229–239  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

227}
228
229auto is_same_st(const OpDef& def, const OpDef& another) {
230 if (!another.same_type<ShapeInfer>()) {
231 return false;
232 }
233 auto& lhs = def.cast_final_safe<ShapeInfer>();
234 auto& rhs = another.cast_final_safe<ShapeInfer>();
235 if (!lhs.op->is_same(*rhs.op)) {
236 return false;
237 }
238 return std::tie(lhs.devices, lhs.dtypes) == std::tie(rhs.devices, rhs.dtypes);
239}
240
241OP_TRAIT_REG(ShapeInfer, ShapeInfer)
242 .apply_on_var_node(apply_on_var_node)

Callers 1

is_sameMethod · 0.50

Calls 2

is_sameMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected