Only sample z during training. Otherwise, just~pass through