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

Method deduce_layout

dnn/src/common/multi_head_attn/proxy_forward_base.cpp:379–389  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

377}
378
379void MHAForwardProxyBase::deduce_layout(MHA_PROXY_FORWARD_LAYOUT_PARAM) {
380 if (!layout_ismatch(MHA_PROXY_FORWARD_CALL)) {
381 layout_refill(MHA_PROXY_FORWARD_CALL);
382 }
383 attn_weight = m_nx_layout;
384 out = m_out_layout;
385 size_t mask_size = get_mask_reservespace_in_bytes(MHA_PROXY_FORWARD_CALL);
386 size_t othr_size = get_othr_reservespace_in_bytes(MHA_PROXY_FORWARD_CALL);
387 mask_reservespace = TensorLayout{{mask_size}, dtype::Uint8()};
388 othr_reservespace = TensorLayout{{othr_size / queries.dtype.size()}, queries.dtype};
389}
390
391void MHAForwardProxyBase::exec(MHA_PROXY_FORWARD_EXEC_PARAM) {
392#define cb(DType) \

Callers 2

layout_refillMethod · 0.45
layout_refillMethod · 0.45

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected