def expand_dims(a, axis):
    # TODO(okuta): check type
    shape = a.shape
    if axis < 0:
        axis = axis + len(shape) + 1
    return a.reshape(shape[:axis] + (1,) + shape[axis:])
Expands given arrays.
dataset/ETHPy150Open pfnet/chainer/cupy/manipulation/dims.py/expand_dims