Fix bug in python/paddle/trainer/config_parser.py

The dims for crf and crf_decoding layers are wrong, i.e. height and width are swapped.
0.10.0rc
Peng Li 9 years ago
parent e9c61b67e2
commit d60d34ef3f

@ -2960,7 +2960,7 @@ class CRFLayer(LayerBase):
super(CRFLayer, self).__init__(name, 'crf', size, inputs, device=device)
config_assert(2 <= len(self.inputs) <= 3,
'CRFLayer must have 2 or 3 inputs')
self.create_input_parameter(0, size * (size + 2), [size, size + 2])
self.create_input_parameter(0, size * (size + 2), [size + 2, size])
self.config.coeff = coeff
@ -2982,7 +2982,7 @@ class CRFDecodingLayer(LayerBase):
config_assert(
len(self.inputs) <= 2,
'CRFDecodingLayer cannot have more than 2 inputs')
self.create_input_parameter(0, size * (size + 2), [size, size + 2])
self.create_input_parameter(0, size * (size + 2), [size + 2, size])
@config_layer('ctc')

Loading…
Cancel
Save