@@ -95,9 +95,9 @@ public static Tensor[] _GradientsHelper(Tensor[] ys,
9595 {
9696 // 'ready' handles the case where one output gradient relies on
9797 // another output's gradient.
98- if ( ! pending_count . ContainsKey ( op . Name ) )
99- pending_count [ op . Name ] = 0 ;
100- bool ready = pending_count [ op . Name ] == 0 ;
98+ if ( ! pending_count . ContainsKey ( op . name ) )
99+ pending_count [ op . name ] = 0 ;
100+ bool ready = pending_count [ op . name ] == 0 ;
101101 if ( ready && ! to_ops_set . Contains ( op ) && reachable_to_ops . Contains ( op ) )
102102 {
103103 to_ops_set . Add ( op ) ;
@@ -131,7 +131,7 @@ public static Tensor[] _GradientsHelper(Tensor[] ys,
131131 // for ops that do not have gradients.
132132 var grad_fn = ops . get_gradient_function ( op ) ;
133133
134- Python . with < ops . name_scope > ( new ops . name_scope ( op . Name + "_grad" ) , scope1 =>
134+ Python . with < ops . name_scope > ( new ops . name_scope ( op . name + "_grad" ) , scope1 =>
135135 {
136136 string name1 = scope1 ;
137137 if ( grad_fn != null )
@@ -193,12 +193,12 @@ private static void _UpdatePendingAndEnqueueReady(Dictionary<string, Tensor[][]>
193193 {
194194 foreach ( var x in _NonEagerInputs ( op , xs ) )
195195 {
196- if ( ! pending_count . ContainsKey ( x . op . Name ) )
197- pending_count [ x . op . Name ] = 0 ;
196+ if ( ! pending_count . ContainsKey ( x . op . name ) )
197+ pending_count [ x . op . name ] = 0 ;
198198
199- pending_count [ x . op . Name ] -= 1 ;
199+ pending_count [ x . op . name ] -= 1 ;
200200
201- var ready = pending_count [ x . op . Name ] == 0 ;
201+ var ready = pending_count [ x . op . name ] == 0 ;
202202
203203 if ( loop_state != null && ! ready )
204204 {
@@ -281,10 +281,10 @@ private static Operation[] _StopOps(List<Operation> from_ops, List<Operation> st
281281 bool is_stop_op = true ;
282282 foreach ( var inp in _NonEagerInputs ( op , xs ) )
283283 {
284- if ( ! pending_count . ContainsKey ( inp . op . Name ) )
285- pending_count [ inp . op . Name ] = 0 ;
284+ if ( ! pending_count . ContainsKey ( inp . op . name ) )
285+ pending_count [ inp . op . name ] = 0 ;
286286
287- if ( pending_count [ inp . op . Name ] > 0 )
287+ if ( pending_count [ inp . op . name ] > 0 )
288288 {
289289 is_stop_op = false ;
290290 break ;
@@ -300,17 +300,17 @@ private static Operation[] _StopOps(List<Operation> from_ops, List<Operation> st
300300 private static Tensor _GetGrad ( Dictionary < string , Tensor [ ] [ ] > grads , Tensor t )
301301 {
302302 var op = t . op ;
303- if ( ! grads . ContainsKey ( op . Name ) )
303+ if ( ! grads . ContainsKey ( op . name ) )
304304 return null ;
305- Tensor [ ] [ ] op_grads = grads [ op . Name ] ;
305+ Tensor [ ] [ ] op_grads = grads [ op . name ] ;
306306 var t_grad = op_grads [ t . value_index ] ;
307307 return t_grad [ 0 ] ;
308308 }
309309
310310 private static Tensor [ ] [ ] _GetGrads ( Dictionary < string , Tensor [ ] [ ] > grads , Operation op )
311311 {
312- if ( grads . ContainsKey ( op . Name ) )
313- return grads [ op . Name ] ;
312+ if ( grads . ContainsKey ( op . name ) )
313+ return grads [ op . name ] ;
314314 else
315315 return op . outputs . Select ( x => new Tensor [ 0 ] ) . ToArray ( ) ;
316316 }
@@ -324,11 +324,11 @@ private static Tensor[][] _GetGrads(Dictionary<string, Tensor[][]> grads, Operat
324324 private static void _SetGrad ( Dictionary < string , Tensor [ ] [ ] > grads , Tensor t , Tensor grad )
325325 {
326326 var op = t . op ;
327- Tensor [ ] [ ] op_grads = grads . ContainsKey ( op . Name ) ? grads [ op . Name ] : null ;
327+ Tensor [ ] [ ] op_grads = grads . ContainsKey ( op . name ) ? grads [ op . name ] : null ;
328328 if ( op_grads == null )
329329 {
330330 op_grads = op . outputs . Select ( x => new Tensor [ 1 ] ) . ToArray ( ) ;
331- grads [ op . Name ] = op_grads ;
331+ grads [ op . name ] = op_grads ;
332332 }
333333 var t_grads = op_grads [ t . value_index ] ;
334334 t_grads [ 0 ] = grad ;
@@ -421,10 +421,10 @@ private static (Operation[], Dictionary<string, int>, object) _PendingCount(List
421421 {
422422 if ( between_ops . Contains ( x . op ) )
423423 {
424- if ( ! pending_count . ContainsKey ( x . op . Name ) )
425- pending_count [ x . op . Name ] = 0 ;
424+ if ( ! pending_count . ContainsKey ( x . op . name ) )
425+ pending_count [ x . op . name ] = 0 ;
426426
427- pending_count [ x . op . Name ] += 1 ;
427+ pending_count [ x . op . name ] += 1 ;
428428 }
429429 }
430430 }
0 commit comments