diff --git a/docs/assets/eager-mode-add.png b/docs/assets/eager-mode-add.png new file mode 100644 index 00000000..e3700fa6 Binary files /dev/null and b/docs/assets/eager-mode-add.png differ diff --git a/src/TensorFlowNET.Core/Eager/pywrap_tfe_src.cs b/src/TensorFlowNET.Core/Eager/pywrap_tfe_src.cs index e1ea4744..c0f9430c 100644 --- a/src/TensorFlowNET.Core/Eager/pywrap_tfe_src.cs +++ b/src/TensorFlowNET.Core/Eager/pywrap_tfe_src.cs @@ -63,12 +63,11 @@ namespace Tensorflow.Eager var retVals = new IntPtr[num_retvals]; c_api.TFE_Execute(op, retVals, ref num_retvals, status); - var h = c_api.TFE_NewTensorHandle(retVals[0], status); - var data = new Tensor(h); + var t = c_api.TFE_TensorHandleResolve(retVals[0], status); status.Check(true); - } - throw new NotImplementedException(""); + return new EagerTensor(t); + } } /// diff --git a/src/TensorFlowNET.Core/Operations/gen_math_ops.cs b/src/TensorFlowNET.Core/Operations/gen_math_ops.cs index cb5b0eb6..c6a931d0 100644 --- a/src/TensorFlowNET.Core/Operations/gen_math_ops.cs +++ b/src/TensorFlowNET.Core/Operations/gen_math_ops.cs @@ -142,11 +142,10 @@ namespace Tensorflow public static EagerTensor add(Tensor x, Tensor y, string name = null) { - // _op_def_lib._apply_op_helper("Add", name, args: new { x, y }); - if (tf.context.executing_eagerly()) { var _result = pywrap_tfe_src.TFE_Py_FastPathExecute(tf.context, "", "Add", name, new[] { x, y }); + return _result; } return null;