The caching code does loop num-variations times to sample rays from the source images, but it saves the current ray batch into the same file from within the loop, overwriting the file each time. So in the end the cache of each source file only contains the last variation.
https://github.com/krrish94/nerf-pytorch/blob/a14357da6cada433d28bf11a45c7bcaace76c06e/cache_dataset.py#L70
The caching code does loop
num-variations
times to sample rays from the source images, but it saves the current ray batch into the same file from within the loop, overwriting the file each time. So in the end the cache of each source file only contains the last variation.