set_figsize()
plt.scatter(features[:, 1].asnumpy(), labels.asnumpy(),1)
How to minimize the impact of blocking calls
There are cases, when you have to use either
.asnumpy()
or.asscalar()
methods. As it is explained before, this will force Apache MXNet to block the execution until the result can be retrieved. One common use case is printing a metric or a value of a loss function.
我能理解的是plt只识别numpy。。。ndarray别的理解不太了,谢谢你!