# Write nice representation of Flux chain to file

**URL:** https://discourse.julialang.org/t/write-nice-representation-of-flux-chain-to-file/136338
**Category:** General Usage
**Tags:** question
**Created:** [March 23, 2026, 7:36am UTC](https://discourse.julialang.org/t/write-nice-representation-of-flux-chain-to-file/136338 "2026-03-23T07:36:09Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Fourier](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fourier/32/38176_2.png) [@Fourier](https://discourse.julialang.org/u/Fourier)
#### Post date: [March 23, 2026, 7:36am UTC](https://discourse.julialang.org/t/write-nice-representation-of-flux-chain-to-file/136338/1 "2026-03-23T07:36:09Z")

</div>

Hi, I am training some neural networks using Flux.jl.  
I noticed that the output of `display` is much nicer than the output of print and show.

I am making a file for evaluating which architectures I think look promising. For this I would like to take the output that looks similar to the one from display:

```julia-auto
julia> print(NN)
Chain(Conv((2, 2), 2 => 64, relu), Conv((2, 2), 64 => 16, relu), flatten, Dense(2704 => 256, relu), Dense(256 => 128, relu), Dense(128 => 3))
julia> show(NN)
Chain(Conv((2, 2), 2 => 64, relu), Conv((2, 2), 64 => 16, relu), flatten, Dense(2704 => 256, relu), Dense(256 => 128, relu), Dense(128 => 3))
julia> display(NN)
Chain(
  Conv((2, 2), 2 => 64, relu), # 576 parameters
  Conv((2, 2), 64 => 16, relu), # 4_112 parameters
  Flux.flatten,
  Dense(2704 => 256, relu), # 692_480 parameters
  Dense(256 => 128, relu), # 32_896 parameters
  Dense(128 => 3), # 387 parameters
) # Total: 10 arrays, 730_451 parameters, 2.787 MiB.

```

In the method description of display it does not seem to me like it is possible to give an output stream to display.  
Is there maybe a different method that I can call that produces a similar output? Or a way to redirect its output?
