Skip to content

Commit 3474a85

Browse files
RayWang-iatOceania2018
authored andcommitted
Update Numpy.Math.cs
1 parent e9f2cac commit 3474a85

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/TensorFlowNET.Core/NumPy/Numpy.Math.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,16 @@ public partial class np
2828
public static NDArray multiply(NDArray x1, NDArray x2) => new NDArray(tf.multiply(x1, x2));
2929

3030
[AutoNumPy]
31-
public static NDArray maximum(NDArray x1, NDArray x2) => new NDArray(tf.maximum(x1, x2));
31+
//public static NDArray maximum(NDArray x1, NDArray x2) => new NDArray(tf.maximum(x1, x2));
32+
public static NDArray maximum(NDArray x1, NDArray x2, int? axis = null)
33+
{
34+
var maxValues = tf.maximum(x1, x2);
35+
if (axis.HasValue)
36+
{
37+
maxValues = tf.reduce_max(maxValues, axis: axis.Value);
38+
}
39+
return new NDArray(maxValues);
40+
}
3241

3342
[AutoNumPy]
3443
public static NDArray minimum(NDArray x1, NDArray x2) => new NDArray(tf.minimum(x1, x2));

0 commit comments

Comments
 (0)