未验证 提交 9220005c 编写于 作者: Z zhongpu 提交者: GitHub

fix if logic in dygraph, test=develop (#24209)

上级 5c09a955
......@@ -961,7 +961,7 @@ class Linear(layers.Layer):
tmp = self._helper.create_variable_for_type_inference(self._dtype)
self._helper.append_op(
type="matmul", inputs=inputs, outputs={"Out": tmp}, attrs=attrs)
if self.bias:
if self.bias is not None:
pre_activation = self._helper.create_variable_for_type_inference(
dtype=self._dtype)
self._helper.append_op(
......
......@@ -473,7 +473,7 @@ def edit_distance(input,
label = erased_label
this_inputs = {"Hyps": [input], "Refs": [label]}
if input_length and label_length:
if input_length is not None and label_length is not None:
this_inputs['HypsLength'] = [input_length]
this_inputs['RefsLength'] = [label_length]
......
......@@ -1022,7 +1022,7 @@ def chunk_eval(input,
this_input = {"Inference": [input], "Label": [label]}
if seq_length:
if seq_length is not None:
this_input["SeqLength"] = [seq_length]
helper.append_op(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册