# Optimization over batches in Pennylane

**URL:** https://discuss.pennylane.ai/t/optimization-over-batches-in-pennylane/7676
**Category:** PennyLane Help
**Created:** [December 3, 2024, 4:08pm UTC](https://discuss.pennylane.ai/t/optimization-over-batches-in-pennylane/7676 "2024-12-03T16:08:03Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![CatalinaAlbornoz](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/catalinaalbornoz/32/1196_2.png) [@CatalinaAlbornoz](https://discuss.pennylane.ai/u/CatalinaAlbornoz)
#### Post date: [December 4, 2024, 9:41pm UTC](https://discuss.pennylane.ai/t/optimization-over-batches-in-pennylane/7676/2 "2024-12-04T21:41:53Z")

</div>

Hi @rc17782 ,

I don’t have all of the info to test your code locally so I’m not sure how the optimization is happening.

If it helps I made [this code example](https://discuss.pennylane.ai/t/question-of-parameter-shift-method-in-broadcasting/4940/6) for someone else, where I broke down the batches into individual inputs within the forward pass, but then the optimization was done over batches.

If this doesn’t answer your question, would you be able to share a minimal reproducible example of your code?

I hope this helps!

---

_[View the full topic](https://discuss.pennylane.ai/t/optimization-over-batches-in-pennylane/7676)._
