-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
[IPU] support dy2static for IPU merge code #43770
[IPU] support dy2static for IPU merge code #43770
Conversation
… ipu_commit/dy2static_ipu
你的PR提交成功,感谢你对开源项目的贡献! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, code review in #42952
python/paddle/fluid/layers/loss.py
Outdated
def identity_loss(x, reduction="none"): | ||
r"""Marks a tensor as being part of the loss calculation for IPU. | ||
|
||
This function should be called on the (final) loss of a model so that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
请删除 This function,文档里不这么描述。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
抱歉, 之前以为这里是取消这里的 comment, will fix later
python/paddle/fluid/layers/loss.py
Outdated
|
||
Parameters: | ||
x (Variable): The calculated loss ``Tensor``. | ||
reduction(str|int): Reduce the loss output. The default value is "none". Supported values are: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reduction(str|int, optional)
请添加 reduction 为 int 时的说明。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed,
* ``"sum"``: Sum the losses.
to
* ``"sum"`` or ``1``: Sum the losses.
python/paddle/fluid/layers/loss.py
Outdated
|
||
This function should be called on the (final) loss of a model so that | ||
it is used as the start of backpropagation. This is equivalent to calling | ||
``x.backward()`` on a tensor ``x`` when running on the CPU. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is equivalent to calling x.backward()
on a tensor x
when running on the CPU. 中文文档没有;
此外,关于 reduction ,英文版在参数中进行说明,而中文在描述中与参数中都说明了;建议按中文版,在功能描述中说明 reduction 为 string/int 时的行为,在参数描述中,保留 指定应用于输出结果的计算方式,可选的string值有: 'none'
, 'mean'
, 'sum'
,对应的int值分别为2,1,0 。默认为 'none'
。 即可
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed;
去除了
This is equivalent to calling
``x.backward()`` on a tensor ``x`` when running on the CPU.
reduction 部分已应用建议的修改, 麻烦再看下还有没有其他的问题
CI |
python/paddle/fluid/layers/loss.py
Outdated
Out = SUM(Out) | ||
|
||
Parameters: | ||
x (Variable): The calculated loss ``Tensor``. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里需要与中文语义保持一致
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
更正为:
x (Variable): The input tensor. The shapes is [N, *], where N is batch size and `*` means any number of
additional dimensions. It's data type should be float32, float64 on CPU and float16, float32 on IPU.
python/paddle/fluid/layers/loss.py
Outdated
def identity_loss(x, reduction="none"): | ||
r"""Marks a tensor as being part of the loss calculation for IPU. | ||
|
||
This function should be called on the (final) loss of a model so that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
请删除 This function,文档里不这么描述。
@TCChenlong hi, 麻烦有空再看下还有其他要修改的地方吗? 关联的 doc |
python/paddle/fluid/layers/loss.py
Outdated
Parameters: | ||
x (Variable): The input tensor. The shapes is [N, *], where N is batch size and `*` means any number of | ||
additional dimensions. It's data type should be float32, float64 on CPU and float16, float32 on IPU. | ||
reduction(str|int): Reduce the loss output. Supported string values are: 'sum', 'mean', 'none' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reduction(str|int) -> reduction(str|int, optional)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已更改为 reduction(str|int, optional):
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGMT
PR types
Others
PR changes
Others
Describe
clone of #42952
fix pre-commit CI文档 PR PaddlePaddle/docs#4932
文档预览链接:http://10.136.157.23:8090/documentation/docs/zh/faq/index_cn.html?reviewVersion=jenkins-doc-review-2374