未验证 提交 23fb630e 编写于 作者: C Christian Clauss 提交者: GitHub

Use ==/!= to compare str, bytes, and int literals

Identity is not the same thing as equality in Python.

$ python
```
>>> self_dtype = "float"
>>> self_dtype += "16"
>>> self_dtype == "float16"
True
>>> self_dtype is "float16"
False
```
上级 a75ba9d4
......@@ -134,7 +134,7 @@ class ErnieModel(object):
emb_out = pre_process_layer(
emb_out, 'nd', self._prepostprocess_dropout, name='pre_encoder')
if self._dtype is "float16":
if self._dtype == "float16":
emb_out = fluid.layers.cast(x=emb_out, dtype=self._dtype)
input_mask = fluid.layers.cast(x=input_mask, dtype=self._dtype)
self_attn_mask = fluid.layers.matmul(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册