mirror of https://github.com/Jittor/Jittor
fix debug mode
This commit is contained in:
parent
f16a1c8bdf
commit
671d3a83cb
|
@ -18,4 +18,6 @@ build/
|
|||
*.md
|
||||
!*.src.md
|
||||
!README.md
|
||||
!README.cn.md
|
||||
!README.cn.md
|
||||
python/jittor.egg-info
|
||||
dist/
|
12
src/node.h
12
src/node.h
|
@ -7,6 +7,7 @@
|
|||
#include "common.h"
|
||||
#include "misc/nano_string.h"
|
||||
#include "misc/nano_vector.h"
|
||||
#include "pybind/py_var_tracer.h"
|
||||
|
||||
namespace jittor {
|
||||
|
||||
|
@ -105,8 +106,15 @@ struct Node {
|
|||
list<output_t> _outputs;
|
||||
|
||||
#ifdef NODE_MEMCHECK
|
||||
Node();
|
||||
virtual ~Node();
|
||||
inline Node() {
|
||||
lived_nodes[(void*)this] = lived_nodes.size()+1;
|
||||
registe_node_trace(this);
|
||||
}
|
||||
|
||||
inline virtual ~Node() {
|
||||
lived_nodes.erase((void*)this);
|
||||
unregiste_node_trace(this);
|
||||
}
|
||||
#else
|
||||
inline Node() {};
|
||||
inline virtual ~Node() {};
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#include "pybind/py_var_tracer.h"
|
||||
#include "misc/str_utils.h"
|
||||
#include "op.h"
|
||||
#include "var.h"
|
||||
|
||||
namespace py = pybind11;
|
||||
using namespace pybind11::literals;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
// file 'LICENSE.txt', which is part of this source code package.
|
||||
// ***************************************************************
|
||||
#pragma once
|
||||
#include "var.h"
|
||||
#include "common.h"
|
||||
|
||||
namespace jittor {
|
||||
|
||||
|
|
Loading…
Reference in New Issue