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