Browse Source

Add np.add and np.random.uniform

pull/919/head
MPnoy 3 years ago
parent
commit
cd539d49d2
2 changed files with 7 additions and 0 deletions
  1. +4
    -0
      src/TensorFlowNET.Core/NumPy/Implementation/RandomizedImpl.cs
  2. +3
    -0
      src/TensorFlowNET.Core/NumPy/Numpy.Math.cs

+ 4
- 0
src/TensorFlowNET.Core/NumPy/Implementation/RandomizedImpl.cs View File

@@ -43,5 +43,9 @@ namespace Tensorflow.NumPy
[AutoNumPy]
public NDArray normal(float loc = 0.0f, float scale = 1.0f, Shape size = null)
=> new NDArray(random_ops.random_normal(size ?? Shape.Scalar, mean: loc, stddev: scale));

[AutoNumPy]
public NDArray uniform(float low = 0.0f, float high = 1.0f, Shape size = null)
=> new NDArray(random_ops.random_uniform(size ?? Shape.Scalar, low, high));
}
}

+ 3
- 0
src/TensorFlowNET.Core/NumPy/Numpy.Math.cs View File

@@ -52,5 +52,8 @@ namespace Tensorflow.NumPy

[AutoNumPy]
public static NDArray sum(NDArray x1, Axis? axis = null) => new NDArray(tf.math.sum(x1, axis));

[AutoNumPy]
public static NDArray add(NDArray x, NDArray y) => new NDArray(math_ops.add(x, y));
}
}

Loading…
Cancel
Save