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

Implement torch_tensor_negative for taking negative of a tensor #247

Merged
merged 4 commits into from
Jan 20, 2025

Conversation

jwallwork23
Copy link
Contributor

Closes #246.

Implements and overload for the unary - operator: torch_tensor_minus, plus unit test.

@jwallwork23 jwallwork23 added enhancement New feature or request autograd Tasks towards the online training / automatic differentiation feature labels Jan 20, 2025
@jwallwork23 jwallwork23 self-assigned this Jan 20, 2025
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.

Code wise, this all looks good, but I wonder if 'minus' could be misleading, and whether 'negative' might be better?

Plus extending the comments to be a bit more explicit e.g. 'unary minus' as you used when we were discussing.

@dorchard
Copy link
Member

I concur with negative (this naming is used also in NumPy for example).

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, I'm happy with this.

@jwallwork23 jwallwork23 merged commit 39c3424 into main Jan 20, 2025
5 checks passed
@jwallwork23 jwallwork23 deleted the 246_overload-minus branch January 20, 2025 17:17
@jwallwork23 jwallwork23 changed the title Implement torch_tensor_minus for taking negative of a tensor Implement torch_tensor_negative for taking negative of a tensor Jan 20, 2025
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.

Overload minus operator for tensors
3 participants