Skip to content

tf.linalg.bandPart #2226

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 19 commits into from
Nov 22, 2019
Merged

tf.linalg.bandPart #2226

merged 19 commits into from
Nov 22, 2019

Conversation

DirkToewe
Copy link
Contributor

@DirkToewe DirkToewe commented Oct 17, 2019

Implementation of tf.linalg.bandPart a.k.a. tf.matrixBandPart, based purely on other TFJS ops. No additional backend kernels are added. The performance should still be goodish enough compared to custom kernels.

@Kriyszig deserves credit for the documentation and most of the tests.


This change is Reviewable

@googlebot
Copy link

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@Kriyszig
Copy link
Contributor

Great work @DirkToewe
Thanks a lot :octocat:

@Kriyszig
Copy link
Contributor

@googlebot I consent

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@annxingyuan annxingyuan self-requested a review October 18, 2019 13:32
@annxingyuan
Copy link
Contributor

Thank you, @Kriyszig @DirkToewe ! I will try to review this within the next few days!

Copy link
Contributor

@annxingyuan annxingyuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey I'm so sorry about the tremendous delay on this review... I just left a few tiny comments :)


return ENGINE.tidy( () => {
const $a = convertToTensor(a,'a','bandPart');
a = undefined;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why set a to undefined?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea was to prevent myself from using a instead of $a in the remaining lines of code. It was meant for assertion purposes only and does not belong in the final commit. I'm going to remove it.

Copy link
Contributor Author

@DirkToewe DirkToewe Nov 21, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I am not mistaken, the ENGINE.tidy is redundant, right? op({_bandPart}) already adds a scope which disposes the local tensors. I've removed it while I was at it (hope I'm not mistaken).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the ENGINE.tidy would have been redundant. Thanks!

  * Removed ENGINE.tidy from _bandPart() (op({_bandPart})) already tidies up
  * Removed three cases of duplicate tests
@DirkToewe
Copy link
Contributor Author

I've changed expectArraysEqual to expectArraysClose. Hope I didn't forget anything.

Thank You so much for taking the time for the code reviews.

@annxingyuan
Copy link
Contributor

hey @DirkToewe I'm having trouble viewing our CI logs right now... could you just make sure yarn lint / yarn test pass locally?

@DirkToewe
Copy link
Contributor Author

DirkToewe commented Nov 21, 2019

Just checked one more time:

  • yarn lint passes
  • yarn test --grep=bandPart Executed 39 of 10729 (skipped 10690) SUCCESS (3*13 tests is the correct number)
  • yarn test Executed 10711 of 10729 (skipped 18) SUCCESS (Are the 18 skips are normal?)

The CI tests seem to have passed now. Maybe there is an issue with tests timing out?

Edit: I could try to reduce the number of assertions in the last test and/or split it up.

@annxingyuan annxingyuan merged commit 833041d into tensorflow:master Nov 22, 2019
@DirkToewe DirkToewe deleted the bandpart branch November 22, 2019 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants