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

Method deduce_layout

dnn/src/common/lstm_cell.cpp:7–18  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5namespace megdnn {
6
7void LSTMCell::deduce_layout(
8 const TensorLayout& input, const TensorLayout& weight_ih,
9 const TensorLayout& bias_ih, const TensorLayout& hx,
10 const TensorLayout& weight_hh, const TensorLayout& bias_hh,
11 const TensorLayout& cx, TensorLayout& h_new, TensorLayout& c_new,
12 TensorLayout& gates) {
13 h_new = TensorLayout(hx, hx.dtype);
14 c_new = TensorLayout(cx, cx.dtype);
15 auto opr = handle()->create_operator<RNNCellForward>();
16 opr->param().nonlineMode = param::RNNCell::NonlineMode::IDENTITY;
17 opr->deduce_layout(input, weight_ih, bias_ih, hx, weight_hh, bias_hh, gates);
18}
19
20void LSTMCell::check_exec(
21 const TensorLayout& input, const TensorLayout& weight_ih,

Callers 1

get_workspace_in_bytesFunction · 0.45

Calls 2

TensorLayoutClass · 0.85
paramMethod · 0.45

Tested by

no test coverage detected