Skip to content

Commit a276684

Browse files
author
Haonan
authored
Merge pull request #429 from emailweixu/math_mul
'*' operator overload for LayerOutput
2 parents 8295eb9 + 36fa251 commit a276684

File tree

7 files changed

+294
-49
lines changed

7 files changed

+294
-49
lines changed

doc/ui/api/trainer_config_helpers/layers.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,12 @@ expand_layer
254254
:members: expand_layer
255255
:noindex:
256256

257+
repeat_layer
258+
------------
259+
.. automodule:: paddle.trainer_config_helpers.layers
260+
:members: repeat_layer
261+
:noindex:
262+
257263
Math Layers
258264
===========
259265

python/paddle/trainer/config_parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3015,7 +3015,7 @@ def Layer(
30153015
layer_func = layers.get(type)
30163016
config_assert(layer_func,
30173017
"layer type '%s' not supported." % type)
3018-
layer_func(name, **xargs)
3018+
return layer_func(name, **xargs)
30193019

30203020
@config_func
30213021
def ParameterHook(

python/paddle/trainer_config_helpers/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,6 @@
2020
from networks import *
2121
from optimizers import *
2222
from attrs import *
23+
24+
# This will enable operator overload for LayerOutput
25+
import math

0 commit comments

Comments
 (0)