# Functionality of torch.nograd

**URL:** <https://discourse.julialang.org/t/functionality-of-torch-nograd/92432>\
**Category:** General Usage\
**Created:** [January 2, 2023, 10:25pm UTC](https://discourse.julialang.org/t/functionality-of-torch-nograd/92432 "2023-01-02T22:25:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![erlebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/erlebach/32/12973_2.png) [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Post date:** [January 2, 2023, 10:25pm UTC](https://discourse.julialang.org/t/functionality-of-torch-nograd/92432/1 "2023-01-02T22:25:33Z")

</div>

What is the recommended approach to exclude parts of my loss functiin from being targeted by Zygote? I am using Lux.jl. Thanks.

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [January 2, 2023, 10:55pm UTC](https://discourse.julialang.org/t/functionality-of-torch-nograd/92432/2 "2023-01-02T22:55:36Z")

</div>

`ChainRulesCore.ignore_derivatives`

[https://juliadiff.org/ChainRulesCore.jl/stable/api.html#Ignoring-gradients](https://juliadiff.org/ChainRulesCore.jl/stable/api.html#Ignoring-gradients)
