提交 5720fedf 编写于 作者: F ForFishes

replace rank with ndim

上级 94206405
...@@ -8589,7 +8589,7 @@ def scatter_nd(index, updates, shape, name=None): ...@@ -8589,7 +8589,7 @@ def scatter_nd(index, updates, shape, name=None):
seen :code:`scatter_nd_add` . This op is the inverse of the :code:`gather_nd` op. seen :code:`scatter_nd_add` . This op is the inverse of the :code:`gather_nd` op.
Args: Args:
index (Tensor): The index input with rank > 1 and index.shape[-1] <= len(shape). index (Tensor): The index input with ndim > 1 and index.shape[-1] <= len(shape).
Its dtype should be int32 or int64 as it is used as indexes. Its dtype should be int32 or int64 as it is used as indexes.
updates (Tensor): The updated value of scatter_nd op. Its dtype should be float32, float64. updates (Tensor): The updated value of scatter_nd op. Its dtype should be float32, float64.
It must have the shape index.shape[:-1] + shape[index.shape[-1]:] It must have the shape index.shape[:-1] + shape[index.shape[-1]:]
......
...@@ -980,10 +980,10 @@ def scatter_nd_add(x, index, updates, name=None): ...@@ -980,10 +980,10 @@ def scatter_nd_add(x, index, updates, name=None):
Output is obtained by applying sparse addition to a single value Output is obtained by applying sparse addition to a single value
or slice in a Tensor. or slice in a Tensor.
:attr:`x` is a Tensor with rank :math:`R` :attr:`x` is a Tensor with ndim :math:`R`
and :attr:`index` is a Tensor with rank :math:`K` . Thus, :attr:`index` and :attr:`index` is a Tensor with ndim :math:`K` . Thus, :attr:`index`
has shape :math:`[i_0, i_1, ..., i_{K-2}, Q]` where :math:`Q \leq R` . :attr:`updates` has shape :math:`[i_0, i_1, ..., i_{K-2}, Q]` where :math:`Q \leq R` . :attr:`updates`
is a Tensor with rank :math:`K - 1 + R - Q` and its is a Tensor with ndim :math:`K - 1 + R - Q` and its
shape is :math:`index.shape[:-1] + x.shape[index.shape[-1]:]` . shape is :math:`index.shape[:-1] + x.shape[index.shape[-1]:]` .
According to the :math:`[i_0, i_1, ..., i_{K-2}]` of :attr:`index` , According to the :math:`[i_0, i_1, ..., i_{K-2}]` of :attr:`index` ,
...@@ -1018,7 +1018,7 @@ def scatter_nd_add(x, index, updates, name=None): ...@@ -1018,7 +1018,7 @@ def scatter_nd_add(x, index, updates, name=None):
Args: Args:
x (Tensor): The x input. Its dtype should be float32, float64. x (Tensor): The x input. Its dtype should be float32, float64.
index (Tensor): The index input with rank > 1 and index.shape[-1] <= x.rank. index (Tensor): The index input with ndim > 1 and index.shape[-1] <= x.ndim.
Its dtype should be int32 or int64 as it is used as indexes. Its dtype should be int32 or int64 as it is used as indexes.
updates (Tensor): The updated value of scatter_nd_add op, and it must have the same dtype updates (Tensor): The updated value of scatter_nd_add op, and it must have the same dtype
as x. It must have the shape index.shape[:-1] + x.shape[index.shape[-1]:]. as x. It must have the shape index.shape[:-1] + x.shape[index.shape[-1]:].
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册