Expand Fortran supervised training interface coverage to more input/label and input/output dimension combinations. #79
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
During recent development, I noticed that the coverage of Fortran interfaces for supervised learning problems is overly restrictive, with respect to supported array dimensioning. In particular, the current interfaces only support input/label and input/output array pairings where both arrays are of equivalent rank. This is too restrictive for something like a classification problem, where the input might be a multi-dimensional field and the label/output might just be a single scalar classifier value. A savvy user could just allocate a Fortran array with singleton dimensions for the label/output in this case, but that is not very convenient.
This PR addresses this limitation by expanding the Fortran supervised learning interfaces to cover all input/label and input/output array dimensions combinations from 1D to 5D arrays. It is a lot of code added, but it is mostly just copy and pasted boilerplate.
Additionally, I updated to Fortran supervised API documentation to reflect this lifting of the rank-equivalent restriction I also removed statements about arrays requiring batch size dimensions or equivalent batch size dimensions at all, since that is not general requirement from TorchFort but instead something that would be imposed by the user model.