Skip to content

[LAYOUTS] Implement divideLeft#6576

Closed
lezcano wants to merge 2 commits intomainfrom
use_divide
Closed

[LAYOUTS] Implement divideLeft#6576
lezcano wants to merge 2 commits intomainfrom
use_divide

Conversation

@lezcano
Copy link
Copy Markdown
Contributor

@lezcano lezcano commented Apr 23, 2025

Finally got around to implement divideLeft. I rescued and adapted the
divideRight tests from #5170
and added a few more.

As discussed in the inline comment, there is some ambiguity when it
comes to define the quotient if the quotient has dimensions of size one.
You can basically keep them or remove them and both of them would give
you a LinearLayout such that A = B * C. We choose to keep them, as
removing them would make the behaviour too unpredictable. The invariant
here is that the dimensions of the result of leftDivide are the same
as the dimensions of the left input. The right input may have less
dimensions than the right input tho.

lezcano added 2 commits April 23, 2025 13:27
Finally got around to implement `divideLeft`. I rescued and adapted the
`divideRight` tests from #5170
and added a few more.

As discussed in the inline comment, there is some ambiguity when it
comes to define the quotient if the quotient has dimensions of size one.
You can basically keep them or remove them and both of them would give
you a LinearLayout such that `A = B * C`. We choose to keep them, as
removing them would make the behaviour too unpredictable. The invariant
here is that the dimensions of the result of `leftDivide` are the same
as the dimensions of the left input. The right input may have less
dimensions than the right input tho.
Now the duality between forward and backward pass should be crystal
clear
@lezcano lezcano requested a review from ptillet as a code owner April 23, 2025 14:33
@lezcano lezcano closed this Apr 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant