Table Of Contents
Table Of Contents

mx.symbol.stack

Description

Join a sequence of arrays along a new axis.

The axis parameter specifies the index of the new axis in the dimensions of the result. For example, if axis=0 it will be the first dimension and if axis=-1 it will be the last dimension.

Example:

x = [1, 2]
y = [3, 4]

stack(x, y) = [[1, 2],
[3, 4]]
stack(x, y, axis=1) = [[1, 3],
[2, 4]]

Usage

mx.symbol.stack(...)

Arguments

Argument

Description

data

NDArray-or-Symbol[].

List of arrays to stack

axis

int, optional, default=‘0’.

The axis in the result array along which the input arrays are stacked.

num.args

int, required.

Number of inputs to be stacked.

name

string, optional.

Name of the resulting symbol.

Value

out The result mx.symbol