Skip to content

Commit c57f053

Browse files
stegbensoumith
authored andcommitted
let long_args False for param "size" of set_ (pytorch#1568)
* fix pytorch#1524, let long_args False for param "size" of set_
1 parent 156fe28 commit c57f053

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

test/test_torch.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2479,6 +2479,9 @@ def test_tensor_set(self):
24792479
stride = (10, 360, 90, 1)
24802480
t1.set_(t2.storage(), 0, size, stride)
24812481
self.assertEqual(t1.stride(), stride)
2482+
t1.set_(t2.storage(), 0, size=size, stride=stride)
2483+
self.assertEqual(t1.size(), size)
2484+
self.assertEqual(t1.stride(), stride)
24822485

24832486
def test_equal(self):
24842487
# Contiguous, 1D

torch/csrc/generic/methods/Tensor.cwrap

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -159,21 +159,14 @@ PyObject * THPTensor_(setIndex)(THPTensor *self, PyObject *args)
159159
- CONSTANT 0
160160
- CONSTANT __storage_size.get()
161161
- CONSTANT NULL
162-
- cname: setStorage
163-
arguments:
164-
- THTensor* self
165-
- THStorage* sourceStorage
166-
- long storage_offset
167-
- arg: THSize* size
168-
long_args: True
169-
- CONSTANT NULL
170162
- cname: setStorage
171163
arguments:
172164
- THTensor* self
173165
- THStorage* sourceStorage
174166
- long storage_offset
175167
- THSize* size
176-
- THStride* strides
168+
- arg: THStride* stride
169+
default: NULL
177170
]]
178171

179172
[[

0 commit comments

Comments
 (0)