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

Look into typing Data and SupervisedData instances #765

Closed
db091756 opened this issue Sep 3, 2024 · 0 comments · Fixed by #878
Closed

Look into typing Data and SupervisedData instances #765

db091756 opened this issue Sep 3, 2024 · 0 comments · Fixed by #878
Assignees
Labels
enhancement New feature or request

Comments

@db091756
Copy link
Member

db091756 commented Sep 3, 2024

What's the new feature?

I think it would be very useful for developers and users to be able to type the array shapes in the Data and SupervisedData instances.

For example, if we want to type a function input we would do x: Data or x: SupervisedData. I think it would be nice to be able to type this something like x: Data[Shaped[Array, " n d"], Shaped[Array, " n"]] and x: SupervisedData[Shaped[Array, " n d"], Shaped[Array, " n p"], Shaped[Array, " n"]] , or just x: Data[" n d", "n"] and x: SupervisedData[" n d", " n p", "n"] .

I have no idea how much work this would be!

What value does this add?

Would make it clearer what our data instances contain.

Is there an alternative you've considered?

No response

Additional context

No response

@db091756 db091756 added enhancement New feature or request new Something yet to be discussed by development team and removed new Something yet to be discussed by development team labels Sep 3, 2024
@tc85324 tc85324 mentioned this issue Oct 2, 2024
9 tasks
tc85324 added a commit that referenced this issue Nov 24, 2024
Enables `Data` and `SupervisedData` instances to be given a type hint
that indicates the type and size of their respective `Data.data`
attributes.

For example: `x: Int[Data, "n d"] = ...`, indicates `x` is an instance
of `Data` whose `data` attribute is an integer array of shape `n d`.

Refs: #765
@tc85324 tc85324 self-assigned this Nov 25, 2024
tc85324 added a commit that referenced this issue Nov 25, 2024
Enables `Data` and `SupervisedData` instances to be given a type hint
that indicates the type and size of their respective `Data.data`
attributes.

For example: `x: Int[Data, "n d"] = ...`, indicates `x` is an instance
of `Data` whose `data` attribute is an integer array of shape `n d`.

Refs: #765
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

Successfully merging a pull request may close this issue.

2 participants