|
|
|
@@ -1,6 +1,7 @@ |
|
|
|
using System; |
|
|
|
using System.Collections; |
|
|
|
using System.Collections.Generic; |
|
|
|
using System.Globalization; |
|
|
|
using System.Numerics; |
|
|
|
using System.Text; |
|
|
|
|
|
|
|
@@ -9,11 +10,11 @@ namespace Tensorflow.NumPy |
|
|
|
public partial class np |
|
|
|
{ |
|
|
|
[AutoNumPy] |
|
|
|
public static NDArray argmax(NDArray a, Axis axis = null) |
|
|
|
public static NDArray argmax(NDArray a, Axis? axis = null) |
|
|
|
=> new NDArray(math_ops.argmax(a, axis ?? 0)); |
|
|
|
|
|
|
|
[AutoNumPy] |
|
|
|
public static NDArray argsort(NDArray a, Axis axis = null) |
|
|
|
public static NDArray argsort(NDArray a, Axis? axis = null) |
|
|
|
=> new NDArray(sort_ops.argsort(a, axis: axis ?? -1)); |
|
|
|
|
|
|
|
[AutoNumPy] |
|
|
|
@@ -25,5 +26,22 @@ namespace Tensorflow.NumPy |
|
|
|
|
|
|
|
[AutoNumPy] |
|
|
|
public static void shuffle(NDArray x) => np.random.shuffle(x); |
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// Sorts a ndarray |
|
|
|
/// </summary> |
|
|
|
/// <param name="values"></param> |
|
|
|
/// <param name="axis"> |
|
|
|
/// The axis along which to sort. The default is -1, which sorts the last axis. |
|
|
|
/// </param> |
|
|
|
/// <param name="direction"> |
|
|
|
/// The direction in which to sort the values (`'ASCENDING'` or `'DESCENDING'`) |
|
|
|
/// </param> |
|
|
|
/// <returns> |
|
|
|
/// A `NDArray` with the same dtype and shape as `values`, with the elements sorted along the given `axis`. |
|
|
|
/// </returns> |
|
|
|
[AutoNumPy] |
|
|
|
public static NDArray sort(NDArray values, Axis? axis = null, string direction = "ASCENDING") |
|
|
|
=> new NDArray(sort_ops.sort(values, axis: axis ?? -1, direction: direction)); |
|
|
|
} |
|
|
|
} |