Skip to content

Commit 668af61

Browse files
MPnoyOceania2018
authored andcommitted
Add np.add and np.random.uniform
1 parent 10fda1f commit 668af61

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/TensorFlowNET.Core/NumPy/Implementation/RandomizedImpl.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,9 @@ public NDArray randn(params int[] shape)
4343
[AutoNumPy]
4444
public NDArray normal(float loc = 0.0f, float scale = 1.0f, Shape size = null)
4545
=> new NDArray(random_ops.random_normal(size ?? Shape.Scalar, mean: loc, stddev: scale));
46+
47+
[AutoNumPy]
48+
public NDArray uniform(float low = 0.0f, float high = 1.0f, Shape size = null)
49+
=> new NDArray(random_ops.random_uniform(size ?? Shape.Scalar, low, high));
4650
}
4751
}

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,8 @@ public static NDArray prod<T>(params T[] array) where T : unmanaged
5252

5353
[AutoNumPy]
5454
public static NDArray sum(NDArray x1, Axis? axis = null) => new NDArray(tf.math.sum(x1, axis));
55+
56+
[AutoNumPy]
57+
public static NDArray add(NDArray x, NDArray y) => new NDArray(math_ops.add(x, y));
5558
}
5659
}

0 commit comments

Comments
 (0)