mxnet随笔-repeat

 # -*- coding: utf-8 -*-
"""
Spyder Editor

This is a temporary script file.
"""
import mxnet as mx

x = mx.nd.array([[ 1, 2],[ 3, 4]])

print mx.nd.repeat(x, repeats=2) 

print mx.nd.repeat(x, repeats=2, axis=1) 

print mx.nd.repeat(x, repeats=2, axis=0)
print mx.nd.repeat(x, repeats=2, axis=-1)

[1. 1. 2. 2. 3. 3. 4. 4.]

[[1. 1. 2. 2.]
[3. 3. 4. 4.]]

[[1. 2.]
[1. 2.]
[3. 4.]
[3. 4.]]

[[1. 1. 2. 2.]
[3. 3. 4. 4.]]

你可能感兴趣的:(mxnet,AI)