Skip to content

修正了没有区分框架的文本描述 #1379

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions chapter_preliminaries/ndarray.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,28 @@ x
x.shape
```

:begin_tab:`mxnet`
如果只想知道张量中元素的总数,即形状的所有元素乘积,可以检查它的大小(size)。
因为这里在处理的是一个向量,所以它的`shape`与它的`size`相同。
:end_tab:

:begin_tab:`pytorch`
如果只想知道张量中元素的总数,即形状的所有元素乘积,可以检查它的元素个数(numel)。
因为这里在处理的是一个向量,所以它的`shape`与它的`numel`相同。
:end_tab:

:begin_tab:`tensorflow`
如果只想知道张量中元素的总数,即形状的所有元素乘积,可以对其使用检查大小(size)函数。
因为这里在处理的是一个向量,所以它的`shape`与它的`size`相同。
:end_tab:

:begin_tab:`paddle`
如果只想知道张量中元素的总数,即形状的所有元素乘积,可以检查它的元素个数(numel)。
因为这里在处理的是一个向量,所以它的`shape`与它的`numel`相同。
:end_tab:

```{.python .input}
#@tab mxnet
x.size
```

Expand Down
Loading