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

Reorganise main mod #217

Merged
merged 7 commits into from
Jan 10, 2025
Merged

Reorganise main mod #217

merged 7 commits into from
Jan 10, 2025

Conversation

jwallwork23
Copy link
Contributor

To follow #76.

This PR reorganises the main FTorch module to group things more logically:

  1. Datatypes
  2. Interfaces for core FTorch functionality
  3. Interfaces for operator overloading of tensors
  4. Procedures for constructing tensors
  5. Procedures for interrogating tensors
  6. Procedures for deallocating tensors
  7. Overloaded operators for tensors
  8. Torch model API

This PR also drops unnecessary imports and makes it so that the device_index argument can be passed as a Fortran integer rather than a c_int.

@jwallwork23 jwallwork23 self-assigned this Jan 6, 2025
@jwallwork23 jwallwork23 marked this pull request as ready for review January 6, 2025 17:17
Copy link
Member

@TomMelt TomMelt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jwallwork23 , this is a simple improvement and helps with maintainability.

My only concern is relating to the recently changed int32 types which have now been converted to ftorch_int (which defaults to int32 but could in theory change).

src/ftorch.fypp Outdated Show resolved Hide resolved
@jwallwork23 jwallwork23 requested a review from TomMelt January 7, 2025 11:34
Copy link
Member

@TomMelt TomMelt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jwallwork23 , LGTM now 🚀

Copy link
Member

@jatkinson1000 jatkinson1000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I am in agreement that this is a good idea and happy.

Only suggestion would be to perhaps make the section headers even more obvious e.g.

! =============================================
! = --- Derived types and enums                                              =
! =============================================

To stand out when people are browsing the source.

@jwallwork23
Copy link
Contributor Author

Only suggestion would be to perhaps make the section headers even more obvious e.g.

! =============================================
! = --- Derived types and enums                                              =
! =============================================

To stand out when people are browsing the source.

Addressed in c2e9c1b.

Copy link
Member

@jatkinson1000 jatkinson1000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Go for it.

@jwallwork23 jwallwork23 merged commit 72a7339 into main Jan 10, 2025
5 checks passed
@jwallwork23 jwallwork23 deleted the reorganise-main-mod branch January 10, 2025 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants