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

Static awareness of value_size where possible #65

Open
tpgillam opened this issue Aug 4, 2022 · 0 comments
Open

Static awareness of value_size where possible #65

tpgillam opened this issue Aug 4, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@tpgillam
Copy link
Owner

tpgillam commented Aug 4, 2022

Suppose there exists a function value_size, which can take a node. Ideally it would have the following behaviour:

alignment = pulse(Hour(1))

y1 = rand(alignment, 5)
y2 = rand(alignment, 1, 3)

@assert value_size(y1) == (5,)
@assert value_size(y2) == (1, 3)

z1 = wrap(.+)(y1, y2)
@assert value_size(z1) == (5, 3)

y3 = rand(alignment, 3)
wrap(.+)(y1, y3)  # This should throw an exception

This requires an awareness of functions:

  • whose output size can be uniquely determined from type & size information of inputs.
  • which can be known to throw an exception unless argument types and sizes satisfy some property.
@tpgillam tpgillam added the enhancement New feature or request label Aug 9, 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