Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
3b7d9f7b
P
Paddle
项目概览
BaiXuePrincess
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
3b7d9f7b
编写于
9月 20, 2018
作者:
T
tensor-tang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove kwargs of some activation api
上级
f66d08c2
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
63 addition
and
28 deletion
+63
-28
paddle/fluid/API.spec
paddle/fluid/API.spec
+16
-16
python/paddle/fluid/layers/layer_function_generator.py
python/paddle/fluid/layers/layer_function_generator.py
+28
-1
python/paddle/fluid/layers/ops.py
python/paddle/fluid/layers/ops.py
+19
-11
未找到文件。
paddle/fluid/API.spec
浏览文件 @
3b7d9f7b
...
@@ -257,23 +257,23 @@ paddle.fluid.layers.sum ArgSpec(args=[], varargs='args', keywords='kwargs', defa
...
@@ -257,23 +257,23 @@ paddle.fluid.layers.sum ArgSpec(args=[], varargs='args', keywords='kwargs', defa
paddle.fluid.layers.slice ArgSpec(args=[], varargs='args', keywords='kwargs', defaults=None)
paddle.fluid.layers.slice ArgSpec(args=[], varargs='args', keywords='kwargs', defaults=None)
paddle.fluid.layers.shape ArgSpec(args=[], varargs='args', keywords='kwargs', defaults=None)
paddle.fluid.layers.shape ArgSpec(args=[], varargs='args', keywords='kwargs', defaults=None)
paddle.fluid.layers.maxout ArgSpec(args=[], varargs='args', keywords='kwargs', defaults=None)
paddle.fluid.layers.maxout ArgSpec(args=[], varargs='args', keywords='kwargs', defaults=None)
paddle.fluid.layers.sigmoid ArgSpec(args=[
], varargs='args', keywords='kwargs'
, defaults=None)
paddle.fluid.layers.sigmoid ArgSpec(args=[
'x'], varargs=None, keywords=None
, defaults=None)
paddle.fluid.layers.logsigmoid ArgSpec(args=[
], varargs='args', keywords='kwargs'
, defaults=None)
paddle.fluid.layers.logsigmoid ArgSpec(args=[
'x'], varargs=None, keywords=None
, defaults=None)
paddle.fluid.layers.exp ArgSpec(args=[
], varargs='args', keywords='kwargs'
, defaults=None)
paddle.fluid.layers.exp ArgSpec(args=[
'x'], varargs=None, keywords=None
, defaults=None)
paddle.fluid.layers.tanh ArgSpec(args=[
], varargs='args', keywords='kwargs'
, defaults=None)
paddle.fluid.layers.tanh ArgSpec(args=[
'x'], varargs=None, keywords=None
, defaults=None)
paddle.fluid.layers.tanh_shrink ArgSpec(args=[
], varargs='args', keywords='kwargs'
, defaults=None)
paddle.fluid.layers.tanh_shrink ArgSpec(args=[
'x'], varargs=None, keywords=None
, defaults=None)
paddle.fluid.layers.softshrink ArgSpec(args=[], varargs='args', keywords='kwargs', defaults=None)
paddle.fluid.layers.softshrink ArgSpec(args=[], varargs='args', keywords='kwargs', defaults=None)
paddle.fluid.layers.sqrt ArgSpec(args=[
], varargs='args', keywords='kwargs'
, defaults=None)
paddle.fluid.layers.sqrt ArgSpec(args=[
'x'], varargs=None, keywords=None
, defaults=None)
paddle.fluid.layers.abs ArgSpec(args=[
], varargs='args', keywords='kwargs'
, defaults=None)
paddle.fluid.layers.abs ArgSpec(args=[
'x'], varargs=None, keywords=None
, defaults=None)
paddle.fluid.layers.ceil ArgSpec(args=[
], varargs='args', keywords='kwargs'
, defaults=None)
paddle.fluid.layers.ceil ArgSpec(args=[
'x'], varargs=None, keywords=None
, defaults=None)
paddle.fluid.layers.floor ArgSpec(args=[
], varargs='args', keywords='kwargs'
, defaults=None)
paddle.fluid.layers.floor ArgSpec(args=[
'x'], varargs=None, keywords=None
, defaults=None)
paddle.fluid.layers.cos ArgSpec(args=[
], varargs='args', keywords='kwargs'
, defaults=None)
paddle.fluid.layers.cos ArgSpec(args=[
'x'], varargs=None, keywords=None
, defaults=None)
paddle.fluid.layers.sin ArgSpec(args=[
], varargs='args', keywords='kwargs'
, defaults=None)
paddle.fluid.layers.sin ArgSpec(args=[
'x'], varargs=None, keywords=None
, defaults=None)
paddle.fluid.layers.round ArgSpec(args=[
], varargs='args', keywords='kwargs'
, defaults=None)
paddle.fluid.layers.round ArgSpec(args=[
'x'], varargs=None, keywords=None
, defaults=None)
paddle.fluid.layers.reciprocal ArgSpec(args=[
], varargs='args', keywords='kwargs'
, defaults=None)
paddle.fluid.layers.reciprocal ArgSpec(args=[
'x'], varargs=None, keywords=None
, defaults=None)
paddle.fluid.layers.square ArgSpec(args=[
], varargs='args', keywords='kwargs'
, defaults=None)
paddle.fluid.layers.square ArgSpec(args=[
'x'], varargs=None, keywords=None
, defaults=None)
paddle.fluid.layers.softplus ArgSpec(args=[
], varargs='args', keywords='kwargs'
, defaults=None)
paddle.fluid.layers.softplus ArgSpec(args=[
'x'], varargs=None, keywords=None
, defaults=None)
paddle.fluid.layers.softsign ArgSpec(args=[
], varargs='args', keywords='kwargs'
, defaults=None)
paddle.fluid.layers.softsign ArgSpec(args=[
'x'], varargs=None, keywords=None
, defaults=None)
paddle.fluid.layers.brelu ArgSpec(args=[], varargs='args', keywords='kwargs', defaults=None)
paddle.fluid.layers.brelu ArgSpec(args=[], varargs='args', keywords='kwargs', defaults=None)
paddle.fluid.layers.leaky_relu ArgSpec(args=[], varargs='args', keywords='kwargs', defaults=None)
paddle.fluid.layers.leaky_relu ArgSpec(args=[], varargs='args', keywords='kwargs', defaults=None)
paddle.fluid.layers.soft_relu ArgSpec(args=[], varargs='args', keywords='kwargs', defaults=None)
paddle.fluid.layers.soft_relu ArgSpec(args=[], varargs='args', keywords='kwargs', defaults=None)
...
...
python/paddle/fluid/layers/layer_function_generator.py
浏览文件 @
3b7d9f7b
...
@@ -23,7 +23,10 @@ from ..proto import framework_pb2
...
@@ -23,7 +23,10 @@ from ..proto import framework_pb2
from
..framework
import
OpProtoHolder
,
Variable
from
..framework
import
OpProtoHolder
,
Variable
from
..layer_helper
import
LayerHelper
from
..layer_helper
import
LayerHelper
__all__
=
[
'deprecated'
,
'generate_layer_fn'
,
'autodoc'
,
'templatedoc'
]
__all__
=
[
'deprecated'
,
'generate_layer_fn'
,
'generate_layer_fn_noattr'
,
'autodoc'
,
'templatedoc'
]
def
_convert_
(
name
):
def
_convert_
(
name
):
...
@@ -205,6 +208,30 @@ def generate_layer_fn(op_type):
...
@@ -205,6 +208,30 @@ def generate_layer_fn(op_type):
return
func
return
func
def
generate_layer_fn_noattr
(
op_type
):
"""Register the Python layer for an Operator without Attribute.
Args:
op_type: The name of the operator to be created.
This function takes in the operator type (sigmoid, exp , tanh etc) and
creates the operator functionality.
"""
op_proto
=
OpProtoHolder
.
instance
().
get_op_proto
(
op_type
)
def
func
(
x
):
helper
=
LayerHelper
(
op_type
,
**
locals
())
output
=
helper
.
create_tmp_variable
(
dtype
=
helper
.
input_dtype
())
helper
.
append_op
(
type
=
op_type
,
inputs
=
{
"X"
:
[
x
]},
outputs
=
{
"Out"
:
[
output
]})
return
output
func
.
__name__
=
op_type
func
.
__doc__
=
_generate_doc_string_
(
op_proto
)
return
func
def
deprecated
(
func_or_class
):
def
deprecated
(
func_or_class
):
"""
"""
Deprecated warning decorator. It will result a warning message.
Deprecated warning decorator. It will result a warning message.
...
...
python/paddle/fluid/layers/ops.py
浏览文件 @
3b7d9f7b
...
@@ -13,15 +13,27 @@
...
@@ -13,15 +13,27 @@
# limitations under the License.
# limitations under the License.
from
__future__
import
print_function
from
__future__
import
print_function
from
.layer_function_generator
import
generate_layer_fn
from
.layer_function_generator
import
generate_layer_fn
,
generate_layer_fn_noattr
__activations__
=
[
__activations__
=
[
'softshrink'
,
'brelu'
,
'leaky_relu'
,
'soft_relu'
,
'elu'
,
'relu6'
,
'pow'
,
'stanh'
,
'hard_sigmoid'
,
'swish'
,
]
__activations_noattr__
=
[
'sigmoid'
,
'sigmoid'
,
'logsigmoid'
,
'logsigmoid'
,
'exp'
,
'exp'
,
'tanh'
,
'tanh'
,
'tanh_shrink'
,
'tanh_shrink'
,
'softshrink'
,
'sqrt'
,
'sqrt'
,
'abs'
,
'abs'
,
'ceil'
,
'ceil'
,
...
@@ -33,15 +45,6 @@ __activations__ = [
...
@@ -33,15 +45,6 @@ __activations__ = [
'square'
,
'square'
,
'softplus'
,
'softplus'
,
'softsign'
,
'softsign'
,
'brelu'
,
'leaky_relu'
,
'soft_relu'
,
'elu'
,
'relu6'
,
'pow'
,
'stanh'
,
'hard_sigmoid'
,
'swish'
,
]
]
__all__
=
[
__all__
=
[
...
@@ -75,6 +78,11 @@ __all__ = [
...
@@ -75,6 +78,11 @@ __all__ = [
for
_OP
in
set
(
__all__
):
for
_OP
in
set
(
__all__
):
globals
()[
_OP
]
=
generate_layer_fn
(
_OP
)
globals
()[
_OP
]
=
generate_layer_fn
(
_OP
)
__all__
+=
__activations_noattr__
for
_OP
in
set
(
__activations_noattr__
):
globals
()[
_OP
]
=
generate_layer_fn_noattr
(
_OP
)
__all__
+=
[
"uniform_random"
]
__all__
+=
[
"uniform_random"
]
_uniform_random_
=
generate_layer_fn
(
'uniform_random'
)
_uniform_random_
=
generate_layer_fn
(
'uniform_random'
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录