Skip to content

Commit

Permalink
remove circular reference in DataIter (dmlc#11177)
Browse files Browse the repository at this point in the history
Co-authored-by: Taewoo Kim <[email protected]>
  • Loading branch information
oOTWK and Taewoo Kim authored Jan 20, 2025
1 parent 33a3da2 commit 7c69d92
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions python-package/xgboost/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -508,15 +508,15 @@ def __init__(
def get_callbacks(self, enable_categorical: bool) -> Tuple[Callable, Callable]:
"""Get callback functions for iterating in C. This is an internal function."""
assert hasattr(self, "cache_prefix"), "__init__ is not called."
self._reset_callback = ctypes.CFUNCTYPE(None, ctypes.c_void_p)(
reset_callback = ctypes.CFUNCTYPE(None, ctypes.c_void_p)(
self._reset_wrapper
)
self._next_callback = ctypes.CFUNCTYPE(
next_callback = ctypes.CFUNCTYPE(
ctypes.c_int,
ctypes.c_void_p,
)(self._next_wrapper)
self._enable_categorical = enable_categorical
return self._reset_callback, self._next_callback
return reset_callback, next_callback

@property
def proxy(self) -> "_ProxyDMatrix":
Expand Down

0 comments on commit 7c69d92

Please sign in to comment.