mirror of https://github.com/Jittor/Jittor
change eager_execution -> lazy_execution
This commit is contained in:
parent
e25a8ac28d
commit
535523063f
|
@ -25,7 +25,7 @@ class TestClone(unittest.TestCase):
|
|||
a = jt.array([1,2])
|
||||
print(a.detach())
|
||||
|
||||
@jt.flag_scope(eager_execution=1)
|
||||
@jt.flag_scope(lazy_execution=0)
|
||||
def test3(self):
|
||||
a = jt.array([1,2])
|
||||
print(a.detach())
|
||||
|
|
|
@ -284,10 +284,10 @@ class TestFunction(unittest.TestCase):
|
|||
class TestFunctionWithEagerExecution(TestFunction):
|
||||
@classmethod
|
||||
def setUpClass(self):
|
||||
jt.flags.eager_execution = 1
|
||||
jt.flags.lazy_execution = 0
|
||||
@classmethod
|
||||
def tearDownClass(self):
|
||||
jt.flags.eager_execution = 0
|
||||
jt.flags.lazy_execution = 1
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
|
@ -16,14 +16,14 @@
|
|||
|
||||
namespace jittor {
|
||||
|
||||
DEFINE_FLAG(int, eager_execution, 0, "Use Eager execution rather than lazy execution, This flag makes error message and traceback infomation better. But this flag will raise memory consumption and lower the performance.");
|
||||
DEFINE_FLAG(int, lazy_execution, 1, "Default enabled, if disable, use immediately eager execution rather than lazy execution, This flag makes error message and traceback infomation better. But this flag will raise memory consumption and lower the performance.");
|
||||
|
||||
list<VarHolder*> VarHolder::hold_vars;
|
||||
|
||||
void add_hold_vars(VarHolder* self) {
|
||||
VarHolder::hold_vars.push_front(self);
|
||||
self->iter = VarHolder::hold_vars.begin();
|
||||
if (!eager_execution) return;
|
||||
if (lazy_execution) return;
|
||||
auto v = self->var;
|
||||
for (int i=0; i<5; i++) {
|
||||
auto op = v->input();
|
||||
|
|
Loading…
Reference in New Issue