-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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 Tensors .eye() #5786
[Term Entry] PyTorch Tensors .eye() #5786
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @PragatiVerma18 , thank you for contributing to Codecademy Docs, the entry is nicely written! 😄
I've suggested a few changes, could you please review and modify those at your earliest convenience? Thank you! 😃
## Syntax | ||
|
||
```pseudo | ||
torch.eye(n, m, dtype=None, device=None, out=None) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let us include the entire syntax as follows:
torch.eye(n, m=None, *, out=None, dtype=None, layout=torch.strided, device=None, requires_grad=False)
- `n`: The number of rows in the resulting identity matrix. | ||
- `m`: The number of columns in the resulting identity matrix. | ||
- `dtype`: The desired data type of the returned tensor (optional). | ||
- `device`: The device on which the tensor should be allocated (optional). | ||
- `out`: The output tensor (optional). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add the rest of the parameter descriptions as well. And make sure that the 'optional' is on the left side, example:
out
(Optional): The output tensor.
|
||
## Example | ||
|
||
Here is an example that demonstrates the use of `.eye()` to create a 3x3 identity matrix: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is an example that demonstrates the use of `.eye()` to create a 3x3 identity matrix: | |
Here is an example that demonstrates the use of `.eye()` to create a *3x3* identity matrix: |
|
||
## Codebyte Example | ||
|
||
Here is an example that demonstrates the use of `.eye()` to create a 4x4 identity matrix: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is an example that demonstrates the use of `.eye()` to create a 4x4 identity matrix: | |
Here is an example that demonstrates the use of `.eye()` to create a *4x4* identity matrix: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for contributing to Codecademy Docs @PragatiVerma18 😄
The entry looks good to be merged! 🚀
👋 @PragatiVerma18 🎉 Your contribution(s) can be seen here: https://www.codecademy.com/resources/docs/pytorch/tensors/eye Please note it may take a little while for changes to become visible. |
Description
Add a new entry on the
.eye()
term under PyTorch.Issue Solved
Closes #5302
Type of Change
Checklist
main
branch.Issues Solved
section.