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

Method incr_sub_input_replacer

src/opr/impl/loop/grad.cpp:169–181  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

167}
168
169DeviceTensorND OutputRecorderSumIntoDest::incr_sub_input_replacer(
170 const TensorShape& shape) {
171 ++m_dbg_nr_input_replacer_call;
172 auto&& dest = m_dest->dev_tensor();
173 if (*m_dest_first_summed) {
174 *m_dest_first_summed = false;
175 mgb_assert(
176 dest.shape().eq_shape(shape), "output shape changed: %s vs %s",
177 dest.shape().to_string().c_str(), shape.to_string().c_str());
178 fill_zero_dev_tensor(dest);
179 }
180 return dest;
181}
182
183/* ==================== AssignorGradOpr ==================== */
184MGB_DYN_TYPE_OBJ_FINAL_IMPL(LoopGrad::AssignorGradOpr);

Callers

nothing calls this directly

Calls 5

fill_zero_dev_tensorFunction · 0.85
dev_tensorMethod · 0.45
eq_shapeMethod · 0.45
shapeMethod · 0.45
to_stringMethod · 0.45

Tested by

no test coverage detected