diff --git a/src/TensorFlowNET.Core/Operations/gen_math_ops.cs b/src/TensorFlowNET.Core/Operations/gen_math_ops.cs index fa74bffe..67b5b614 100644 --- a/src/TensorFlowNET.Core/Operations/gen_math_ops.cs +++ b/src/TensorFlowNET.Core/Operations/gen_math_ops.cs @@ -1,4 +1,4 @@ -/***************************************************************************** +/***************************************************************************** Copyright 2018 The TensorFlow.NET Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); @@ -619,6 +619,16 @@ namespace Tensorflow public static Tensor squared_difference(Tensor x, Tensor y, string name = null) { + if (tf.Context.executing_eagerly()) + { + var results = tf.Runner.TFE_FastPathExecute(tf.Context, tf.Context.DeviceName, + "SquaredDifference", name, + null, + x,y); + + return results[0]; + } + var _op = tf.OpDefLib._apply_op_helper("SquaredDifference", name, args: new { x, y, name }); return _op.outputs[0]; @@ -1210,4 +1220,4 @@ namespace Tensorflow return _op.outputs[0]; } } -} \ No newline at end of file +}