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

make all functions generic over f32 and f64 #19

Open
skewballfox opened this issue Jan 8, 2023 · 1 comment
Open

make all functions generic over f32 and f64 #19

skewballfox opened this issue Jan 8, 2023 · 1 comment
Labels
enhancement New feature or request librosa_compat related to ensuring compatibility with librosa's mel spectrogram and mfcc implementation

Comments

@skewballfox
Copy link
Collaborator

Probably should hold off on this until we have some benchmarking code within rust. There are use cases where f32 would be preferred. If possible, we should make the functions generic over f32 and f64, preferably in a way that wouldn't require specifying types user-side. We can use num_traits for specifying the type. So far the type definition I have that works in the bit of code I tested it with is

where F: Float + NumOps + std::convert::From<f32>

the from<f32> is so that we can autoconvert primitives used in computation like 2.0_f32 as F which IMO isn't as ugly as F::from(2.0).unwrap()

potentially useful links:

@skewballfox
Copy link
Collaborator Author

there's also a section from programming rust that deals with this, I'd definitely recommend checking it out if someone wants to tackle this before me

@skewballfox skewballfox added enhancement New feature or request librosa_compat related to ensuring compatibility with librosa's mel spectrogram and mfcc implementation labels Jul 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request librosa_compat related to ensuring compatibility with librosa's mel spectrogram and mfcc implementation
Projects
Status: 🆕 New
Development

No branches or pull requests

1 participant