Fix ambiguous boolean evaluation in bert.py (#13236)
Signed-off-by: Xue, Zhan <zhan.xue@intel.com>
This commit is contained in:
parent
3f6d407be4
commit
6ba3138d7c
1 changed files with 1 additions and 1 deletions
|
|
@ -119,7 +119,7 @@ def encoder_forward(
|
|||
output_hidden_states: Optional[bool] = False,
|
||||
return_dict: Optional[bool] = True,
|
||||
):
|
||||
if attention_mask and not attention_mask.any():
|
||||
if attention_mask is not None and not attention_mask.any():
|
||||
attention_mask = None
|
||||
return BertEncoder.forward(
|
||||
self=self,
|
||||
|
|
|
|||
Loading…
Reference in a new issue