|
|
|
|
|
by l-m-z
2713 days ago
|
|
(I'm obviously biased as being the author of ocaml-torch)
Using functional programming is not of much help for size mismatches, the current bindings don't even use the type system to check the number of dimensions - although that should be reasonably easy to add. Maybe a better approach to help with this would be tensors with named dimensions http://nlp.seas.harvard.edu/NamedTensor It's possible that a strong type system would help here but I don't think there have been much attempts. However when using the Python api I often have errors because of:
- Unused variables when refactoring my code, which are just me forgetting to use some parameters.
- Comparing things of different types (and Python does not report any error and just return that they are different).
- Making changes to some helper functions without adapting all the projects where I'm using them.
Using a good Python linter probably helps with these, but that's a place where languages like ocaml naturally shine. |
|