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

Function apply_on_var_node

imperative/src/impl/ops/indexing.cpp:57–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55}
56
57auto apply_on_var_node(const OpDef& def, const VarNodeArray& inputs) {
58 auto&& op = def.cast_final_safe<IndexingOneHot>();
59 mgb_assert(inputs.size() == 2);
60 int real_axis = static_cast<int>(op.axis);
61 if (real_axis < 0) {
62 real_axis += static_cast<int>(op.ndim);
63 }
64 OperatorNodeConfig config{op.make_name()};
65 return opr::IndexingOneHot::make(inputs[0], inputs[1], real_axis, config);
66}
67
68SmallVector<TensorPtr> apply_on_physical_tensor(
69 const OpDef& def, SmallVector<TensorPtr> inputs,

Callers

nothing calls this directly

Calls 3

makeFunction · 0.70
sizeMethod · 0.45
make_nameMethod · 0.45

Tested by

no test coverage detected