@@ -90,7 +90,7 @@ public static Tensor[] _ExpGrad(Operation op, Tensor[] grads)
9090 {
9191 var grad = grads [ 0 ] ;
9292 var y = op . outputs [ 0 ] ; // y = e^x
93- return with ( ops . control_dependencies ( new Operation [ ] { grad } ) , dp => {
93+ return tf_with ( ops . control_dependencies ( new Operation [ ] { grad } ) , dp => {
9494 y = math_ops . conj ( y ) ;
9595 return new Tensor [ ] { math_ops . mul_no_nan ( y , grad ) } ;
9696 } ) ;
@@ -107,7 +107,7 @@ public static Tensor[] _LgammaGrad(Operation op, Tensor[] grads)
107107 {
108108 var grad = grads [ 0 ] ;
109109 var x = op . inputs [ 0 ] ;
110- return with ( ops . control_dependencies ( new Operation [ ] { grad } ) , dp => {
110+ return tf_with ( ops . control_dependencies ( new Operation [ ] { grad } ) , dp => {
111111 x = math_ops . conj ( x ) ;
112112 return new Tensor [ ] { grad * math_ops . digamma ( x ) } ;
113113 } ) ;
@@ -118,7 +118,7 @@ public static Tensor[] _LogGrad(Operation op, Tensor[] grads)
118118 {
119119 var grad = grads [ 0 ] ;
120120 var x = op . inputs [ 0 ] ;
121- return with ( ops . control_dependencies ( new Operation [ ] { grad } ) , dp => {
121+ return tf_with ( ops . control_dependencies ( new Operation [ ] { grad } ) , dp => {
122122 x = math_ops . conj ( x ) ;
123123 return new Tensor [ ] { grad * math_ops . reciprocal ( x ) } ;
124124 } ) ;
@@ -431,7 +431,7 @@ public static Tensor[] _SigmoidGrad(Operation op, Tensor[] grads)
431431 var grad = grads [ 0 ] ;
432432 var y = op . outputs [ 0 ] ;
433433
434- return with ( ops . control_dependencies ( grads ) , delegate
434+ return tf_with ( ops . control_dependencies ( grads ) , delegate
435435 {
436436 y = math_ops . conj ( y ) ;
437437 return new Tensor [ ] { gen_math_ops . sigmoid_grad ( y , grad ) } ;
@@ -453,7 +453,7 @@ public static Tensor[] _SquareGrad(Operation op, Tensor[] grads)
453453 var grad = grads [ 0 ] ;
454454 var x = op . inputs [ 0 ] ;
455455
456- return with ( ops . control_dependencies ( grads ) , delegate
456+ return tf_with ( ops . control_dependencies ( grads ) , delegate
457457 {
458458 x = math_ops . conj ( x ) ;
459459 var y = constant_op . constant ( 2.0f , dtype : x . dtype ) ;
@@ -467,7 +467,7 @@ public static Tensor[] _TanhGrad(Operation op, Tensor[] grads)
467467 var grad = grads [ 0 ] ;
468468 var y = op . outputs [ 0 ] ;
469469
470- return with ( ops . control_dependencies ( grads ) , delegate
470+ return tf_with ( ops . control_dependencies ( grads ) , delegate
471471 {
472472 y = math_ops . conj ( y ) ;
473473 return new Tensor [ ] { gen_math_ops . tanh_grad ( y , grad ) } ;
0 commit comments