What's the usefulness of Flux.testmode!

I cannot understand Flux.testmode!and Flux.trainmode! well.
When I use Flux.testmode(), I found trainloss is lower exactly,
For example as follows:
if using Flux.testmode()
train_pro_loss is lower much than valid_pro_loss, or not, train_pro_loss is near valid_pro_loss when train data number is equal to valid data.


lossfun = () -> push!(losses, [cal_loss(train.data...)])
losses=[]
train_pro_loss, valid_pro_loss=[],[]
opt, θ = Adam(0.01), Flux.params(model)
for _ = 1:num_epochs
            for (X, y) in train
                gradients = Flux.gradient(θ) do
                    cal_loss(X, y)
                end
                Flux.update!(opt, θ, gradients)
            end
            Flux.testmode!(model)
            lossfun()
            push!(train_pro_loss, cal_loss(train.data...))
            push!(valid_pro_loss, cal_loss(valid.data...))
end

https://fluxml.ai/Flux.jl/v0.12/models/layers/

You’re in luck, Flux: trainmode!() and testmode!() needed? has everything you’ll ever need to know about this and more. Also, make sure you’re on the latest version of the docs. Flux v0.12 is quite old at this point.