Skip to content

paddle.index_add 代码示例有误 #7225

@cangtianhuang

Description

@cangtianhuang

文档链接&描述 Document Links & Description

paddle.index_add 代码示例有误:

- 示例 2 (输入为 2-D Tensor, axis=1 ):
    输入:
        x.shape = [3, 3]
        x.data = [[1., 1., 1.],
                  [1., 1., 1.],
                  [1., 1., 1.]]

    参数:
        index.shape = [2]
        index.data = [0, 2]

        axis = 1

        value.shape = [3, 2]
        value.data = [[1., 1.],
                      [1., 1.],
                      [1., 1.]]
    输出:
        out.shape = [3, 3]
        out.data = [[2., 1., 2.],
                    [1., 1., 1.],
                    [2., 1., 2.]]

输出应该是:

    输出:
        out.shape = [3, 3]
        out.data = [[2., 1., 2.],
                    [2., 1., 2.],
                    [2., 1., 2.]]

请提出你的建议/提个PR修复这个问题 Please give your suggestion/update a PR to fix it

稍后我将提交 PR 修复它,英文文档 没有问题

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions