Browse Source

add overload for math.logical_and.

tags/v0.30
Oceania2018 4 years ago
parent
commit
67a661a1a3
2 changed files with 16 additions and 2 deletions
  1. +3
    -0
      src/TensorFlowNET.Core/APIs/tf.math.cs
  2. +13
    -2
      src/TensorFlowNET.Core/Operations/gen_math_ops.cs

+ 3
- 0
src/TensorFlowNET.Core/APIs/tf.math.cs View File

@@ -211,6 +211,9 @@ namespace Tensorflow
public Tensor logical_and(Tensor x, Tensor y, string name = null)
=> gen_math_ops.logical_and(x, y, name);

public Tensor logical_and(bool x, bool y, string name = null)
=> gen_math_ops.logical_and(x, y, name);

public Tensor logical_not(Tensor x, string name = null)
=> gen_math_ops.logical_not(x, name);



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

@@ -578,10 +578,21 @@ namespace Tensorflow
x);

public static Tensor logical_and(Tensor x, Tensor y, string name = null)
=> tf.OpDefLib._apply_op_helper("LogicalAnd", name, args: new { x, y });

public static Tensor logical_and(bool x, bool y, string name = null)
{
var _op = tf.OpDefLib._apply_op_helper("LogicalAnd", name, args: new { x, y });
if (tf.Context.executing_eagerly())
{
var results = tf.Runner.TFE_FastPathExecute(tf.Context, tf.Context.DeviceName,
"LogicalAnd", name,
null,
x, y);

return _op.outputs[0];
return results[0];
}

return tf.OpDefLib._apply_op_helper("LogicalAnd", name, args: new { x, y });
}

public static Tensor logical_not(Tensor x, string name = null)


Loading…
Cancel
Save