#169 add support for einops third-party package

Merged
zoulq merged 3 commits from lhy into master 1 year ago
frelam commented 1 year ago
zoulq reviewed 1 year ago
ms_adapter/pytorch/tensor.py
@@ -130,1 +139,4 @@
else:
size = ms.Tensor(size)
return size
self._init_check()
zoulq commented 1 year ago
无需调用内部方法
frelam marked this conversation as resolved
zoulq reviewed 1 year ago
ms_adapter/pytorch/tensor.py
@@ -244,0 +260,4 @@
if dim is None:
axis = ()
else:
axis = validator.check_and_canonicalize_axes(dim, self.ndim)
zoulq commented 1 year ago
这个检查是否必须?如果mindspore对应接口会检查就无需在Adapter再检查
frelam marked this conversation as resolved
zoulq reviewed 1 year ago
ms_adapter/pytorch/tensor.py
@@ -244,0 +273,4 @@
if dim is None:
axis = ()
else:
axis = validator.check_and_canonicalize_axes(dim, self.ndim)
zoulq commented 1 year ago
同上
frelam marked this conversation as resolved
zoulq reviewed 1 year ago
ms_adapter/pytorch/tensor.py
@@ -575,1 +616,4 @@

def index_select(self, dim, index):
_input_params = cast_to_ms_tensor(self)
_axis = dim
zoulq commented 1 year ago
这个赋值可以去掉
frelam marked this conversation as resolved
zoulq reviewed 1 year ago
ms_adapter/pytorch/tensor.py
@@ -680,6 +732,8 @@ def tensor(data, dtype=None, device=None, requires_grad=False):

return Tensor(input_data=data, dtype=dtype)

def from_numpy(np_data):
zoulq commented 1 year ago
这个是torch下的方法,不要放到tensor目录下
frelam marked this conversation as resolved
zoulq merged commit eca29e1500 into master 1 year ago
The pull request has been merged as eca29e1500.
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

This pull request currently doesn't have any dependencies.

Loading…
There is no content yet.