-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
[Edit] Python (Pytorch): .cat() #6485
base: main
Are you sure you want to change the base?
Conversation
|
||
<details> | ||
<summary>2. Can I concatenate tensors of different data types or devices?</summary> | ||
<p>No. All tensors must have the same data type and must be on the same device (e.g., all on CPU or all on GPU). Mismatches will raise an error. |
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.
Can add backlink to CPU and GPU
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.
We don't have one for GPU, added 1cpu blog link (It has better content than docs)
|
||
A new tensor resulting from concatenating the input tensors along the specified dimension. | ||
|
||
## Example 1: Concatenating tensors along the first dimension |
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 line -"The output shows the two tensors and the concatenated tensor along the first dimension:" is repetitive in all three examples. Consider rewriting it. We are saying the same thing in the example heading, then description of example and output description.
@@ -115,9 +115,9 @@ tensor([[ 1, 2, 3, 7, 8, 9], | |||
[ 4, 5, 6, 10, 11, 12]]) | |||
``` | |||
|
|||
## Example 3: Concatenating tensors along the third dimension | |||
## Example 3: Appending Tensors on the Depth Dimension |
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 prefer the earlier name
|
||
The example below showcases concatenating tensors along the third dimension using the `.cat()` function: | ||
This example illustrates how to append tensors along the third dimension (axis 2), effectively stacking them in depth using the `.cat()` method: |
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 example illustrates how to append tensors along the third dimension (axis 2), effectively stacking them in depth using the `.cat()` method: | |
This example shows how to append tensors along the third dimension (axis 2), effectively stacking them in depth using the `.cat()` method: |
@@ -75,9 +75,9 @@ tensor([[ 1, 2, 3], | |||
[10, 11, 12]]) | |||
``` | |||
|
|||
## Example 2: Concatenating tensors along the second dimension | |||
## Example 2: Stacking Tensors Across the Second Axis |
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 prefer the earlier name
@@ -33,9 +33,9 @@ torch.cat(tensors, dim=0, out=None) | |||
|
|||
A new tensor resulting from concatenating the input tensors along the specified dimension. | |||
|
|||
## Example 1: Concatenating tensors along the first dimension | |||
## Example 1: Merging Tensors Along Dimension 0 |
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 prefer the earlier name
Co-authored-by: Radhika-okhade <[email protected]>
Co-authored-by: Radhika-okhade <[email protected]>
Description
[[Edit] Python (Pytorch): .cat()
Issue Solved
Closes #6472
Type of Change
Checklist
main
branch.Issues Solved
section.