You can not select more than 25 topics
Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- using System;
- using System.Collections.Generic;
- using System.Text;
-
- namespace TensorFlowNET.Examples.Utility
- {
- public static class ArrayShuffling
- {
- public static T[] Shuffle<T>(this Random rng, T[] array)
- {
- int n = array.Length;
- while (n > 1)
- {
- int k = rng.Next(n--);
- T temp = array[n];
- array[n] = array[k];
- array[k] = temp;
- }
- return array;
- }
- }
- }
|