Movatterモバイル変換


[0]ホーム

URL:


Skip to main content
Ctrl+K
JAX  documentation - Home

jax.numpy.c_

Contents

jax.numpy.c_#

jax.numpy.c_=<jax._src.numpy.index_tricks.CClassobject>#

Concatenate slices, scalars and array-like objects along the last axis.

LAX-backend implementation ofnumpy.c_.

See also

jnp.r_: Concatenates slices, scalars and array-like objects along the first axis.

Examples

>>>a=jnp.arange(6).reshape((2,3))>>>jnp.c_[a,a]Array([[0, 1, 2, 0, 1, 2],       [3, 4, 5, 3, 4, 5]], dtype=int32)

Use a string directive of the form"axis:dims:trans1d" as the first argument to specifyconcatenation axis, minimum number of dimensions, and the position of the upgraded array’soriginal dimensions in the resulting array’s shape tuple:

>>>jnp.c_['0,2',[1,2,3],[4,5,6]]Array([[1],       [2],       [3],       [4],       [5],       [6]], dtype=int32)
>>>jnp.c_['0,2,-1',[1,2,3],[4,5,6]]Array([[1, 2, 3],       [4, 5, 6]], dtype=int32)

Use the special directives"r" or"c" as the first argument on flat inputsto create an array with inputs stacked along the last axis:

>>>jnp.c_['r',[1,2,3],[4,5,6]]Array([[1, 4],       [2, 5],       [3, 6]], dtype=int32)
Contents

[8]ページ先頭

©2009-2025 Movatter.jp