@@ -269,29 +269,24 @@ public static Tensor[] fused_batch_norm_grad(FusedBatchNormParams @params)
269269 }
270270
271271 public static Tensor [ ] fused_batch_norm_grad_v3 ( FusedBatchNormParams @params )
272- => tf . Context . RunInAutoMode ( ( )
273- => tf . OpDefLib . _apply_op_helper ( "FusedBatchNormGradV3" , name : @params . Name ,
274- args : new
275- {
276- y_backprop = @params . YBackprop ,
277- x = @params . X ,
278- scale = @params . Scale ,
279- reserve_space_1 = @params . ReserveSpace1 ,
280- reserve_space_2 = @params . ReserveSpace2 ,
281- reserve_space_3 = @params . ReserveSpace3 ,
282- epsilon = @params . Epsilon ,
283- data_format = @params . DataFormat ,
284- is_training = @params . IsTraining
285- } ) . outputs , ( )
286- => tf . Runner . TFE_FastPathExecute ( tf . Context , tf . Context . DeviceName ,
287- "FusedBatchNormGradV3" , @params . Name ,
288- null ,
289- @params . YBackprop , @params . X , @params . Scale ,
290- @params . ReserveSpace1 , @params . ReserveSpace2 , @params . ReserveSpace3 ,
291- "epsilon" , @params . Epsilon ,
292- "data_format" , @params . DataFormat ,
293- "is_training" , @params . IsTraining ) ,
294- @params . YBackprop ) ;
272+ => tf . Context . ExecuteOp ( "FusedBatchNormGradV3" , @params . Name , new AutoModeArgs
273+ {
274+ OpInputArgs = new
275+ {
276+ y_backprop = @params . YBackprop ,
277+ x = @params . X ,
278+ scale = @params . Scale ,
279+ reserve_space_1 = @params . ReserveSpace1 ,
280+ reserve_space_2 = @params . ReserveSpace2 ,
281+ reserve_space_3 = @params . ReserveSpace3
282+ } ,
283+ OpAttrs = new
284+ {
285+ epsilon = @params . Epsilon ,
286+ data_format = @params . DataFormat ,
287+ is_training = @params . IsTraining
288+ }
289+ } ) ;
295290
296291 public static Tensor [ ] fused_batch_norm ( Tensor x ,
297292 Tensor scale ,
@@ -388,14 +383,10 @@ public static Tensor local_response_normalization(Tensor input, int depth_radius
388383 }
389384
390385 public static Tensor log_softmax ( Tensor logits , string name = null )
391- => tf . Context . RunInAutoMode ( ( )
392- => tf . OpDefLib . _apply_op_helper ( "LogSoftmax" , name : name ,
393- args : new { logits } ) . output , ( )
394- => tf . Runner . TFE_FastPathExecute ( tf . Context , tf . Context . DeviceName ,
395- "LogSoftmax" , name ,
396- null ,
397- logits ) . FirstOrDefault ( ) ,
398- logits ) ;
386+ => tf . Context . ExecuteOp ( "LogSoftmax" , name , new AutoModeArgs
387+ {
388+ OpInputArgs = new { logits }
389+ } ) ;
399390
400391 /// <summary>
401392 /// Says whether the targets are in the top `K` predictions.
@@ -418,19 +409,11 @@ public static Tensor in_top_kv2(Tensor predictions, Tensor targets, int k, strin
418409 }
419410
420411 public static Tensor leaky_relu ( Tensor features , float alpha = 0.2f , string name = null )
421- => tf . Context . RunInAutoMode ( ( )
422- => tf . OpDefLib . _apply_op_helper ( "LeakyRelu" , name : name ,
423- args : new
424- {
425- features ,
426- alpha
427- } ) . output , ( )
428- => tf . Runner . TFE_FastPathExecute ( tf . Context , tf . Context . DeviceName ,
429- "LeakyRelu" , name ,
430- null ,
431- features ,
432- "alpha" , alpha ) . FirstOrDefault ( ) ,
433- features ) ;
412+ => tf . Context . ExecuteOp ( "LeakyRelu" , name , new AutoModeArgs
413+ {
414+ OpInputArgs = new { features } ,
415+ OpAttrs = new { alpha }
416+ } ) ;
434417
435418 public static Tensor max_pool ( Tensor input ,
436419 int [ ] ksize ,
0 commit comments