<p>I am trying to move a tensor to cuda, but unfortunately, I am loosing precision. The first entry is 5.02e-5 which is converted to 0. Is there a work around?</p>
<pre><code>vals = vals.to(torch.float64).to(device_of_t)
</code></pre>

CC BY-SA 4.0
2024-10-14T09:50:14.090Z
_which is converted to 0_ how are you checking it?
Alberto
CC BY-SA 4.0
2024-10-14T12:30:30.420Z
I’m printing it and dividing by it to check.
euleriwt
CC BY-SA 4.0
2024-10-14T13:55:54.347Z
post the entire code to reproduce the problem
Alberto
CC BY-SA 4.0
2024-10-14T21:29:40.807Z
why precision matters in soft computing? If so, you can normalize your data into min of float 64 to max of float 64.
Muhammad Ikhwan Perwira
<training><gpu><inference><hardware><tensor>
Moving tensor to cuda reduces precision
euleriwt
# Moving tensor to cuda reduces precision

(Asked by: username_0 on 2024-10-14)

I am trying to move a tensor to cuda, but unfortunately, I am loosing precision. The first entry is 5.02e-5 which is converted to 0. Is there a work around?
vals = vals.to(torch.float64).to(device_of_t)

**Tags:** training, gpu, inference, hardware, tensor

> **Comments:**
> **username_1**: _which is converted to 0_ how are you checking it?  
> **username_0**: I’m printing it and dividing by it to check.  
> **username_1**: post the entire code to reproduce the problem  
> **username_2**: why precision matters in soft computing? If so, you can normalize your data into min of float 64 to max of float 64.  

---

## 0 answers

