|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
import unittest
|
|
|
|
|
from paddle.v2.framework.framework import Variable, g_program
|
|
|
|
|
from paddle.v2.framework.framework import Variable, g_program, Program
|
|
|
|
|
import paddle.v2.framework.core as core
|
|
|
|
|
import numpy as np
|
|
|
|
|
|
|
|
|
@ -36,6 +36,13 @@ class TestVariable(unittest.TestCase):
|
|
|
|
|
self.assertRaises(ValueError,
|
|
|
|
|
lambda: b.create_var(name="fc.w", shape=(24, 100)))
|
|
|
|
|
|
|
|
|
|
def test_step_scopes(self):
|
|
|
|
|
prog = Program()
|
|
|
|
|
b = prog.current_block()
|
|
|
|
|
var = b.create_var(
|
|
|
|
|
name='step_scopes', type=core.VarDesc.VarType.STEP_SCOPES)
|
|
|
|
|
self.assertEqual(core.VarDesc.VarType.STEP_SCOPES, var.type)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
|
unittest.main()
|
|
|
|
|