How do you combine characters in mxnet

I have 2 characters in MXNet and would like to concatenate them. How can i do this:

such as: a = [100,200], b = [300,400], Id like to get

c = [100,200,300,400]

+6
source share
1 answer

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)
+7
source

Source: https://habr.com/ru/post/1016018/


All Articles