You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

FirstOrderTapeGradientFunctions.cs 742 B

123456789101112131415161718192021222324
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using Tensorflow.Graphs;
  5. namespace Tensorflow.Functions
  6. {
  7. public class FirstOrderTapeGradientFunctions : TapeGradientFunctions
  8. {
  9. public FirstOrderTapeGradientFunctions(FuncGraph func_graph,
  10. bool need_gradients_for_jvps) : base(func_graph,
  11. need_gradients_for_jvps)
  12. {
  13. }
  14. public override (EagerDefinedFunction, FuncGraph, ConcreteFunction, List<int>, int)
  15. ForwardAndBackwardFunctions(Tensors inference_args)
  16. {
  17. var outputs = _func_graph.Outputs.Take(_num_inference_outputs).ToArray();
  18. return BuildFunctionsForOutputs(outputs, inference_args);
  19. }
  20. }
  21. }