AnoGAN example, two adversarial networks

Hi all,
I tried the AnoGAN example, pytorch_cpp-master → Anomaly´_Detection → AnoGAN2d.
Trying void test(… in test.cpp there is a loop

for (size_t i = 0; i < search_epoch; i++) {
            output = gen->forward(z);
            anomaly_score_with_al...

It seems that on Tensor z, size of the latent space, before forwarding the image, the network is retrained, or more trained. Is that necessary before every forwarding?
Is just running a random vector through the network and comparing the output with one image the anomaly detection?

I am lost in test.cpp. Nowhere the image to test is forwarded through the network and the result compared to the input?
The failure images run through test show more or less what I expected.

Many thanks for your help.