Skip to content

shortcut empty Tensor share_memory#1879

Closed
soumith wants to merge 1 commit intomasterfrom
emptyshare
Closed

shortcut empty Tensor share_memory#1879
soumith wants to merge 1 commit intomasterfrom
emptyshare

Conversation

@soumith
Copy link
Collaborator

@soumith soumith commented Jun 22, 2017

fixes #1878

@apaszke
Copy link
Contributor

apaszke commented Jun 22, 2017

Not sure if this is a good solution. It can give some pretty weird results:

x = torch.Tensor()
x.share_memory_()
assert x.is_shared() # Fails

@soumith
Copy link
Collaborator Author

soumith commented Jun 22, 2017

hmmm, i see.

@soumith soumith closed this Jun 22, 2017
@soumith soumith deleted the emptyshare branch June 22, 2017 16:21
houseroad added a commit to houseroad/pytorch that referenced this pull request Mar 22, 2019
…e0ea6c (pytorch#18285)

Summary:
Pull Request resolved: pytorch#18285

Previous import was 96c58ceeacf0f2b73d752e413e4fd78787a12da3

Included changes:
- **[c05f2ae4](onnx/onnx@c05f2ae4)**: update both core and ml docs (pytorch#1879) <Lu Fang>
- **[f895279b](onnx/onnx@f895279b)**: fix the problems introduced in previous PRs in operator registration (pytorch#1878) <Lu Fang>
- **[f6f80657](onnx/onnx@f6f80657)**: Skip the schema check on ops in non-standard domain (pytorch#1876) <Lu Fang>
- **[8c8be722](onnx/onnx@8c8be722)**: Introduce Function Body Helper  (pytorch#1868) <Sherlock>
- **[b605eafb](onnx/onnx@b605eafb)**: Support down sampling for Upsample with scales < 1. (pytorch#1773) <Ke Zhang>
- **[47f7aa71](onnx/onnx@47f7aa71)**: Remove scaledtanh (pytorch#1866) <Ashwini Khade>
- **[4dfc56de](onnx/onnx@4dfc56de)**: Add Ceil support for Max and Average Pooling (pytorch#1860) <Lara Haidar>
- **[552a8efc](onnx/onnx@552a8efc)**: Add testcase generator for functions (pytorch#1862) <Raymond Yang>
- **[fdb978a5](onnx/onnx@fdb978a5)**: Promote Thresholded Relu Op (pytorch#1856) <Ashwini Khade>
- **[ce332628](onnx/onnx@ce332628)**: Update Slice with dynamic input & optional input steps (pytorch#1836) <Bowen Bao>
- **[3a9a8787](onnx/onnx@3a9a8787)**: Merge function into opschema (pytorch#1834) <Raymond Yang>
- **[3dbf8fe9](onnx/onnx@3dbf8fe9)**: Handle string comparision represented as np.objects (pytorch#1851) <Dmitri Smirnov>
- **[3b0d3bb2](onnx/onnx@3b0d3bb2)**: remove global variable in header file (pytorch#1850) <Lu Fang>
- **[1cca8733](onnx/onnx@1cca8733)**: bump the version for drop out - fix the issue that the version was not bumped when changing its type constraint declaration. (pytorch#1848) <Ke Zhang>
- **[1ec81bc6](onnx/onnx@1ec81bc6)**: Change TopK operator to allow dynamic 'k' (pytorch#1829) <Hariharan Seshadri>
- **[a89a4a16](onnx/onnx@a89a4a16)**: Remove exp op: Affine, ImageScaler,ParametricSoftplus, Crop. (pytorch#1832) <Ke Zhang>

Differential Revision: D14566202

fbshipit-source-id: 3deb51c17eb9ebd6f6efc331d9110acb3462ece5
facebook-github-bot pushed a commit that referenced this pull request Mar 22, 2019
…e0ea6c (#18285)

Summary:
Pull Request resolved: #18285

Previous import was 96c58ceeacf0f2b73d752e413e4fd78787a12da3

Included changes:
- **[c05f2ae4](onnx/onnx@c05f2ae4)**: update both core and ml docs (#1879) <Lu Fang>
- **[f895279b](onnx/onnx@f895279b)**: fix the problems introduced in previous PRs in operator registration (#1878) <Lu Fang>
- **[f6f80657](onnx/onnx@f6f80657)**: Skip the schema check on ops in non-standard domain (#1876) <Lu Fang>
- **[8c8be722](onnx/onnx@8c8be722)**: Introduce Function Body Helper  (#1868) <Sherlock>
- **[b605eafb](onnx/onnx@b605eafb)**: Support down sampling for Upsample with scales < 1. (#1773) <Ke Zhang>
- **[47f7aa71](onnx/onnx@47f7aa71)**: Remove scaledtanh (#1866) <Ashwini Khade>
- **[4dfc56de](onnx/onnx@4dfc56de)**: Add Ceil support for Max and Average Pooling (#1860) <Lara Haidar>
- **[552a8efc](onnx/onnx@552a8efc)**: Add testcase generator for functions (#1862) <Raymond Yang>
- **[fdb978a5](onnx/onnx@fdb978a5)**: Promote Thresholded Relu Op (#1856) <Ashwini Khade>
- **[ce332628](onnx/onnx@ce332628)**: Update Slice with dynamic input & optional input steps (#1836) <Bowen Bao>
- **[3a9a8787](onnx/onnx@3a9a8787)**: Merge function into opschema (#1834) <Raymond Yang>
- **[3dbf8fe9](onnx/onnx@3dbf8fe9)**: Handle string comparision represented as np.objects (#1851) <Dmitri Smirnov>
- **[3b0d3bb2](onnx/onnx@3b0d3bb2)**: remove global variable in header file (#1850) <Lu Fang>
- **[1cca8733](onnx/onnx@1cca8733)**: bump the version for drop out - fix the issue that the version was not bumped when changing its type constraint declaration. (#1848) <Ke Zhang>
- **[1ec81bc6](onnx/onnx@1ec81bc6)**: Change TopK operator to allow dynamic 'k' (#1829) <Hariharan Seshadri>
- **[a89a4a16](onnx/onnx@a89a4a16)**: Remove exp op: Affine, ImageScaler,ParametricSoftplus, Crop. (#1832) <Ke Zhang>

Reviewed By: yinghai

Differential Revision: D14566202

fbshipit-source-id: b1e5912ae6887e2865fc628363071e2b9938dfa4
apakbin pushed a commit to apakbin/pytorch that referenced this pull request Feb 18, 2025
jagadish-amd pushed a commit to jagadish-amd/pytorch that referenced this pull request May 8, 2025
Fixes SWDEV-501618

(cherry picked from commit 8b59eea)
jagadish-amd pushed a commit to jagadish-amd/pytorch that referenced this pull request May 20, 2025
Fixes SWDEV-501618

(cherry picked from commit 8b59eea)
(cherry picked from commit 374e51a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

share_memory_ needs a check for empty tensor

2 participants