#196 [众智活动任务1]MaxUnpool

Merged
laich merged 1 commits from mirror_yun/MSAdapter:maxunpool into master 1 year ago
laich commented 1 year ago
Collaborator
![image](/attachments/d0a1d893-a65a-4d72-84ee-5a88f7ac3251) CI不通过原因,代码中的一些格式错误
zoulq reviewed 1 year ago
ms_adapter/pytorch/nn/functional.py
@@ -1436,0 +1476,4 @@
indices = cast_to_ms_tensor(indices)

input_shape = list(input.shape)
size = _unpool_output_size(input, kernel_size, stride, padding, output_size)
zoulq commented 1 year ago
能够用numpy从原理上实现max_unpool说明对这个接口功能理解深刻,非常厉害! 从adapter实现的角度,建议直接用mindspore实现的接口功能来对标,因为numpy只能运行在cpu侧,而mindspore实现的接口针对GPU/Ascend硬件做了优化,性能上能达到最优。如果两者接口存在参数功能实现不一致,则需要在adapter做适配转换。 mindspore max_unpool1d接口实现介绍参考:https://www.mindspore.cn/docs/zh-CN/master/api_python/ops/mindspore.ops.max_unpool1d.html?highlight=max_unpool1d
zoulq reviewed 1 year ago
ms_adapter/pytorch/nn/functional.py
@@ -1436,0 +1493,4 @@
return out


def max_unpool2d(input, indices, kernel_size, stride, padding, output_size = None):
zoulq commented 1 year ago
同上,mindspore max_unpool2d接口实现介绍参考:https://www.mindspore.cn/docs/zh-CN/master/api_python/ops/mindspore.ops.max_unpool2d.html?highlight=max_unpool2d
zoulq reviewed 1 year ago
ms_adapter/pytorch/nn/functional.py
@@ -1436,0 +1524,4 @@

return out.reshape(output_size)

def max_unpool3d(input, indices, kernel_size, stride, padding, output_size = None):
zoulq commented 1 year ago
max_unpool3d也请一并修改。另外CI中错误信息是和代码检查相关(如下),建议可以直接本地运行 bash ./pylint_check.sh 进行提前检查。 ms_adapter/pytorch/tensor.py:1365:43: I1101: Module 'mindspore._c_expression' has no 'Tensor' member, but source is unavailable. Consider adding this module to extension-pkg-allow-list if you want to perform analysis based on run-time introspection of living objects. (c-extension-no-member) ************* Module ms_adapter.pytorch.nn.functional ms_adapter/pytorch/nn/functional.py:1464:0: C0325: Unnecessary parens after 'not' keyword (superfluous-parens) ms_adapter/pytorch/nn/functional.py:1519:0: C0301: Line too long (129/120) (line-too-long) ms_adapter/pytorch/nn/functional.py:1520:0: C0301: Line too long (125/120) (line-too-long) ms_adapter/pytorch/nn/functional.py:1545:0: C0301: Line too long (128/120) (line-too-long)
laich merged commit 74a44f12fb into master 1 year ago
The pull request has been merged as 74a44f12fb.
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.