summaryrefslogtreecommitdiff
path: root/numpy/_array_api/_manipulation_functions.py
blob: 262c712f80e9037fd25b5a463ebcee8cf91b38d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import numpy as np

def concat(arrays, /, *, axis=0):
    # Note: the function name is different here
    return np.concatenate(arrays, axis=axis)

def expand_dims(x, axis, /):
    return np.expand_dims(x, axis)

def flip(x, /, *, axis=None):
    return np.flip(x, axis=axis)

def reshape(x, shape, /):
    return np.reshape(x, shape)

def roll(x, shift, /, *, axis=None):
    return np.roll(x, shift, axis=axis)

def squeeze(x, /, *, axis=None):
    return np.squeeze(x, axis=axis)

def stack(arrays, /, *, axis=0):
    return np.stack(arrays, axis=axis)