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

Add einops like features to check_shapes? #3

Open
jesnie opened this issue May 19, 2022 · 0 comments
Open

Add einops like features to check_shapes? #3

jesnie opened this issue May 19, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@jesnie
Copy link
Member

jesnie commented May 19, 2022

einops are cool. However, at the time of this writing they don't really work with TensorFlow.

check_shapes already collects a bunch of information about tensor shapes - maybe that would be useful for einops-like operations:

@check_shapes(
    "x: [N, D]",
)
def foo(x):
    reshape(x, "[1, N*D]")  # <-- We already know, from the `check_shapes` annotation, what `N` and `D` are.

Complications would be:

  1. Currently check_shapes can be disabled. How do we reshape stuff if we don't learn the shapes of stuff, because shape checking is disabled? Maybe we need a flag to pass to check_shapes to force it enabled?
  2. Currently check_shapes only do best-effort shape checking. For example it doesn't check compiled TensorFlow code. Again, what do we do if an object has "unknown" shape?
@jesnie jesnie added the enhancement New feature or request label May 19, 2022
@jesnie jesnie transferred this issue from GPflow/GPflow Sep 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant