You can do this using the Concat method .
a = mx.sym.Variable('a')
b = mx.sym.Variable('b')
c = mx.sym.Concat(a,b,dim=0)
To check this, you can execute your character with the help of a performer to check:
e = c.bind(mx.cpu(), {'a': mx.nd.array([100,200]), 'b':mx.nd.array([300,400])})
y = e.forward()
y[0].asnumpy()
You will get the result:
array([ 100., 200., 300., 400.], dtype=float32)
source
share