-
Notifications
You must be signed in to change notification settings - Fork 904
modify some cn doc #2710
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
modify some cn doc #2710
Changes from 1 commit
36a98db
84413da
1a02835
62ed3bd
ee5b6c0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,7 +4,7 @@ bilinear_tensor_product | |
| ------------------------------- | ||
|
|
||
|
|
||
| .. py:function:: paddle.fluid.layers.bilinear_tensor_product(x, y, size, act=None, name=None, param_attr=None, bias_attr=None) | ||
| .. py:function:: paddle.static.nn.bilinear_tensor_product(x, y, size, act=None, name=None, param_attr=None, bias_attr=None) | ||
|
|
||
|
|
||
|
|
||
|
|
@@ -40,11 +40,11 @@ bilinear_tensor_product | |
|
|
||
| .. code-block:: python | ||
|
|
||
| import paddle.fluid as fluid | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 返回类型 和 返回写在一起哈,如
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done,thx! |
||
| layer1 = fluid.layers.data("t1", shape=[-1, 5], dtype="float32") | ||
| layer2 = fluid.layers.data("t2", shape=[-1, 4], dtype="float32") | ||
| tensor = fluid.layers.bilinear_tensor_product(x=layer1, y=layer2, size=1000) | ||
|
|
||
| import paddle | ||
| paddle.enable_static() | ||
| layer1 = paddle.static.data("t1", shape=[-1, 5], dtype="float32") | ||
| layer2 = paddle.static.data("t2", shape=[-1, 4], dtype="float32") | ||
| tensor = paddle.static.nn.bilinear_tensor_product(x=layer1, y=layer2, size=1000) | ||
|
|
||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,7 @@ | |
| generate | ||
| ------------------------------- | ||
|
|
||
| .. py:function:: paddle.fluid.unique_name.generate(key) | ||
| .. py:function:: paddle.utils.unique_name.generate(key) | ||
|
|
||
|
|
||
|
|
||
|
|
@@ -21,9 +21,8 @@ generate | |
|
|
||
| .. code-block:: python | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 返回类型同上
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done,thx! |
||
|
|
||
| import paddle.fluid as fluid | ||
| name1 = fluid.unique_name.generate('fc') | ||
| name2 = fluid.unique_name.generate('fc') | ||
| print(name1, name2) # fc_0, fc_1 | ||
|
|
||
| import paddle | ||
| name1 = paddle.utils.unique_name.generate('fc') | ||
| name2 = paddle.utils.unique_name.generate('fc') | ||
| print(name1, name2) # fc_0, fc_1 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,7 @@ | |
| switch | ||
| ------------------------------- | ||
|
|
||
| .. py:function:: paddle.fluid.unique_name.switch(new_generator=None) | ||
| .. py:function:: paddle.utils.unique_name.switch(new_generator=None) | ||
|
|
||
|
|
||
|
|
||
|
|
@@ -21,15 +21,15 @@ switch | |
|
|
||
| .. code-block:: python | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 返回类型同上
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done,thx! |
||
|
|
||
| import paddle.fluid as fluid | ||
| name1 = fluid.unique_name.generate('fc') | ||
| name2 = fluid.unique_name.generate('fc') | ||
| print(name1, name2) # fc_0, fc_1 | ||
| pre_generator = fluid.unique_name.switch() # 切换到新命名空间 | ||
| name2 = fluid.unique_name.generate('fc') | ||
| print(name2) # fc_0 | ||
|
|
||
| fluid.unique_name.switch(pre_generator) # 切换回原命名空间 | ||
| name3 = fluid.unique_name.generate('fc') | ||
| print(name3) # fc_2, 因为原命名空间已生成fc_0, fc_1 | ||
| import paddle | ||
| name1 = paddle.utils.unique_name.generate('fc') | ||
| name2 = paddle.utils.unique_name.generate('fc') | ||
| print(name1, name2) # fc_0, fc_1 | ||
|
|
||
| pre_generator, pre_dygraph_name_checker = paddle.utils.unique_name.switch() # switch to a new anonymous namespace. | ||
| name2 = paddle.utils.unique_name.generate('fc') | ||
| print(name2) # fc_0 | ||
|
|
||
| paddle.utils.unique_name.switch(pre_generator, pre_dygraph_name_checker) # switch back to pre_generator. | ||
| name3 = paddle.utils.unique_name.generate('fc') | ||
| print(name3) # fc_2, since pre_generator has generated fc_0, fc_1. | ||
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.
这个文件周威已经更新了 PR 2703
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.
好的,我回滚了我的修改。