| @@ -23,7 +23,10 @@ namespace Tensorflow.NumPy | |||||
| public NDArray rand(params int[] shape) | public NDArray rand(params int[] shape) | ||||
| => throw new NotImplementedException(""); | => throw new NotImplementedException(""); | ||||
| public NDArray randint(long x) | |||||
| public NDArray randint(int low, int? high = null, Shape size = null, TF_DataType dtype = TF_DataType.TF_INT32) | |||||
| => throw new NotImplementedException(""); | |||||
| public NDArray normal(float loc = 0.0f, float scale = 1.0f, Shape size = null) | |||||
| => throw new NotImplementedException(""); | => throw new NotImplementedException(""); | ||||
| } | } | ||||
| } | } | ||||
| @@ -8,10 +8,16 @@ namespace Tensorflow.NumPy | |||||
| { | { | ||||
| public partial class np | public partial class np | ||||
| { | { | ||||
| [AutoNumPy] | |||||
| public static NDArray expand_dims(NDArray a, Axis? axis = null) => throw new NotImplementedException(""); | |||||
| [AutoNumPy] | [AutoNumPy] | ||||
| public static NDArray reshape(NDArray x1, Shape newshape) => x1.reshape(newshape); | public static NDArray reshape(NDArray x1, Shape newshape) => x1.reshape(newshape); | ||||
| [AutoNumPy] | [AutoNumPy] | ||||
| public static NDArray squeeze(NDArray x1, Axis? axis = null) => new NDArray(array_ops.squeeze(x1, axis)); | public static NDArray squeeze(NDArray x1, Axis? axis = null) => new NDArray(array_ops.squeeze(x1, axis)); | ||||
| [AutoNumPy] | |||||
| public static NDArray dstack(params NDArray[] tup) => throw new NotImplementedException(""); | |||||
| } | } | ||||
| } | } | ||||
| @@ -35,7 +35,11 @@ namespace Tensorflow.NumPy | |||||
| [AutoNumPy] | [AutoNumPy] | ||||
| public static NDArray full<T>(Shape shape, T fill_value) | public static NDArray full<T>(Shape shape, T fill_value) | ||||
| => new NDArray(tf.fill(tf.constant(shape), fill_value)); | |||||
| where T : unmanaged => new NDArray(tf.fill(tf.constant(shape), fill_value)); | |||||
| [AutoNumPy] | |||||
| public static NDArray full_like<T>(NDArray x, T fill_value, TF_DataType? dtype = null, Shape shape = null) | |||||
| where T : unmanaged => new NDArray(array_ops.fill(x.shape, constant_op.constant(fill_value))); | |||||
| [AutoNumPy] | [AutoNumPy] | ||||
| public static NDArray frombuffer(byte[] bytes, Shape shape, TF_DataType dtype) | public static NDArray frombuffer(byte[] bytes, Shape shape, TF_DataType dtype) | ||||
| @@ -49,7 +49,7 @@ namespace Tensorflow.Keras.Preprocessings | |||||
| if (shuffle) | if (shuffle) | ||||
| { | { | ||||
| if (!seed.HasValue) | if (!seed.HasValue) | ||||
| seed = np.random.randint((long)1e6); | |||||
| seed = np.random.randint((int)1e6); | |||||
| var random_index = np.arange(label_list.Count); | var random_index = np.arange(label_list.Count); | ||||
| tf.set_random_seed(seed.Value); | tf.set_random_seed(seed.Value); | ||||
| np.random.shuffle(random_index); | np.random.shuffle(random_index); | ||||