-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Pytorch tensors squeeze #5363
base: main
Are you sure you want to change the base?
Pytorch tensors squeeze #5363
Conversation
|
|
||
## Example | ||
|
||
Using the tensor with shape of (1, 3, 1, 5) |
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.
Fix this description, rephrase it so the readers can understand what they will see in the code snippet below this.
```shell | ||
tensor.squeeze() |
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.
Why have u used the shell tag here? This is used to show the output for the code snippet
```py | ||
import torch | ||
|
||
tensor = (1, 3, 1, 5) | ||
``` | ||
Output: (1, 3, 1, 5) | ||
|
||
If calling squeeze(): | ||
|
||
```shell | ||
tensor.squeeze() | ||
``` | ||
All dimensions with size 1 are removed: | ||
Output: (3, 5) |
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.
Fix this whole section please, its not looking right as the outputs and code is all mixed up
@@ -0,0 +1,46 @@ | |||
--- | |||
Title: '.squeeze()' | |||
Description: 'Returns a tensor with all specified dimensions of input of size 1 removed.' |
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.
Rephrase this description for more clarity
- 'Squeeze Tensor Pytorch' | ||
- 'Methods, Functions' | ||
CatalogContent: | ||
- 'how-to-squeeze-tensor' |
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.
Remove this, as this is not right.
- 'Data Science' | ||
- 'Squeeze Tensor Pytorch' | ||
- 'Methods, Functions' |
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.
- This is the wrong way of using tags as only 1 tag is allowed inside the qoutes.
- Only use the tags present in this file.
- 'pytorch-squeeze-and-excitation' | ||
--- | ||
|
||
The **`.squeeze()`** function removes all dimensions of size 1 from a tensor. If a dimension has a size greater than 1, will not be squeezed. |
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.
The **`.squeeze()`** function removes all dimensions of size 1 from a tensor. If a dimension has a size greater than 1, will not be squeezed. | |
The **`.squeeze()`** function removes all dimensions of size one from a tensor. A dimension with a length greater than one will not be squeezed. |
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.
I have a few comments for you to work on; also, please remove the rest of the files from this PR. Only push the squeeze.md
file.
How do I do that? |
…/codecademy-docs into pytorch-tensors-squeeze
Kindly review this