Browse Source

Update gen_math_ops.cs

tags/keras_v0.3.0
dataangel Haiping 4 years ago
parent
commit
71f569b84d
1 changed files with 12 additions and 2 deletions
  1. +12
    -2
      src/TensorFlowNET.Core/Operations/gen_math_ops.cs

+ 12
- 2
src/TensorFlowNET.Core/Operations/gen_math_ops.cs View File

@@ -1,4 +1,4 @@
/*****************************************************************************
/*****************************************************************************
Copyright 2018 The TensorFlow.NET Authors. All Rights Reserved. Copyright 2018 The TensorFlow.NET Authors. All Rights Reserved.


Licensed under the Apache License, Version 2.0 (the "License"); 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) 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 }); var _op = tf.OpDefLib._apply_op_helper("SquaredDifference", name, args: new { x, y, name });


return _op.outputs[0]; return _op.outputs[0];
@@ -1210,4 +1220,4 @@ namespace Tensorflow
return _op.outputs[0]; return _op.outputs[0];
} }
} }
}
}

Loading…
Cancel
Save