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

Method create_graph

src/gopt/test/no_memory_copy.cpp:35–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33 }
34
35 void create_graph() {
36 input_tensor = m_gen({1, 3, 32, 32}, m_cn);
37 auto input = opr::Host2DeviceCopy::make(*m_network->graph, input_tensor, m_cn)
38 .rename("input");
39 auto f = m_network->add_conv(
40 input, 4, {3, 3}, dtype::Float32(), true, {2, 2}, {0, 0});
41 f = m_network->add_elemwise(
42 {f}, dtype::Float32(), opr::Elemwise::Param::Mode::EXP);
43 f = m_network->add_conv(f, 8, {3, 3}, dtype::Float32(), true, {1, 1}, {1, 1});
44 f = m_network->add_pooling(f, {2, 2}, {2, 2});
45 m_out_var = m_network->add_concat(f, -f);
46 }
47
48 void create_relayout_out_graph(int mem_forward_opr_type) {
49 input_tensor = m_gen({1, 3, 32, 32}, m_cn);

Callers 2

test_basic_input_no_copyFunction · 0.80
TESTFunction · 0.80

Calls 6

renameMethod · 0.80
add_convMethod · 0.80
add_elemwiseMethod · 0.80
add_poolingMethod · 0.80
add_concatMethod · 0.80
makeFunction · 0.50

Tested by

no test coverage detected