Skip to content
This repository has been archived by the owner on Aug 11, 2020. It is now read-only.

About getting the shape of a tensor #259

Open
AIROBOTAI opened this issue Jun 15, 2017 · 1 comment
Open

About getting the shape of a tensor #259

AIROBOTAI opened this issue Jun 15, 2017 · 1 comment

Comments

@AIROBOTAI
Copy link

Hi all, I'm a newbie in mxnet, I can not understand why I got those results from the following code snippet:

TensorContainer<cpu, 2> lhs(Shape2(2, 3));
lhs = 1.0;
printf("%u %u\n", lhs.size(0), lhs.size(1));
printf("%u %u\n", lhs[0].shape_[0], lhs[0].shape_[1]);
printf("%u %u\n", lhs[0].size(0), lhs[0].size(1));

The output is:

2 3
3 4
3 3

Why are the second and third outputs those numbers? Because lhs[0] is one-dimensional, I think they should be exactly the same, i.e. 3 0. Could anyone tell me where I was wrong? Thanks in advance!

@szha
Copy link
Member

szha commented Aug 4, 2019

This code base has been donated to the Apache MXNet project per #373, and repo is deprecated. Future development and issue tracking should continue in Apache MXNet.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants