Skip to content
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

Fixes and follow-ups to two-sided broadcasting in arithmethic ops #936

Open
3 of 6 tasks
bluss opened this issue Mar 12, 2021 · 1 comment
Open
3 of 6 tasks

Fixes and follow-ups to two-sided broadcasting in arithmethic ops #936

bluss opened this issue Mar 12, 2021 · 1 comment

Comments

@bluss
Copy link
Member

bluss commented Mar 12, 2021

In #898 we left the following "known issues" open that we can fix after that PR's review and merge:

  • Rename BroadcastShape to DimMax - we also move the broadcast method out of the trait (it can just be a free function)
  • It is a wish that the D: Dimension + DimMax<E> bound in arith ops becomes just D: Dimension, i.e. the DimMax with associated type becomes implied by D: Dimension. At this point it is not certain how this can be done.
  • Preserve the allocation of the input array in arithmetic ops in more cases (when only the left/right side needs broadcast) in array + &array and &array + array
  • Preserve the allocation of the input array in arithmetic ops in more cases (when the left side needs broadcast in Array + Array)
  • Improve performance of "no-broadcasting-needed" scenario in &array + &array operation
  • Potentially provide public function or method similar to broadcast_with - that does the broadcasting of two arrays together.
@SparrowLii
Copy link
Contributor

Specialization can solve DimMax's problems:

impl<D1: Dimension, D2: Dimension> DimMax<D2> for D1 {
    default type Output = D1;
}

But it seems that there are still many problems to be solved before stability.

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

No branches or pull requests

2 participants