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.

Context.cs 811 B

123456789101112131415161718192021222324252627282930
  1. using System;
  2. namespace Tensorflow.Eager
  3. {
  4. public class Context : DisposableObject
  5. {
  6. public const int GRAPH_MODE = 0;
  7. public const int EAGER_MODE = 1;
  8. public int default_execution_mode;
  9. public Context(ContextOptions opts, Status status)
  10. {
  11. _handle = c_api.TFE_NewContext(opts, status);
  12. status.Check(true);
  13. }
  14. /// <summary>
  15. /// Dispose any unmanaged resources related to given <paramref name="handle"/>.
  16. /// </summary>
  17. protected sealed override void DisposeUnmanagedResources(IntPtr handle)
  18. => c_api.TFE_DeleteContext(_handle);
  19. public bool executing_eagerly() => false;
  20. public static implicit operator IntPtr(Context ctx)
  21. => ctx._handle;
  22. }
  23. }