FTorch icon indicating copy to clipboard operation
FTorch copied to clipboard

Implement `torch_tensor_to_array`

Open joewallwork opened this issue 1 year ago • 4 comments

FTorch implements torch_tensor_from_array to map Fortran arrays to (F)Torch tensors. It would be useful to have the reverse mapping, too.

This would provide a way to get around the issue mentioned in #139.

joewallwork avatar Jul 03 '24 11:07 joewallwork

Good idea. Would it be worth having an alias for it as well called torch_array_from_tensor?

dorchard avatar Jul 03 '24 12:07 dorchard

Good idea. Would it be worth having an alias for it as well called torch_array_from_tensor?

Sure, I guess torch_array_to_tensor would then complete the set.

joewallwork avatar Jul 03 '24 12:07 joewallwork

Inderdaad.

dorchard avatar Jul 03 '24 12:07 dorchard

Interesting, I always read it as being "create a torch_tensor from a fortran_array" and this is how we refer to things in our docs - and we have an object called a torch_tensor.

I feel like torch_array from tensor could be ambiguous on this front.

However, I feel like all our routines all being prepended with torch_ is nice too...

jatkinson1000 avatar Jul 03 '24 13:07 jatkinson1000