Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hook up requires_grad #288

Merged
merged 7 commits into from
Mar 10, 2025
Merged

Hook up requires_grad #288

merged 7 commits into from
Mar 10, 2025

Conversation

jwallwork23
Copy link
Collaborator

Towards #158.
(Refined from #286.)

This PR hooks the requires_grad option up properly and provides a torch_tensor_requires_grad function (as well as a torch_tensor%requires_grad method) to query this. Unit tests are written and the option is also used in the autograd example.

@jwallwork23 jwallwork23 added enhancement New feature or request autograd Tasks towards the online training / automatic differentiation feature labels Feb 18, 2025
@jwallwork23 jwallwork23 self-assigned this Feb 18, 2025
@jwallwork23
Copy link
Collaborator Author

Static analysis CI error will be fixed by #287.

Copy link
Member

@jatkinson1000 jatkinson1000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @jwallwork23 Generally seems sensible to me.

Main request is to test the defaults for requires_grad, not just the true setting.

I realise this probably needs a bit of tweaking/rebasing after a few of the recent changes.

@jwallwork23
Copy link
Collaborator Author

[Rebased on top of main.]

Copy link
Member

@jatkinson1000 jatkinson1000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jwallwork23 an even better fix than I imagined.
Hopefully fixtures should come in useful as we expand things.

@jwallwork23
Copy link
Collaborator Author

Thanks for the review @jatkinson1000!

@jwallwork23 jwallwork23 merged commit 864b0eb into main Mar 10, 2025
5 of 6 checks passed
@jwallwork23 jwallwork23 deleted the requires_grad branch March 10, 2025 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autograd Tasks towards the online training / automatic differentiation feature enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants