Sure. After the forward pass, the network outputs a tensor of [1, 481] size. Then this output is used in my custom loss function:
def myloss(output, fitnessgoal):
    orders = output.tolist()[0]
    fitness = torch.tensor(playgame(*orders), dtype=torch.float)
    loss = loss_fn(fitness, fitnessgoal)  
    loss.requires_grad = True
    loss.retain_grad()
    return loss