# Partial Gradient Tracking?

**URL:** <https://discuss.pytorch.org/t/partial-gradient-tracking/173421>\
**Category:** Uncategorized\
**Created:** [February 24, 2023, 7:46pm UTC](https://discuss.pytorch.org/t/partial-gradient-tracking/173421 "2023-02-24T19:46:23Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![ptrblck](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/ptrblck/32/1823_2.png) [@ptrblck](https://discuss.pytorch.org/u/ptrblck)\
**Post date:** [February 25, 2023, 5:35am UTC](https://discuss.pytorch.org/t/partial-gradient-tracking/173421/2 "2023-02-25T05:35:21Z")

</div>

I don’t believe your use case is easily doable since gradients will be calculated for the entire parameter and not for subtensors.  
You could check [this approach](https://discuss.pytorch.org/t/custumize-the-backpropagation-phase-of-a-neural-network-to-ignore-the-update-of-some-parameters/167557/4) which uses subtensors with a frozen and trainable part and might fit your use case. I’ve also posted a way to replace built-in layers with this custom module using `torch.fx` in case that’s helpful.

---

_[View the full topic](https://discuss.pytorch.org/t/partial-gradient-tracking/173421)._
