The forum is closed and this archive is read-only. To ask a question or start a discussion, use GitHub Discussions.

Go to GitHub Discussions
Help & QuestionsApr 20, 2026

The problem of the thickness variable being ineffective when using torch for optimization

by Nan Steve

I found that when using the** Torch backend** for optimization, when adding multiple thickness variables with problem.add_variable, usually only one is effective. And the other geometry properties remain unaffected. Additionally, directly changing lens.surfaces.surfaces[n].thickness to a tensor also cannot participate in gradient updates, while the geometry attribute does not have this issue.Is this due to my mistake or a bug?

Replies (1)

  1. HarrisonKramer · May 13, 2026

    Hello,

    Thanks for reporting this. This was a bug, but it is fixed as of today, May 13, 2026. See PR #569 on GitHub for the details. So, please check out the latest version of the code and try again.

    Regards, Kramer