# Bug? Using Flux & getting Float32 response on 64 bit Ubuntu OS

**URL:** https://discourse.julialang.org/t/bug-using-flux-getting-float32-response-on-64-bit-ubuntu-os/21440
**Category:** Machine Learning
**Created:** [March 4, 2019, 4:06am UTC](https://discourse.julialang.org/t/bug-using-flux-getting-float32-response-on-64-bit-ubuntu-os/21440 "2019-03-04T04:06:34Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![samq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/samq/32/47935_2.png) [@samq](https://discourse.julialang.org/u/samq)
#### Post date: [March 4, 2019, 4:06am UTC](https://discourse.julialang.org/t/bug-using-flux-getting-float32-response-on-64-bit-ubuntu-os/21440/1 "2019-03-04T04:06:34Z")

</div>

Julia version 1.1.0  
Ubuntu 16.04 64 bit  
Flux version (?) please tell me how to see the version of Flux

I get Float32 responses instead of Float64 when doing the following:

using Flux  
model = Flux.Dense(2, 1, σ)

model.W  
(response in Jupyter Lab notebook:  
Tracked 1×2 Array{Float32,2}:  
0.604352 -1.12679)

model.b  
(response in Jupyter Lab notebook:  
Tracked 1-element Array{Float32,1}:  
0.0f0)

The responses should be Float64 instead of Float32.

How do I fix this?  
If this is a bug, how do I submit an issue?

---

<div class="post-metadata">

### Author: ![GunnarFarneback](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunnarfarneback/32/1827_2.png) [@GunnarFarneback](https://discourse.julialang.org/u/GunnarFarneback)
#### Post date: [March 4, 2019, 6:37am UTC](https://discourse.julialang.org/t/bug-using-flux-getting-float32-response-on-64-bit-ubuntu-os/21440/2 "2019-03-04T06:37:25Z")

</div>

> [@samq](#):
>
> The responses should be Float64 instead of Float32.

Any particular reason you expect to get double precision (i.e. `Float64`) instead of single precision floating point numbers? `Float32` is sufficient precision for typical artificial neural networks and allows faster computation on CPU as well as drastically better performance on most GPUs. Note that the fact that you have a 64 bit processor or operating system has no consequence for the choice between single and double precision floating point numbers.

---

<div class="post-metadata">

### Author: ![mcabbott](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mcabbott/32/6603_2.png) [@mcabbott](https://discourse.julialang.org/u/mcabbott)
#### Post date: [March 4, 2019, 12:48pm UTC](https://discourse.julialang.org/t/bug-using-flux-getting-float32-response-on-64-bit-ubuntu-os/21440/3 "2019-03-04T12:48:17Z")

</div>

The default is Float32 but there are functions to change this, from here: [Numeric precision utilities by MikeInnes · Pull Request #572 · FluxML/Flux.jl · GitHub](https://github.com/FluxML/Flux.jl/pull/572/files)

```julia

julia> Dense(3,2).W
Tracked 2×3 Array{Float32,2}:
 -0.308033 0.610357 -0.757685
  0.0664493 0.409627 -0.880773

julia> Dense(3,2) |> f64
Dense(3, 2)

julia> ans.W
Tracked 2×3 Array{Float64,2}:
 -0.871606 -0.773181 0.666745
  0.328294 0.34714 0.577119

```

---

<div class="post-metadata">

### Author: ![samq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/samq/32/47935_2.png) [@samq](https://discourse.julialang.org/u/samq)
#### Post date: [March 4, 2019, 6:41pm UTC](https://discourse.julialang.org/t/bug-using-flux-getting-float32-response-on-64-bit-ubuntu-os/21440/4 "2019-03-04T18:41:44Z")

</div>

Ok! Thank you for clearing up my misunderstanding!

---

<div class="post-metadata">

### Author: ![samq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/samq/32/47935_2.png) [@samq](https://discourse.julialang.org/u/samq)
#### Post date: [March 4, 2019, 6:53pm UTC](https://discourse.julialang.org/t/bug-using-flux-getting-float32-response-on-64-bit-ubuntu-os/21440/5 "2019-03-04T18:53:25Z")

</div>

Thank you!
