| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent a0cc473 commit fa37f07
15 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -67,7 +67,7 @@ public partial class c_api | |||
| 67 | 67 | /// <param name="status">TF_Status*</param> | |
| 68 | 68 | /// <returns>TFE_TensorHandle*</returns> | |
| 69 | 69 | [DllImport(TensorFlowLibName)] | |
| 70 | - public static extern SafeTensorHandleHandle TFE_TensorHandleCopyToDevice(SafeTensorHandleHandle h, SafeContextHandle ctx, string device_name, SafeStatusHandle status); | ||
| 70 | + public static extern SafeEagerTensorHandle TFE_TensorHandleCopyToDevice(SafeEagerTensorHandle h, SafeContextHandle ctx, string device_name, SafeStatusHandle status); | ||
| 71 | 71 | ||
| 72 | 72 | /// <summary> | |
| 73 | 73 | /// Retrieves the full name of the device (e.g. /job:worker/replica:0/...) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -48,7 +48,7 @@ public Tensor[] TFE_ExecuteCancelable(Context ctx, | |||
| 48 | 48 | { | |
| 49 | 49 | for (int i = 0; i < inputs.Length; ++i) | |
| 50 | 50 | { | |
| 51 | - SafeTensorHandleHandle tensor_handle = inputs[i] switch | ||
| 51 | + SafeEagerTensorHandle tensor_handle = inputs[i] switch | ||
| 52 | 52 | { | |
| 53 | 53 | EagerTensor et => et.EagerTensorHandle, | |
| 54 | 54 | Tensor nd => nd.EagerTensorHandle, | |
@@ -61,7 +61,7 @@ public Tensor[] TFE_ExecuteCancelable(Context ctx, | |||
| 61 | 61 | if (status.ok() && attrs != null) | |
| 62 | 62 | SetOpAttrs(op, attrs); | |
| 63 | 63 | ||
| 64 | - var outputs = new SafeTensorHandleHandle[num_outputs]; | ||
| 64 | + var outputs = new SafeEagerTensorHandle[num_outputs]; | ||
| 65 | 65 | if (status.ok()) | |
| 66 | 66 | { | |
| 67 | 67 | c_api.TFE_Execute(op, outputs, out num_outputs, status.Handle); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -141,7 +141,7 @@ public Tensor[] TFE_FastPathExecute(FastPathOpExecInfo op_exec_info) | |||
| 141 | 141 | num_retvals += (int)delta; | |
| 142 | 142 | } | |
| 143 | 143 | ||
| 144 | - var retVals = new SafeTensorHandleHandle[num_retvals]; | ||
| 144 | + var retVals = new SafeEagerTensorHandle[num_retvals]; | ||
| 145 | 145 | c_api.TFE_Execute(op, retVals, out num_retvals, status.Handle); | |
| 146 | 146 | status.Check(true); | |
| 147 | 147 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -12,7 +12,7 @@ public EagerTensor(SafeTensorHandle handle) | |||
| 12 | 12 | NewEagerTensorHandle(handle); | |
| 13 | 13 | } | |
| 14 | 14 | ||
| 15 | - public EagerTensor(SafeTensorHandleHandle handle) | ||
| 15 | + public EagerTensor(SafeEagerTensorHandle handle) | ||
| 16 | 16 | { | |
| 17 | 17 | _id = ops.uid(); | |
| 18 | 18 | _eagerTensorHandle = handle; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -6,17 +6,19 @@ namespace Tensorflow.Eager | |||
| 6 | 6 | { | |
| 7 | 7 | public partial class EagerTensor : Tensor | |
| 8 | 8 | { | |
| 9 | - public override string Device | ||
| 10 | - { | ||
| 11 | - get | ||
| 12 | - { | ||
| 13 | - using var _ = EagerTensorHandle.Lease(); | ||
| 14 | - return c_api.StringPiece(c_api.TFE_TensorHandleDeviceName(EagerTensorHandle, tf.Status.Handle)); | ||
| 15 | - } | ||
| 16 | - } | ||
| 9 | + public override string Device => c_api.StringPiece(c_api.TFE_TensorHandleDeviceName(_eagerTensorHandle, tf.Status.Handle)); | ||
| 10 | + public override TF_DataType dtype => c_api.TFE_TensorHandleDataType(_eagerTensorHandle); | ||
| 17 | 11 | ||
| 18 | 12 | public override int rank => c_api.TFE_TensorHandleNumDims(EagerTensorHandle, tf.Status.Handle); | |
| 19 | 13 | ||
| 14 | + protected override Shape GetShapeInternal() | ||
| 15 | + { | ||
| 16 | + var dims = new int[c_api.TFE_TensorHandleNumDims(_eagerTensorHandle, tf.Status.Handle)]; | ||
| 17 | + for (int i = 0; i < dims.Length; i++) | ||
| 18 | + dims[i] = c_api.TFE_TensorHandleDim(_eagerTensorHandle, i, tf.Status.Handle); | ||
| 19 | + return dims; | ||
| 20 | + } | ||
| 21 | + | ||
| 20 | 22 | public static int GetRank(IntPtr handle) | |
| 21 | 23 | { | |
| 22 | 24 | var tfe_tensor_handle = c_api.TFE_EagerTensorHandle(handle); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -20,13 +20,13 @@ limitations under the License. | |||
| 20 | 20 | ||
| 21 | 21 | namespace Tensorflow.Eager | |
| 22 | 22 | { | |
| 23 | - public sealed class SafeTensorHandleHandle : SafeTensorflowHandle | ||
| 23 | + public sealed class SafeEagerTensorHandle : SafeTensorflowHandle | ||
| 24 | 24 | { | |
| 25 | - private SafeTensorHandleHandle() | ||
| 25 | + private SafeEagerTensorHandle() | ||
| 26 | 26 | { | |
| 27 | 27 | } | |
| 28 | 28 | ||
| 29 | - public SafeTensorHandleHandle(IntPtr handle) | ||
| 29 | + public SafeEagerTensorHandle(IntPtr handle) | ||
| 30 | 30 | : base(handle) | |
| 31 | 31 | { | |
| 32 | 32 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -94,7 +94,7 @@ public partial class c_api | |||
| 94 | 94 | /// <param name="status">TF_Status*</param> | |
| 95 | 95 | /// <returns></returns> | |
| 96 | 96 | [DllImport(TensorFlowLibName)] | |
| 97 | - public static extern int TFE_OpAddInputList(SafeEagerOpHandle op, [In, MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(SafeHandleArrayMarshaler))] SafeTensorHandleHandle[] inputs, int num_inputs, SafeStatusHandle status); | ||
| 97 | + public static extern int TFE_OpAddInputList(SafeEagerOpHandle op, [In, MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(SafeHandleArrayMarshaler))] SafeEagerTensorHandle[] inputs, int num_inputs, SafeStatusHandle status); | ||
| 98 | 98 | ||
| 99 | 99 | /// <summary> | |
| 100 | 100 | /// | |
@@ -161,7 +161,7 @@ public partial class c_api | |||
| 161 | 161 | /// <param name="retvals"></param> | |
| 162 | 162 | /// <param name="num_retvals"></param> | |
| 163 | 163 | /// <param name="status"></param> | |
| 164 | - public static void TFE_Execute(SafeEagerOpHandle op, SafeTensorHandleHandle[] retvals, out int num_retvals, SafeStatusHandle status) | ||
| 164 | + public static void TFE_Execute(SafeEagerOpHandle op, SafeEagerTensorHandle[] retvals, out int num_retvals, SafeStatusHandle status) | ||
| 165 | 165 | { | |
| 166 | 166 | unsafe | |
| 167 | 167 | { | |
@@ -173,7 +173,7 @@ public static void TFE_Execute(SafeEagerOpHandle op, SafeTensorHandleHandle[] re | |||
| 173 | 173 | // A handle is created for every return, even if rawReturns[i] is null. The resulting handle will be | |
| 174 | 174 | // non-null but invalid, which is the same behavior P/Invoke gives for non-array SafeHandle return | |
| 175 | 175 | // values. | |
| 176 | - retvals[i] = new SafeTensorHandleHandle(rawReturns[i]); | ||
| 176 | + retvals[i] = new SafeEagerTensorHandle(rawReturns[i]); | ||
| 177 | 177 | } | |
| 178 | 178 | } | |
| 179 | 179 | } | |
@@ -295,18 +295,18 @@ public static void TFE_Execute(SafeEagerOpHandle op, SafeTensorHandleHandle[] re | |||
| 295 | 295 | /// <param name="h">TFE_TensorHandle*</param> | |
| 296 | 296 | /// <param name="status">TF_Status*</param> | |
| 297 | 297 | [DllImport(TensorFlowLibName)] | |
| 298 | - public static extern void TFE_OpAddInput(SafeEagerOpHandle op, SafeTensorHandleHandle h, SafeStatusHandle status); | ||
| 298 | + public static extern void TFE_OpAddInput(SafeEagerOpHandle op, SafeEagerTensorHandle h, SafeStatusHandle status); | ||
| 299 | 299 | ||
| 300 | 300 | /// <summary> | |
| 301 | 301 | /// | |
| 302 | 302 | /// </summary> | |
| 303 | 303 | /// <param name="t">const tensorflow::Tensor&</param> | |
| 304 | 304 | /// <returns>TFE_TensorHandle*</returns> | |
| 305 | 305 | [DllImport(TensorFlowLibName)] | |
| 306 | - public static extern SafeTensorHandleHandle TFE_NewTensorHandle(SafeTensorHandle t, SafeStatusHandle status); | ||
| 306 | + public static extern SafeEagerTensorHandle TFE_NewTensorHandle(SafeTensorHandle t, SafeStatusHandle status); | ||
| 307 | 307 | ||
| 308 | 308 | [DllImport(TensorFlowLibName)] | |
| 309 | - public static extern SafeTensorHandleHandle TFE_EagerTensorHandle(IntPtr t); | ||
| 309 | + public static extern SafeEagerTensorHandle TFE_EagerTensorHandle(IntPtr t); | ||
| 310 | 310 | ||
| 311 | 311 | /// <summary> | |
| 312 | 312 | /// Sets the default execution mode (sync/async). Note that this can be | |
@@ -323,7 +323,7 @@ public static void TFE_Execute(SafeEagerOpHandle op, SafeTensorHandleHandle[] re | |||
| 323 | 323 | /// <param name="h">TFE_TensorHandle*</param> | |
| 324 | 324 | /// <returns></returns> | |
| 325 | 325 | [DllImport(TensorFlowLibName)] | |
| 326 | - public static extern TF_DataType TFE_TensorHandleDataType(SafeTensorHandleHandle h); | ||
| 326 | + public static extern TF_DataType TFE_TensorHandleDataType(SafeEagerTensorHandle h); | ||
| 327 | 327 | ||
| 328 | 328 | /// <summary> | |
| 329 | 329 | /// This function will block till the operation that produces `h` has | |
@@ -334,7 +334,7 @@ public static void TFE_Execute(SafeEagerOpHandle op, SafeTensorHandleHandle[] re | |||
| 334 | 334 | /// <param name="status">TF_Status*</param> | |
| 335 | 335 | /// <returns></returns> | |
| 336 | 336 | [DllImport(TensorFlowLibName)] | |
| 337 | - public static extern SafeTensorHandle TFE_TensorHandleResolve(SafeTensorHandleHandle h, SafeStatusHandle status); | ||
| 337 | + public static extern SafeTensorHandle TFE_TensorHandleResolve(SafeEagerTensorHandle h, SafeStatusHandle status); | ||
| 338 | 338 | ||
| 339 | 339 | ||
| 340 | 340 | /// <summary> | |
@@ -344,10 +344,10 @@ public static void TFE_Execute(SafeEagerOpHandle op, SafeTensorHandleHandle[] re | |||
| 344 | 344 | /// <param name="status">TF_Status*</param> | |
| 345 | 345 | /// <returns></returns> | |
| 346 | 346 | [DllImport(TensorFlowLibName)] | |
| 347 | - public static extern int TFE_TensorHandleNumDims(SafeTensorHandleHandle h, SafeStatusHandle status); | ||
| 347 | + public static extern int TFE_TensorHandleNumDims(SafeEagerTensorHandle h, SafeStatusHandle status); | ||
| 348 | 348 | ||
| 349 | 349 | [DllImport(TensorFlowLibName)] | |
| 350 | - public static extern int TFE_TensorHandleDim(SafeTensorHandleHandle h, int dim, SafeStatusHandle status); | ||
| 350 | + public static extern int TFE_TensorHandleDim(SafeEagerTensorHandle h, int dim, SafeStatusHandle status); | ||
| 351 | 351 | ||
| 352 | 352 | /// <summary> | |
| 353 | 353 | /// Returns the device of the operation that produced `h`. If `h` was produced by | |
@@ -360,7 +360,7 @@ public static void TFE_Execute(SafeEagerOpHandle op, SafeTensorHandleHandle[] re | |||
| 360 | 360 | /// <param name="status">TF_Status*</param> | |
| 361 | 361 | /// <returns></returns> | |
| 362 | 362 | [DllImport(TensorFlowLibName)] | |
| 363 | - public static extern IntPtr TFE_TensorHandleDeviceName(SafeTensorHandleHandle h, SafeStatusHandle status); | ||
| 363 | + public static extern IntPtr TFE_TensorHandleDeviceName(SafeEagerTensorHandle h, SafeStatusHandle status); | ||
| 364 | 364 | ||
| 365 | 365 | /// <summary> | |
| 366 | 366 | /// Returns the name of the device in whose memory `h` resides. | |
@@ -369,7 +369,7 @@ public static void TFE_Execute(SafeEagerOpHandle op, SafeTensorHandleHandle[] re | |||
| 369 | 369 | /// <param name="status">TF_Status*</param> | |
| 370 | 370 | /// <returns></returns> | |
| 371 | 371 | [DllImport(TensorFlowLibName)] | |
| 372 | - public static extern IntPtr TFE_TensorHandleBackingDeviceName(SafeTensorHandleHandle h, SafeStatusHandle status); | ||
| 372 | + public static extern IntPtr TFE_TensorHandleBackingDeviceName(SafeEagerTensorHandle h, SafeStatusHandle status); | ||
| 373 | 373 | ||
| 374 | 374 | /// <summary> | |
| 375 | 375 | /// | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -67,9 +67,9 @@ public partial class Tensor : DisposableObject, | |||
| 67 | 67 | /// <summary> | |
| 68 | 68 | /// The DType of elements in this tensor. | |
| 69 | 69 | /// </summary> | |
| 70 | - public TF_DataType dtype => _handle == null ? _override_dtype : c_api.TF_TensorType(_handle); | ||
| 70 | + public virtual TF_DataType dtype => _handle == null ? _override_dtype : c_api.TF_TensorType(_handle); | ||
| 71 | 71 | public ulong bytesize => _handle == null ? 0 : c_api.TF_TensorByteSize(_handle); | |
| 72 | - public ulong dtypesize => _handle == null ? 0 : c_api.TF_DataTypeSize(dtype); | ||
| 72 | + public ulong dtypesize => (ulong)dtype.get_datatype_size(); | ||
| 73 | 73 | public ulong size => _handle == null ? 0 : bytesize / dtypesize; | |
| 74 | 74 | public IntPtr buffer => _handle == null ? IntPtr.Zero : c_api.TF_TensorData(_handle); | |
| 75 | 75 | public int num_consumers(TF_Output oper_out) => _handle == null ? 0 : c_api.TF_OperationOutputNumConsumers(oper_out); | |
@@ -88,11 +88,11 @@ public partial class Tensor : DisposableObject, | |||
| 88 | 88 | protected new SafeTensorHandle _handle; | |
| 89 | 89 | public SafeTensorHandle Handle => _handle; | |
| 90 | 90 | ||
| 91 | - protected SafeTensorHandleHandle _eagerTensorHandle; | ||
| 91 | + protected SafeEagerTensorHandle _eagerTensorHandle; | ||
| 92 | 92 | /// <summary> | |
| 93 | 93 | /// TFE_TensorHandle | |
| 94 | 94 | /// </summary> | |
| 95 | - public SafeTensorHandleHandle EagerTensorHandle => _eagerTensorHandle; | ||
| 95 | + public SafeEagerTensorHandle EagerTensorHandle => _eagerTensorHandle; | ||
| 96 | 96 | ||
| 97 | 97 | protected bool _isCreatedInGraphMode; | |
| 98 | 98 | ||
@@ -109,19 +109,7 @@ public Shape shape | |||
| 109 | 109 | if (rank < 0) | |
| 110 | 110 | return Shape.Null; | |
| 111 | 111 | ||
| 112 | - var dims = new Shape(new long[rank]); | ||
| 113 | - | ||
| 114 | - if (_handle == null) | ||
| 115 | - { | ||
| 116 | - c_api.TF_GraphGetTensorShape(op.graph, _as_tf_output(), dims, rank, tf.Status.Handle); | ||
| 117 | - } | ||
| 118 | - else | ||
| 119 | - { | ||
| 120 | - for (int i = 0; i < rank; i++) | ||
| 121 | - dims[i] = c_api.TF_Dim(_handle, i); | ||
| 122 | - } | ||
| 123 | - | ||
| 124 | - return dims; | ||
| 112 | + return GetShapeInternal(); | ||
| 125 | 113 | } | |
| 126 | 114 | ||
| 127 | 115 | set | |
@@ -142,6 +130,23 @@ public Shape shape | |||
| 142 | 130 | } | |
| 143 | 131 | } | |
| 144 | 132 | ||
| 133 | + protected virtual Shape GetShapeInternal() | ||
| 134 | + { | ||
| 135 | + var dims = new Shape(new long[rank]); | ||
| 136 | + | ||
| 137 | + if (_handle == null) | ||
| 138 | + { | ||
| 139 | + c_api.TF_GraphGetTensorShape(op.graph, _as_tf_output(), dims, rank, tf.Status.Handle); | ||
| 140 | + } | ||
| 141 | + else | ||
| 142 | + { | ||
| 143 | + for (int i = 0; i < rank; i++) | ||
| 144 | + dims[i] = c_api.TF_Dim(_handle, i); | ||
| 145 | + } | ||
| 146 | + | ||
| 147 | + return dims; | ||
| 148 | + } | ||
| 149 | + | ||
| 145 | 150 | public int[] _shape_tuple() | |
| 146 | 151 | { | |
| 147 | 152 | return rank < 0 ? null : shape.dims.Select(x => (int)x).ToArray(); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -56,10 +56,10 @@ protected void TF_SetAttrType(OperationDescription desc, string attrName, TF_Dat | |||
| 56 | 56 | protected void TF_SetAttrBool(OperationDescription desc, string attrName, bool value) | |
| 57 | 57 | => c_api.TF_SetAttrBool(desc, attrName, value); | |
| 58 | 58 | ||
| 59 | - protected TF_DataType TFE_TensorHandleDataType(SafeTensorHandleHandle h) | ||
| 59 | + protected TF_DataType TFE_TensorHandleDataType(SafeEagerTensorHandle h) | ||
| 60 | 60 | => c_api.TFE_TensorHandleDataType(h); | |
| 61 | 61 | ||
| 62 | - protected int TFE_TensorHandleNumDims(SafeTensorHandleHandle h, SafeStatusHandle status) | ||
| 62 | + protected int TFE_TensorHandleNumDims(SafeEagerTensorHandle h, SafeStatusHandle status) | ||
| 63 | 63 | => c_api.TFE_TensorHandleNumDims(h, status); | |
| 64 | 64 | ||
| 65 | 65 | protected TF_Code TF_GetCode(Status s) | |
@@ -80,7 +80,7 @@ protected IntPtr TF_TensorData(SafeTensorHandle t) | |||
| 80 | 80 | protected ulong TF_TensorByteSize(SafeTensorHandle t) | |
| 81 | 81 | => c_api.TF_TensorByteSize(t); | |
| 82 | 82 | ||
| 83 | - protected void TFE_OpAddInput(SafeEagerOpHandle op, SafeTensorHandleHandle h, SafeStatusHandle status) | ||
| 83 | + protected void TFE_OpAddInput(SafeEagerOpHandle op, SafeEagerTensorHandle h, SafeStatusHandle status) | ||
| 84 | 84 | => c_api.TFE_OpAddInput(op, h, status); | |
| 85 | 85 | ||
| 86 | 86 | protected void TFE_OpSetAttrType(SafeEagerOpHandle op, string attr_name, TF_DataType value) | |
@@ -95,10 +95,10 @@ protected void TFE_OpSetAttrString(SafeEagerOpHandle op, string attr_name, strin | |||
| 95 | 95 | protected SafeEagerOpHandle TFE_NewOp(SafeContextHandle ctx, string op_or_function_name, SafeStatusHandle status) | |
| 96 | 96 | => c_api.TFE_NewOp(ctx, op_or_function_name, status); | |
| 97 | 97 | ||
| 98 | - protected SafeTensorHandleHandle TFE_NewTensorHandle(SafeTensorHandle t, SafeStatusHandle status) | ||
| 98 | + protected SafeEagerTensorHandle TFE_NewTensorHandle(SafeTensorHandle t, SafeStatusHandle status) | ||
| 99 | 99 | => c_api.TFE_NewTensorHandle(t, status); | |
| 100 | 100 | ||
| 101 | - protected void TFE_Execute(SafeEagerOpHandle op, SafeTensorHandleHandle[] retvals, out int num_retvals, SafeStatusHandle status) | ||
| 101 | + protected void TFE_Execute(SafeEagerOpHandle op, SafeEagerTensorHandle[] retvals, out int num_retvals, SafeStatusHandle status) | ||
| 102 | 102 | => c_api.TFE_Execute(op, retvals, out num_retvals, status); | |
| 103 | 103 | ||
| 104 | 104 | protected SafeContextOptionsHandle TFE_NewContextOptions() | |
@@ -110,7 +110,7 @@ protected SafeContextHandle TFE_NewContext(SafeContextOptionsHandle opts, SafeSt | |||
| 110 | 110 | protected int TFE_OpGetInputLength(SafeEagerOpHandle op, string input_name, SafeStatusHandle status) | |
| 111 | 111 | => c_api.TFE_OpGetInputLength(op, input_name, status); | |
| 112 | 112 | ||
| 113 | - protected int TFE_OpAddInputList(SafeEagerOpHandle op, SafeTensorHandleHandle[] inputs, int num_inputs, SafeStatusHandle status) | ||
| 113 | + protected int TFE_OpAddInputList(SafeEagerOpHandle op, SafeEagerTensorHandle[] inputs, int num_inputs, SafeStatusHandle status) | ||
| 114 | 114 | => c_api.TFE_OpAddInputList(op, inputs, num_inputs, status); | |
| 115 | 115 | ||
| 116 | 116 | protected int TFE_OpGetOutputLength(SafeEagerOpHandle op, string input_name, SafeStatusHandle status) | |
@@ -125,13 +125,13 @@ protected SafeExecutorHandle TFE_ContextGetExecutorForThread(SafeContextHandle c | |||
| 125 | 125 | protected void TFE_ExecutorWaitForAllPendingNodes(SafeExecutorHandle executor, SafeStatusHandle status) | |
| 126 | 126 | => c_api.TFE_ExecutorWaitForAllPendingNodes(executor, status); | |
| 127 | 127 | ||
| 128 | - protected SafeTensorHandle TFE_TensorHandleResolve(SafeTensorHandleHandle h, SafeStatusHandle status) | ||
| 128 | + protected SafeTensorHandle TFE_TensorHandleResolve(SafeEagerTensorHandle h, SafeStatusHandle status) | ||
| 129 | 129 | => c_api.TFE_TensorHandleResolve(h, status); | |
| 130 | 130 | ||
| 131 | - protected string TFE_TensorHandleDeviceName(SafeTensorHandleHandle h, SafeStatusHandle status) | ||
| 131 | + protected string TFE_TensorHandleDeviceName(SafeEagerTensorHandle h, SafeStatusHandle status) | ||
| 132 | 132 | => c_api.StringPiece(c_api.TFE_TensorHandleDeviceName(h, status)); | |
| 133 | 133 | ||
| 134 | - protected string TFE_TensorHandleBackingDeviceName(SafeTensorHandleHandle h, SafeStatusHandle status) | ||
| 134 | + protected string TFE_TensorHandleBackingDeviceName(SafeEagerTensorHandle h, SafeStatusHandle status) | ||
| 135 | 135 | => c_api.StringPiece(c_api.TFE_TensorHandleBackingDeviceName(h, status)); | |
| 136 | 136 | ||
| 137 | 137 | protected SafeDeviceListHandle TFE_ContextListDevices(SafeContextHandle ctx, SafeStatusHandle status) | |
@@ -146,7 +146,7 @@ protected string TF_DeviceListType(SafeDeviceListHandle list, int index, SafeSta | |||
| 146 | 146 | protected string TF_DeviceListName(SafeDeviceListHandle list, int index, SafeStatusHandle status) | |
| 147 | 147 | => c_api.TF_DeviceListName(list, index, status); | |
| 148 | 148 | ||
| 149 | - protected SafeTensorHandleHandle TFE_TensorHandleCopyToDevice(SafeTensorHandleHandle h, SafeContextHandle ctx, string device_name, SafeStatusHandle status) | ||
| 149 | + protected SafeEagerTensorHandle TFE_TensorHandleCopyToDevice(SafeEagerTensorHandle h, SafeContextHandle ctx, string device_name, SafeStatusHandle status) | ||
| 150 | 150 | => c_api.TFE_TensorHandleCopyToDevice(h, ctx, device_name, status); | |
| 151 | 151 | ||
| 152 | 152 | protected void TFE_OpSetDevice(SafeEagerOpHandle op, string device_name, SafeStatusHandle status) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -32,7 +32,7 @@ static SafeContextHandle NewContext(bool async, SafeStatusHandle status) | |||
| 32 | 32 | { | |
| 33 | 33 | CHECK_EQ(TF_OK, TF_GetCode(status), TF_Message(status)); | |
| 34 | 34 | ||
| 35 | - var retvals = new SafeTensorHandleHandle[2]; | ||
| 35 | + var retvals = new SafeEagerTensorHandle[2]; | ||
| 36 | 36 | using (var m = TestMatrixTensorHandle()) | |
| 37 | 37 | using (var matmul = MatMulOp(ctx, m, m)) | |
| 38 | 38 | { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments