Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Create einsum operation #197
Create einsum operation #197
Changes from 31 commits
95f670f
2cfa0ef
f499573
ce91d48
05fa3c4
6cd3b1b
b167619
4589c6d
7154b5a
5672ea8
c8173b0
31ae88b
29c8392
decdfbe
7f4285c
f94234a
fc93d3b
1060621
5a7805f
b0d8c45
d01ae74
21ec6bd
a8ec295
7590a77
27e8ebd
102e732
fc076fa
a12071d
555484e
082aec0
eaa57c8
33ecafa
7abee99
52da9e5
43a8ef3
291a777
ed0038f
ceb33ab
5ab5c0d
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
want to understand why it looks so strange in tf.keras
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if I was interpreting the symbolic (layer=True) backends correctly or not.
Basically, this
einsum
assumes thex
tensors have a leading batch axis, which are assumed to not be specified in the pattern. I assumed this because thecreate_symbol
method specifies the shape as a batch shape, rather than an absolute shape. Is that correct, or should it assume the pattern also specifies the batch axis?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I think my implementation has a potential issue: if one symbol is batched, and one symbol is not (like a weight matrix).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think the correct strategy is here? Should I avoid adding
einsum
for keras, since it is technically alayer=True
backend?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
layer=True just refers to providing layers, it should not be related to any batch variables, and patterns should include batch variables. Anyway, I forgot keras now just a redirection to TF layers, so just excluded this part