Need help using ForwardDiff gradient with numerical loop

Welcome to the forum!
To make life easier for people trying to help you, it’s very useful to format the code with backticks, like so:

```julia
f(x) = 1
```

It seems that you tried but perhaps you used the wrong character? See this post for other tips on how to use the forum:

1 Like