|
|
|
@ -226,8 +226,8 @@ class LayerHelper(object):
|
|
|
|
|
scale = elementwise_div(
|
|
|
|
|
x=g, y=norm) # The shapes of g and norm are the same.
|
|
|
|
|
# Currently, elementwise_mul only support broadcast when the shape
|
|
|
|
|
# of y is a subset of x. Thus, we should reshape y to squeeze to
|
|
|
|
|
# achive it.
|
|
|
|
|
# of y is a subset of the shape of x. Thus, we reshape y to squeeze
|
|
|
|
|
# to achive the subset.
|
|
|
|
|
w = elementwise_mul(
|
|
|
|
|
x=v,
|
|
|
|
|
y=scale if dim is None else reshape(
|
|
|
|
|