1 write to _cache
Microsoft.ML.Core (1)
Utilities\ReservoirSampler.cs (1)
156
_cache
= new T[size];
12 references to _cache
Microsoft.ML.Core (12)
Utilities\ReservoirSampler.cs (12)
145
public int Size { get { return _numSampled <=
_cache
.Length ? (int)_numSampled :
_cache
.Length; } }
169
if (_numSampled <=
_cache
.Length)
171
_getter(ref
_cache
[_numSampled - 1]);
174
if (_numSampled ==
_cache
.Length)
176
for (int i = 0; i <
_cache
.Length; i++)
178
_reservoir[i] = _rnd.Next(
_cache
.Length);
186
int k = Stats.SampleFromBinomial(_rnd,
_cache
.Length, 1.0 / _numSampled);
203
_getter(ref
_cache
[_reservoir[ind]]);
225
return
_cache
;
233
for (int i = 0; i <
_cache
.Length; i++)
251
yield return
_cache
[ind];