File tree Expand file tree Collapse file tree 3 files changed +11
-2
lines changed
python/paddle/v2/framework/tests Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -115,6 +115,7 @@ message VarDesc {
115
115
SELECTED_ROWS = 2 ;
116
116
FEED_MINIBATCH = 3 ;
117
117
FETCH_LIST = 4 ;
118
+ STEP_SCOPES = 5 ;
118
119
}
119
120
required string name = 1 ;
120
121
required VarType type = 2 ;
Original file line number Diff line number Diff line change @@ -224,7 +224,8 @@ void BindVarDsec(py::module &m) {
224
224
.value (" LOD_TENSOR" , VarDesc::LOD_TENSOR)
225
225
.value (" SELECTED_ROWS" , VarDesc::SELECTED_ROWS)
226
226
.value (" FEED_MINIBATCH" , VarDesc::FEED_MINIBATCH)
227
- .value (" FETCH_LIST" , VarDesc::FETCH_LIST);
227
+ .value (" FETCH_LIST" , VarDesc::FETCH_LIST)
228
+ .value (" STEP_SCOPES" , VarDesc::STEP_SCOPES);
228
229
}
229
230
230
231
void BindOpDesc (py::module &m) {
Original file line number Diff line number Diff line change 1
1
import unittest
2
- from paddle .v2 .framework .framework import Variable , g_program
2
+ from paddle .v2 .framework .framework import Variable , g_program , Program
3
3
import paddle .v2 .framework .core as core
4
4
import numpy as np
5
5
@@ -36,6 +36,13 @@ def test_var(self):
36
36
self .assertRaises (ValueError ,
37
37
lambda : b .create_var (name = "fc.w" , shape = (24 , 100 )))
38
38
39
+ def test_step_scopes (self ):
40
+ prog = Program ()
41
+ b = prog .current_block ()
42
+ var = b .create_var (
43
+ name = 'step_scopes' , type = core .VarDesc .VarType .STEP_SCOPES )
44
+ self .assertEqual (core .VarDesc .VarType .STEP_SCOPES , var .type )
45
+
39
46
40
47
if __name__ == '__main__' :
41
48
unittest .main ()
You can’t perform that action at this time.
0 commit comments