# What does torch.backends.cudnn.benchmark do?

**URL:** <https://discuss.pytorch.org/t/what-does-torch-backends-cudnn-benchmark-do/5936>\
**Category:** Uncategorized\
**Created:** [August 8, 2017, 4:21pm UTC](https://discuss.pytorch.org/t/what-does-torch-backends-cudnn-benchmark-do/5936 "2017-08-08T16:21:17Z")\
**Posts on this page:** 1\
**Showing post:** 31

<div class="post-metadata">

**Author:** ![veritas](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/veritas/32/11018_2.png) [@veritas](https://discuss.pytorch.org/u/veritas)\
**Post date:** [January 20, 2021, 12:05pm UTC](https://discuss.pytorch.org/t/what-does-torch-backends-cudnn-benchmark-do/5936/31 "2021-01-20T12:05:22Z")

</div>

@fmassa @ptrblck  
Hello. I would like to ask a few questions about the behavior of `torch.backends.cudnn.benchmark = True`.

1. Does the mini-batch size matter? Many people say that benchmarking uses the same cache if image input size is the same. However, I have not found a clear explanation of whether changing batch size is OK.
2. How many caches can it manage? For example, I might have two types of input: 224x224 and 320x320. Would changing between the two types of images constantly require additional benchmarking or would there be two separate caches?

Thank you in advance for your replies!

---

_[View the full topic](https://discuss.pytorch.org/t/what-does-torch-backends-cudnn-benchmark-do/5936)._
