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

Experimental upgrade for v2.2.0 #278

Draft
wants to merge 42 commits into
base: 33-v2.1.0.1
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
c95dbec
Merge pull request #767 from kmaehashi/fix-dependency-docs
niboshi Nov 21, 2017
c758157
Merge pull request #769 from kmaehashi/fix-typo-cache
niboshi Nov 21, 2017
4f9c59e
Merge pull request #512 from okuta/improve-cudnn
niboshi Nov 10, 2017
464b178
Merge pull request #770 from niboshi/bp-767-fix-dependency-docs
kmaehashi Nov 21, 2017
b302247
Merge pull request #771 from niboshi/bp-769-fix-typo-cache
kmaehashi Nov 21, 2017
58dca59
Merge pull request #774 from kmaehashi/test-argminmax-tie
niboshi Nov 24, 2017
a310ab9
Merge pull request #776 from niboshi/bp-774-test-argminmax-tie
kmaehashi Nov 24, 2017
873479b
Merge pull request #777 from kmaehashi/fix-dump-filename
niboshi Nov 24, 2017
61be331
Merge pull request #778 from niboshi/bp-777-fix-dump-filename
kmaehashi Nov 24, 2017
601b1dd
Merge pull request #787 from hvy/fix-doc-missing-arg
unnonouno Nov 27, 2017
95cd84f
Merge pull request #790 from unnonouno/v2-fix-doc-missing-arg
hvy Nov 27, 2017
29f55e4
Merge pull request #749 from okuta/fix-stack
unnonouno Nov 29, 2017
45a00d4
Merge pull request #798 from unnonouno/v2-fix-stack
hvy Nov 29, 2017
ac93d73
Merge pull request #797 from kmaehashi/fix-gitignore
okuta Nov 30, 2017
bf60572
Merge pull request #800 from okuta/bp-797-fix-gitignore
kmaehashi Nov 30, 2017
494c59b
Merge pull request #803 from kmaehashi/fix-stack-test
niboshi Nov 30, 2017
624f6a8
Merge pull request #808 from kmaehashi/embed-signature
niboshi Dec 1, 2017
8538889
Merge pull request #786 from kmaehashi/fix-elementwise-docs
niboshi Dec 1, 2017
6be88dc
Merge pull request #810 from niboshi/bp-786-fix-elementwise-docs
kmaehashi Dec 1, 2017
6c9e947
Merge pull request #806 from niboshi/bp-803-fix-stack-test
kmaehashi Dec 1, 2017
adf72f7
Merge pull request #788 from hvy/allow-derived-errors
niboshi Dec 1, 2017
ae333f5
Merge pull request #809 from niboshi/bp-808-embed-signature
kmaehashi Dec 1, 2017
5bc3cda
Merge pull request #720 from okuta/add-default-casting
niboshi Dec 1, 2017
148701b
Merge pull request #804 from kmaehashi/fix-helper-comment
niboshi Dec 1, 2017
d45bae2
Merge pull request #811 from niboshi/bp-788-allow-derived-errors
hvy Dec 2, 2017
8eefaee
Merge pull request #812 from niboshi/bp-720-add-default-casting
okuta Dec 3, 2017
77ba344
Merge pull request #737 from niboshi/fix-matmul-value-error
okuta Dec 3, 2017
1b75b10
Merge pull request #748 from niboshi/bp-512-improve-cudnn
okuta Dec 3, 2017
a780b9e
Merge pull request #814 from niboshi/bp-804-fix-helper-comment
kmaehashi Dec 4, 2017
5879e40
Merge pull request #816 from okuta/bp-737-fix-matmul-value-error
niboshi Dec 4, 2017
a83c500
Merge pull request #817 from okuta/fix-matmul-test
niboshi Dec 4, 2017
be56876
Merge pull request #818 from niboshi/bp-817-fix-matmul-test
okuta Dec 4, 2017
b0f9e66
Merge pull request #805 from toslunar/cast-env-seed
niboshi Dec 4, 2017
75b3175
Merge pull request #822 from niboshi/bp-805-cast-env-seed
kmaehashi Dec 6, 2017
f87a4dd
Merge pull request #574 from unnonouno/remove-randint-dtype
niboshi Oct 14, 2017
50d6f3c
Merge pull request #830 from unnonouno/v2-remove-randint-dtype
niboshi Dec 7, 2017
aa39eb6
Merge pull request #741 from niboshi/fix-random-choice-repro
unnonouno Nov 24, 2017
7cca7e6
Remove unused import
unnonouno Dec 7, 2017
a276e56
Merge pull request #775 from unnonouno/v2-fix-random-choice-repro
niboshi Dec 7, 2017
d543ced
Update to v2.2.0
beam2d Dec 12, 2017
4423b77
Merge pull request #839 from beam2d/update-v2.2.0
kmaehashi Dec 12, 2017
2739453
Merge branch 'master' into clpy
LWisteria Mar 3, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge pull request cupy#749 from okuta/fix-stack
Fix stack function bug
  • Loading branch information
unnonouno committed Nov 29, 2017
commit 29f55e41f94d9c764d3ea6e84918b231089770d6
6 changes: 4 additions & 2 deletions cupy/manipulation/join.py
Original file line number Diff line number Diff line change
@@ -120,10 +120,12 @@ def stack(tup, axis=0):

.. seealso:: :func:`numpy.stack`
"""
# TODO(okuta) Remove this if exampd_dims is updated
for x in tup:
if not (-x.ndim <= axis < x.ndim):
if not (-x.ndim - 1 <= axis <= x.ndim):
raise core.core._AxisError(
'axis {} out of bounds [0, {})'.format(axis, x.ndim))
'axis {} out of bounds [{}, {}]'.format(
axis, -x.ndim - 1, x.ndim))
return concatenate([cupy.expand_dims(x, axis) for x in tup], axis)


19 changes: 18 additions & 1 deletion tests/cupy_tests/manipulation_tests/test_join.py
Original file line number Diff line number Diff line change
@@ -173,10 +173,27 @@ def test_stack_value(self):

@testing.with_requires('numpy>=1.10')
@testing.numpy_cupy_array_equal()
def test_stack_with_axis(self, xp):
def test_stack_with_axis1(self, xp):
a = testing.shaped_arange((2, 3), xp)
return xp.stack((a, a), axis=1)

@testing.with_requires('numpy>=1.10')
@testing.numpy_cupy_array_equal()
def test_stack_with_axis2(self, xp):
a = testing.shaped_arange((2, 3), xp)
return xp.stack((a, a), axis=2)

@testing.numpy_cupy_raises()
def test_stack_with_axis_over(self, xp):
a = testing.shaped_arange((2, 3), xp)
try:
return xp.stack((a, a), axis=3)
except IndexError:
# For 'numpy<=1.12', catch both IndexError from NumPy and
# IndexOrValueError from CuPy. For 'numpy>=1.13', simply do not
# catch the AxisError.
raise IndexError()

def test_stack_with_axis_value(self):
a = testing.shaped_arange((2, 3), cupy)
s = cupy.stack((a, a), axis=1)