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

Function DEF_IMPL

test/src/autocheck.cpp:31–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29 AutoOprChecker<nr_inp, nr_out, dtype>& AutoOprChecker<nr_inp, nr_out, dtype>
30
31DEF_IMPL()::AutoOprChecker(GraphMaker maker, FwdNumeric fwd, CompNode comp_node)
32 : m_fwd(fwd), m_maker(maker), m_comp_node{comp_node} {
33 InputGenerator default_input_gen = [this](HostTensorND& dest) {
34 dest = *m_gen(dest.shape(), m_comp_node);
35 };
36 for (size_t i = 0; i < nr_inp; ++i) {
37 m_inputs[i] = std::make_shared<HostTensorND>(m_comp_node, dtype());
38 m_inputs_generator[i] = default_input_gen;
39 }
40 for (size_t i = 0; i < nr_inp; ++i) {
41 m_inputs_allow_grad[i] = true;
42 }
43 for (size_t i = 0; i < nr_out; ++i) {
44 m_outputs_allow_grad[i] = true;
45 }
46 for (size_t i = 0; i < nr_out; ++i) {
47 m_outputs_allow_check[i] = true;
48 }
49}
50
51DEF_IMPL(void)::build_graph() {
52 mgb_assert(!m_built);

Callers

nothing calls this directly

Calls 15

make_callback_copyFunction · 0.85
gradFunction · 0.85
output_fileFunction · 0.85
resizeMethod · 0.80
makeFunction · 0.50
absFunction · 0.50
shapeMethod · 0.45
dtypeMethod · 0.45
comp_nodeMethod · 0.45
push_backMethod · 0.45
flattenMethod · 0.45
syncMethod · 0.45

Tested by

no test coverage detected