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

A bunch of constraints to AnyVectorArrayBuffer are too strict #254

Open
dabrahams opened this issue Dec 12, 2020 · 1 comment
Open

A bunch of constraints to AnyVectorArrayBuffer are too strict #254

dabrahams opened this issue Dec 12, 2020 · 1 comment

Comments

@dabrahams
Copy link
Collaborator

There are constraints on many AnyArrayBuffer where Dispatch == VectorArrayDispatch that really should be AnyArrayBuffer where Dispatch: VectorArrayDispatch. I couldn't get it to compile at the time but now that we have more parts working maybe we can figure out how to change these. Many are interrelated so one might need to change them all at once.

@dabrahams
Copy link
Collaborator Author

Maybe it has to do with:

extension AnyArrayBuffer: Differentiable where Dispatch: DifferentiableArrayDispatch {
  public typealias TangentVector = AnyVectorArrayBuffer
  ...
}

that typealias forces all tangent vectors of Differentiable-conforming AnyArrayBuffer<D>s to be exactly AnyArrayBuffer<VectorArrayDispatch>.

Instead we want something like:

extension AnyArrayBuffer: Differentiable 
where Dispatch: DifferentiableArrayDispatch, 
      TangentVector == AnyArrayBuffer<D> where D: VectorArrayDispatch 
{
     ...
}

Of course, that's not expressible in the language today; you need to use the protocol AnyArrayBufferProtocol hack to create the equivalent constraint.

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

1 participant