Browse Source

fix EagerTensor.Device property.

tags/v0.20
Oceania2018 5 years ago
parent
commit
70526e0161
3 changed files with 3 additions and 1 deletions
  1. +1
    -0
      src/TensorFlowNET.Core/Eager/EagerTensor.cs
  2. +1
    -0
      src/TensorFlowNET.Core/Eager/c_api.eager.cs
  3. +1
    -1
      src/TensorFlowNET.Core/Tensors/Tensor.cs

+ 1
- 0
src/TensorFlowNET.Core/Eager/EagerTensor.cs View File

@@ -11,6 +11,7 @@ namespace Tensorflow.Eager
Status status = new Status(); Status status = new Status();
TFE_TensorHandle tfe_tensor_handle; TFE_TensorHandle tfe_tensor_handle;
public IntPtr EagerTensorHandle { get; set; } public IntPtr EagerTensorHandle { get; set; }
public override string Device => c_api.StringPiece(c_api.TFE_TensorHandleDeviceName(tfe_tensor_handle, status));


public EagerTensor(IntPtr handle) : base(handle) public EagerTensor(IntPtr handle) : base(handle)
{ {


+ 1
- 0
src/TensorFlowNET.Core/Eager/c_api.eager.cs View File

@@ -246,6 +246,7 @@ namespace Tensorflow
[DllImport(TensorFlowLibName)] [DllImport(TensorFlowLibName)]
public static extern TF_Tensor TFE_TensorHandleResolve(IntPtr h, IntPtr status); public static extern TF_Tensor TFE_TensorHandleResolve(IntPtr h, IntPtr status);



/// <summary> /// <summary>
/// This function will block till the operation that produces `h` has completed. /// This function will block till the operation that produces `h` has completed.
/// </summary> /// </summary>


+ 1
- 1
src/TensorFlowNET.Core/Tensors/Tensor.cs View File

@@ -82,7 +82,7 @@ namespace Tensorflow
/// <summary> /// <summary>
/// The name of the device on which this tensor will be produced, or null. /// The name of the device on which this tensor will be produced, or null.
/// </summary> /// </summary>
public string Device => op.Device;
public virtual string Device => op.Device;
public int[] dims => shape; public int[] dims => shape;


/// <summary> /// <summary>


Loading…
Cancel
Save