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

Method check

imperative/src/impl/tensor_sanity_check.cpp:52–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50};
51
52bool TensorSanityCheckImpl::check(TensorPtr p) {
53 auto&& it = tensor2chksum.find(p);
54 auto&& chksum = m_calc->calc(p);
55 if (it == tensor2chksum.end()) {
56 tensor2chksum[p] = chksum;
57 return true;
58 }
59 return it->second == chksum;
60}
61
62void TensorSanityCheck::enable() {
63 CompNode::sync_all();

Callers 1

enableMethod · 0.45

Calls 3

calcMethod · 0.80
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected