#142 add some functions in tensor

Merged
laich merged 12 commits from tanh01 into master 1 year ago
kcl commented 1 year ago
hanjr reviewed 1 year ago
ms_adapter/pytorch/tensor.py
@@ -317,0 +356,4 @@
input_ms = cast_to_ms_tensor(self)
return cast_to_adapter_tensor(input_ms.bmm(batch2))

def clamp(self, min, max):
hanjr commented 1 year ago
torch原本的clamp是可以不输入min和max其中一个,不输min就没有下限,不输入max没有上限。
kcl commented 1 year ago
已修复
kcl marked this conversation as resolved
zoulq reviewed 1 year ago
ms_adapter/pytorch/tensor.py
@@ -317,0 +416,4 @@
def sub(self, other, *, alpha=1):
input_ms = cast_to_ms_tensor(self)
input_other = cast_to_ms_tensor(other) * alpha
output = ms.Tensor.sub(input_ms, input_other)
zoulq commented 1 year ago
建议直接调用mindspore.ops.sub接口,性能更高
kcl commented 1 year ago
已修改
kcl marked this conversation as resolved
laich commented 1 year ago
Collaborator
git pull origin master 然后再提交代码
laich merged commit ccfd4210a6 into master 1 year ago
The pull request has been merged as ccfd4210a6.
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No Assignees
4 Participants
Notifications
Due Date

No due date set.

Dependencies

This pull request currently doesn't have any dependencies.

Loading…
There is no content yet.