Please help understand |> operator

I tried to locate it in documentation, but could not. Can anyone please explain how this “|> gpu” or “|> cpu” works? Is this |> an operator?

Here is example of the code:

m = Chain(
  Conv((5,5), 3=>16, relu),
  MaxPool((2,2)),
  Conv((5,5), 16=>8, relu),
  MaxPool((2,2)),
  x -> reshape(x, :, size(x, 4)),
  Dense(200, 120),
  Dense(120, 84),
  Dense(84, 10),
  softmax) |> gpu

this is from: Flux – Deep Learning with Flux - A 60 Minute Blitz

Operators are in the REPL help of Julia (they can be hard to find in the on-line documentation).
Access REPL help simply by entering a ‘?’

help?> |>
search: |>

  |>(x, f)

  Applies a function to the preceding argument. This allows for easy function
  chaining.

  Examples
  ≡≡≡≡≡≡≡≡≡≡

  julia> [1:5;] |> x->x.^2 |> sum |> inv
  0.01818181818181818

julia> 
4 Likes