RuntimeError: mixed dtype (CPU): expect input to have scalar type of BFloat16

错误代码

  • RuntimeError: mixed dtype (CPU): expect input to have scalar type of BFloat16

产生原因

  • 将 tensor 与 numpy array 做运算,并将 Layernorm 应用到其计算结果。

解决方法

  • 将 numpy array 换为 tensor。

You may also like...

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

CAPTCHAis initialing...