| 50 | }; |
| 51 | |
| 52 | bool 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 | |
| 62 | void TensorSanityCheck::enable() { |
| 63 | CompNode::sync_all(); |