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

Pytorch tensors squeeze #5363

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

sbowennn
Copy link

@sbowennn sbowennn commented Oct 1, 2024

Kindly review this

@CLAassistant
Copy link

CLAassistant commented Oct 1, 2024

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ dakshdeepHERE
❌ sbowennn
You have signed the CLA already but the status is still pending? Let us recheck it.

@dakshdeepHERE dakshdeepHERE self-assigned this Oct 1, 2024
@dakshdeepHERE dakshdeepHERE added new entry New entry or entries status: under review Issue or PR is currently being reviewed pytorch PyTorch labels Oct 1, 2024
@dakshdeepHERE dakshdeepHERE linked an issue Oct 1, 2024 that may be closed by this pull request
3 tasks

## Example

Using the tensor with shape of (1, 3, 1, 5)
Copy link
Collaborator

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.

Comment on lines 39 to 40
```shell
tensor.squeeze()
Copy link
Collaborator

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

Comment on lines 30 to 43
```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)
Copy link
Collaborator

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.'
Copy link
Collaborator

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'
Copy link
Collaborator

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.

Comment on lines 7 to 9
- 'Data Science'
- 'Squeeze Tensor Pytorch'
- 'Methods, Functions'
Copy link
Collaborator

Choose a reason for hiding this comment

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

  1. This is the wrong way of using tags as only 1 tag is allowed inside the qoutes.
  2. 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.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
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.

Copy link
Collaborator

@dakshdeepHERE dakshdeepHERE left a 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.

@sbowennn
Copy link
Author

sbowennn commented Oct 3, 2024

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?

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 Tensors .squeeze()
3 participants