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.

tf.graph.cs 1.8 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*****************************************************************************
  2. Copyright 2018 The TensorFlow.NET Authors. All Rights Reserved.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. ******************************************************************************/
  13. using static Tensorflow.ops;
  14. namespace Tensorflow
  15. {
  16. public partial class tensorflow
  17. {
  18. public graph_util_impl graph_util => new graph_util_impl();
  19. public GraphTransformer graph_transforms => new GraphTransformer();
  20. public GraphKeys GraphKeys { get; } = new GraphKeys();
  21. public void reset_default_graph()
  22. => ops.reset_default_graph();
  23. public Graph get_default_graph()
  24. {
  25. return ops.get_default_graph();
  26. }
  27. /// <summary>
  28. /// Equivalent to <see cref="get_default_graph"/> but does not create a new graph if it there is none.
  29. /// </summary>
  30. public Graph peak_default_graph()
  31. {
  32. return ops.default_graph_stack.peak_controller();
  33. }
  34. /// <summary>
  35. /// Creates a new graph.
  36. /// </summary>
  37. ///<remarks>Has no interaction with graph defaulting. Equivalent to new Graph();</remarks>
  38. public Graph Graph()
  39. => new Graph();
  40. }
  41. }