1、Variables decorated by Prop link, "Consume, and Obiectlink cannot be initialized locally
原因:被装饰器修饰的数据,不能初始化。这个应该是后续版本做了优化。当前使用 DevEco Studio 3.1.1 Release
Transformer中PositionalEncoding类的pytorch代码实现如下:
class PositionalEncoding(nn.Module):"Implement the PE function."def __init__(self, d_model, dropout, max_len5000):super(PositionalEncoding, self).__init__()self.dropout nn.Dropo…