Skip to content

Commit

Permalink
Fix capped manager on Tf engine (#1952)
Browse files Browse the repository at this point in the history
* fix_capped_manager_on_Tf_engine
  • Loading branch information
KexinFeng authored Aug 25, 2022
1 parent 085741a commit e21b1ac
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ public class LgbmNDArray extends NDArrayAdapter {
handle = new AtomicReference<>();
}

/** {@inheritDoc} */
@Override
public void returnResource(NDManager manager) {
detach();
this.manager = manager;
manager.attachUncappedInternal(getUid(), this);
}

/**
* Returns the native LightGBM handle to the array.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,14 @@ public void intern(NDArray replaced) {
format = array.format;
}

/** {@inheritDoc} */
@Override
public void returnResource(NDManager manager) {
detach();
this.manager = manager;
manager.attachUncappedInternal(getUid(), this);
}

/** {@inheritDoc} */
@Override
public void detach() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,14 @@ public void attach(NDManager manager) {
manager.attachInternal(getUid(), this);
}

/** {@inheritDoc} */
@Override
public void returnResource(NDManager manager) {
detach();
this.manager = (TfNDManager) manager;
manager.attachUncappedInternal(getUid(), this);
}

/** {@inheritDoc} */
@Override
public void tempAttach(NDManager manager) {
Expand Down

0 comments on commit e21b1ac

Please sign in to comment.