@@ -195,6 +195,9 @@ namespace Tensorflow | |||||
public static Tensor logical_not(Tensor x, string name = null) | public static Tensor logical_not(Tensor x, string name = null) | ||||
=> gen_math_ops.logical_not(x, name); | => gen_math_ops.logical_not(x, name); | ||||
public static Tensor logical_or(Tensor x, Tensor y, string name = null) | |||||
=> gen_math_ops.logical_or(x, y, name); | |||||
/// <summary> | /// <summary> | ||||
/// Clips tensor values to a specified min and max. | /// Clips tensor values to a specified min and max. | ||||
/// </summary> | /// </summary> | ||||
@@ -364,6 +364,13 @@ namespace Tensorflow | |||||
return _op.outputs[0]; | return _op.outputs[0]; | ||||
} | } | ||||
public static Tensor logical_or(Tensor x, Tensor y, string name = null) | |||||
{ | |||||
var _op = _op_def_lib._apply_op_helper("LogicalOr", name, args: new { x, y }); | |||||
return _op.outputs[0]; | |||||
} | |||||
public static Tensor squared_difference(Tensor x, Tensor y, string name = null) | public static Tensor squared_difference(Tensor x, Tensor y, string name = null) | ||||
{ | { | ||||
var _op = _op_def_lib._apply_op_helper("SquaredDifference", name, args: new { x, y, name }); | var _op = _op_def_lib._apply_op_helper("SquaredDifference", name, args: new { x, y, name }); | ||||
@@ -153,6 +153,15 @@ namespace TensorFlowNET.UnitTest | |||||
var o = sess.run(d); | var o = sess.run(d); | ||||
Assert.IsTrue(o.array_equal(check)); | Assert.IsTrue(o.array_equal(check)); | ||||
} | } | ||||
d = tf.cast(tf.logical_or(b, c), tf.int32); | |||||
check = np.array(new[] { 1, 1, 1, 1, 1, 1, 1, 1 }); | |||||
using (var sess = tf.Session()) | |||||
{ | |||||
var o = sess.run(d); | |||||
Assert.IsTrue(o.array_equal(check)); | |||||
} | |||||
} | } | ||||
[TestMethod] | [TestMethod] | ||||