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

[Term Entry] PyTorch Tensor Operations: .angle() #6329

Merged
merged 5 commits into from
Mar 17, 2025

Conversation

mamtawardhani
Copy link
Collaborator

Description

Added [Term Entry] PyTorch Tensor Operations: .angle()

Issue Solved

Closes #6315

Type of Change

  • Adding a new entry

Checklist

  • All writings are my own.
  • My entry follows the Codecademy Docs style guide.
  • My changes generate no new warnings.
  • I have performed a self-review of my own writing and code.
  • I have checked my entry and corrected any misspellings.
  • I have made corresponding changes to the documentation if needed.
  • I have confirmed my changes are not being pushed from my forked main branch.
  • I have confirmed that I'm pushing from a new branch named after the changes I'm making.
  • I have linked any issues that are relevant to this PR in the Issues Solved section.

@mamtawardhani mamtawardhani added new entry New entry or entries status: under review Issue or PR is currently being reviewed pytorch PyTorch labels Mar 13, 2025

> **Note:** Starting in PyTorch 1.8, `.angle()` returns π (pi) for negative real numbers, zero for non-negative real numbers, and propagates NaNs. In previous versions, it would return zero for all real numbers and not propagate floating-point NaNs.

## Example 1: Basic usage of `.angle()`
Copy link
Collaborator

Choose a reason for hiding this comment

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

We can keep the title as this.

Suggested change
## Example 1: Basic usage of `.angle()`
## Example 1: Calculating the element-wise angle of a complex tensor

- 'paths/data-science'
---

The **`.angle()`** method in PyTorch is a tensor operation that computes the element-wise angle (in radians) of a given complex tensor. This function returns the phase angle of each complex value in the tensor, representing the argument of each complex number. The `.angle()` method is particularly useful in signal processing, Fourier transforms, and other applications that involve complex number operations.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Bcaklink to PyTorch

@mamtawardhani
Copy link
Collaborator Author

This is done @Radhika-okhade, added some more backlinks 🫡

@Radhika-okhade
Copy link
Collaborator

Thank you for contributing to Codecademy docs @mamtawardhani. The entry looks good to be merged.

@Radhika-okhade Radhika-okhade merged commit 817340f into Codecademy:main Mar 17, 2025
7 checks passed
Copy link

👋 @mamtawardhani
You have contributed to Codecademy Docs, and we would like to know more about you and your experience.
Please take a minute to fill out this four question survey to help us better understand Docs contributions and how we can improve the experience for you and our learners.
Thank you for your help!

🎉 Your contribution(s) can be seen here:

https://www.codecademy.com/resources/docs/pytorch/tensor-operations/angle

Please note it may take a little while for changes to become visible.
If you're appearing as anonymous and want to be credited, visit the linked accounts page and ensure that your GitHub account is linked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Term Entry] PyTorch Tensor Operations: .angle()
2 participants