File tree Expand file tree Collapse file tree 3 files changed +17
-5
lines changed Expand file tree Collapse file tree 3 files changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,17 @@ namespace Tensorflow
66{
77 public class control_flow_ops
88 {
9- public static Operation group ( Operation [ ] inputs )
9+ public static Operation group ( List < Operation > inputs , string name = "" )
10+ {
11+ using ( var namescope = new ops . name_scope < Operation > ( name , "group_deps" , inputs ) )
12+ {
13+ // Sorts *inputs according to their devices.
14+
15+ return _GroupControlDeps ( "" , name ) ;
16+ }
17+ }
18+
19+ private static Operation _GroupControlDeps ( string dev , string name = "" )
1020 {
1121 return null ;
1222 }
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ public static partial class tf
99 public static Operation global_variables_initializer ( )
1010 {
1111 var g = variables . global_variables ( ) ;
12- return variables . variables_initializer ( g as RefVariable [ ] ) ;
12+ return variables . variables_initializer ( g . ToArray ( ) ) ;
1313 }
1414 }
1515}
Original file line number Diff line number Diff line change @@ -27,9 +27,11 @@ public static object trainable_variables()
2727 /// special tokens filters by prefix.
2828 /// </param>
2929 /// <returns>A list of `Variable` objects.</returns>
30- public static object global_variables ( string scope = "" )
30+ public static List < RefVariable > global_variables ( string scope = "" )
3131 {
32- return ops . get_collection ( ops . GraphKeys . GLOBAL_VARIABLES , scope ) ;
32+ var result = ops . get_collection ( ops . GraphKeys . GLOBAL_VARIABLES , scope ) ;
33+
34+ return result as List < RefVariable > ;
3335 }
3436
3537 /// <summary>
@@ -40,7 +42,7 @@ public static object global_variables(string scope = "")
4042 /// <returns>An Op that run the initializers of all the specified variables.</returns>
4143 public static Operation variables_initializer ( RefVariable [ ] var_list , string name = "init" )
4244 {
43- return control_flow_ops . group ( var_list . Select ( x => x . initializer ) . ToArray ( ) ) ;
45+ return control_flow_ops . group ( var_list . Select ( x => x . initializer ) . ToList ( ) ) ;
4446 }
4547 }
4648}
You can’t perform that action at this time.
0 commit comments