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

Simplify stride interface with F or C layout #56

Open
ElliottKasoar opened this issue Oct 31, 2023 · 1 comment
Open

Simplify stride interface with F or C layout #56

ElliottKasoar opened this issue Oct 31, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@ElliottKasoar
Copy link
Contributor

This is not a high priority at the moment, but as discussed in #24, it would be good to improve the user friendliness of the stride functionality, through a F or C layout style and shape/size inference.

This should also be documented in (and potentially help clarify) the discussion about when to transpose arrays, in both the ResNet example and (soon) the long-form documentation.

@ElliottKasoar ElliottKasoar added the enhancement New feature or request label Oct 31, 2023
@jatkinson1000
Copy link
Member

If you look at the ftorch.f90 source there is a function t_t_from_array() (which should probably become torch_tensor_from_array) that assumes 'F' indexing and removes the need for the user to pass in the layout argument (used to set strides).

The idea of this is that is creates a tensor that can be read in with the same indexing in Torch without the user having to worry about it.

  1. This should be the default option to users and we should be VERY EXPLICIT in the docs that using this function you assume the same indexing in Fortran and Torch.
  2. We should look at if we can simplify the examples, making the use of torch_tensor_from_blob with layout an 'advanced' option
  3. This should be clearly set out in the README and API docs (see Add Long-form API documentation #53)

This was referenced Oct 31, 2023
@jatkinson1000 jatkinson1000 changed the title Simplify stride interface Simplify stride interface with F or C layout Mar 18, 2024
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