Skip to content

Commit 929efdc

Browse files
committed
follow comments.
1 parent 4772b78 commit 929efdc

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

python/paddle/trainer/config_parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3338,7 +3338,7 @@ def __init__(self, name, inputs, cos_scale=1, device=None):
33383338
config_assert(len(self.inputs) == 2, 'CosSimLayer must have 2 inputs')
33393339
config_assert(
33403340
self.get_input_layer(0).size == self.get_input_layer(1).size,
3341-
'inputs of CosSimLayer must have same dim')
3341+
'The two inputs of CosSimLayer must have the same dimensionality.')
33423342
self.config.cos_scale = cos_scale
33433343

33443344

python/paddle/trainer_config_helpers/layers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2338,7 +2338,7 @@ def cos_sim(a, b, scale=1, size=1, name=None, layer_attr=None):
23382338
@layer_support()
23392339
def l2_distance_layer(x, y, name=None, layer_attr=None):
23402340
"""
2341-
This layer calculate and return the Euclidean distance between two input
2341+
This layer calculates and returns the Euclidean distance between two input
23422342
vectors a and b. The equation is as follows:
23432343
23442344
.. math::
@@ -2374,7 +2374,7 @@ def l2_distance_layer(x, y, name=None, layer_attr=None):
23742374
Layer(
23752375
name=name,
23762376
type=LayerType.L2_DISTANCE,
2377-
inputs=[x.name, x.name],
2377+
inputs=[x.name, y.name],
23782378
**ExtraLayerAttribute.to_kwargs(layer_attr))
23792379
return LayerOutput(name, LayerType.L2_DISTANCE, parents=[x, y], size=1)
23802380

python/paddle/trainer_config_helpers/tests/configs/protostr/test_l2_distance_layer.protostr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ layers {
2020
input_layer_name: "x"
2121
}
2222
inputs {
23-
input_layer_name: "x"
23+
input_layer_name: "y"
2424
}
2525
}
2626
input_layer_names: "x"

0 commit comments

Comments
 (0)