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

Enable Shape Arithmetic #87

Open
ryanmrichard opened this issue Jul 11, 2022 · 0 comments
Open

Enable Shape Arithmetic #87

ryanmrichard opened this issue Jul 11, 2022 · 0 comments

Comments

@ryanmrichard
Copy link
Member

Issue Description

Eventually we're going to have to propagate Shape and Allocator instances through the expression layer. This issue is for Shape.

IMHO propagation is easier if we define arithmetic operations for Shape. For example:

// Let these be the shapes for tensors A, B, and C respectively
Shape a, b, c;

// Now if we want c to be the shape C has after doing C("i,j") = A("i,j") + B("i,j")
// we compute that by:
a.add("i,j", "i,j", c, "i,j", b);

The syntax here mirrors that of the Buffer class.

For implementing the arithmetic it's a matter of working out the dimensions given the input indices and the operation. The trickiest part is going to be accounting for sparsity in the derived class if need be.

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