1 write to _cache
Microsoft.ML.Core (1)
Utilities\ReservoirSampler.cs (1)
77
_cache
= new T[size];
9 references to _cache
Microsoft.ML.Core (9)
Utilities\ReservoirSampler.cs (9)
66
public int Size { get { return _numSampled <=
_cache
.Length ? (int)_numSampled :
_cache
.Length; } }
89
if (_numSampled <=
_cache
.Length)
90
_getter(ref
_cache
[_numSampled - 1]);
91
else if (_rnd.NextDouble() * _numSampled <
_cache
.Length)
94
int ind = _rnd.Next(
_cache
.Length);
95
_getter(ref
_cache
[ind]);
114
if (i ==
_cache
.Length)
116
yield return
_cache
[i];