#394 nn.transformer

Merged
zoulq merged 37 commits from lzh_0320 into master 1 year ago
lzh commented 1 year ago
frelam reviewed 1 year ago
ms_adapter/pytorch/nn/modules/transformer.py
@@ -0,0 +190,4 @@


class TransformerDecoderLayer(Module):
__constants__ = ['batch_first', 'norm_first']
frelam commented 1 year ago
这些不需要, torch编译用的。mindspore不使用。
lzh commented 1 year ago
已修改
lzh changed title from [WIP]nn.transformer to nn.transformer 1 year ago
zoulq reviewed 1 year ago
msadapter/pytorch/nn/functional.py
@@ -103,6 +103,9 @@ all = [
'fold',
'unfold',

'multi_head_attention_forward'
zoulq commented 1 year ago
重复了? 而且缺少“,”
zoulq reviewed 1 year ago
msadapter/pytorch/nn/modules/transformer.py
@@ -0,0 +78,4 @@
def generate_square_subsequent_mask(sz):
#TODO: replace with ms.ops.triu and ms.ops.full
# does not support ascend now
return ms.numpy.full((sz, sz), float('-inf')).triu(diagonal=1)
zoulq commented 1 year ago
1. 这里是哪个接口不支持Ascend? 2. ms.numpy.full接口返回的是mindspore tensor,再调用ms.tensor.triu返回的也是mindspore tensor。
zoulq reviewed 1 year ago
msadapter/pytorch/nn/modules/transformer.py
@@ -0,0 +275,4 @@


def _get_clones(module, N):
#TODO: CellList?
zoulq commented 1 year ago
ModuleList和CellList功能类似,但ModuleList不是基于CellList实现的,可以验一下这个接口功能,没问题的话把注释删除
zoulq reviewed 1 year ago
testing/ut/pytorch/nn/test_activation.py
@@ -9,6 +9,7 @@ from mindspore import context
import mindspore as ms
import torch
import pytest
import pytest
zoulq commented 1 year ago
新增的几个nn接口没有新增测试用例?
zoulq commented 1 year ago
Collaborator
补充GPU/Ascend平台功能验证,然后更新supportlist
lzh commented 1 year ago
Poster
gpu和ascend环境上用例已通过
lzh closed this pull request 1 year ago
lzh reopened this pull request 1 year ago
zoulq reviewed 1 year ago
msadapter/pytorch/nn/functional.py
@@ -104,2 +104,4 @@
'unfold',

'multi_head_attention_forward'
'unfold',
zoulq commented 1 year ago
这两个是重复的,还没有修改
lzh commented 1 year ago
已修改
zoulq merged commit 279c4b69e0 into master 1 year ago
lzh deleted branch lzh_0320 1 year ago
The pull request has been merged as 279c4b69e0.
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No Assignees
3 Participants
Notifications
Due Date

No due date set.

Dependencies

This pull request currently doesn't have any dependencies.

Loading…
There is no content yet.