MCPcopy Index your code
hub / github.com/dmlc/xgboost / IterForCacheTest

Class IterForCacheTest

tests/python/test_data_iterator.py:200–215  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

198
199
200class IterForCacheTest(xgb.DataIter):
201 def __init__(
202 self, x: np.ndarray, y: np.ndarray, w: np.ndarray, release_data: bool
203 ) -> None:
204 self.kwargs = {"data": x, "label": y, "weight": w}
205 super().__init__(release_data=release_data)
206
207 def next(self, input_data: Callable) -> bool:
208 if self.it == 1:
209 return False
210 self.it += 1
211 input_data(**self.kwargs)
212 return True
213
214 def reset(self) -> None:
215 self.it = 0
216
217
218def test_data_cache() -> None:

Callers 1

test_data_cacheFunction · 0.85

Calls

no outgoing calls

Tested by 1

test_data_cacheFunction · 0.68