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

Improve TrackedFloat-wrapping functions #20

Open
ashton314 opened this issue May 24, 2023 · 3 comments
Open

Improve TrackedFloat-wrapping functions #20

ashton314 opened this issue May 24, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@ashton314
Copy link
Member

Per discussion on RXInfer.jl#116 it would be nice to have some functions to make it easier to wrap inputs in the TrackedFloat type.

@ashton314 ashton314 added the enhancement New feature or request label May 24, 2023
@bennn
Copy link
Member

bennn commented May 24, 2023

Concretely:

  1. track(x) to traverse the array x and replace all floats with TFs. Use TrackedFloat64 as the default but allow changes.
  2. @track foo(...) to replace all Float-like types in the function signature with TF

Is 2 needed? I'm thinking no, because TF is a subtype of the matching floats and the type alone doesn't do any converting. (foo(4.2) would be an error).

@ashton314
Copy link
Member Author

I think it'd be neat for 2 if we could hijack the original function so if it gets called with non-TrackedFloats, we wrap it and then call again.

@bennn
Copy link
Member

bennn commented May 25, 2023

Yes, that'd be great! Just like a Python decorator.

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

2 participants