dfalbel / torch

torch from R!
http://dfalbel.github.io/torch
Other
50 stars 5 forks source link

Make float32 default float type #12

Closed dselivanov closed 5 years ago

dselivanov commented 5 years ago

I believe it makes sense to make kFloat as default type for numeric values. Reasons are following:

Also may be we should follow numpy naming conventions for dtype - float32, float64, etc

dfalbel commented 5 years ago

I agree. I will work on this. I think this will add one copy ( https://pytorch.org/docs/stable/tensors.html#torch.Tensor.to ) but faster computation should compensate.

Also agree with numpy naming.

dfalbel commented 5 years ago

Now float32 is the default numeric type. I will make sure that when we add a dtype = "float64" to tensor , R won't copy the tensor again.

dfalbel commented 5 years ago

This is done. I added some docs here on how our wrapper converts R objects to Tensors. https://dfalbel.github.io/torch/articles/tensors.html