#396 floor_divide for higher ver of torch

Merged
zoulq merged 5 commits from lzh_floor_divide into master 1 year ago
lzh commented 1 year ago
zoulq reviewed 1 year ago
ms_adapter/pytorch/tensor.py
@@ -7,6 +7,7 @@ import operator
from functools import reduce, lru_cache
import numpy as np
import mindspore as ms
import torch
zoulq commented 1 year ago
接口代码里不能出现torch,只能在用例里出现
lzh commented 1 year ago
已修改
zoulq reviewed 1 year ago
ms_adapter/pytorch/tensor.py
@@ -3263,3 +3266,4 @@
input = cast_to_ms_tensor(self)
value = cast_to_ms_tensor(value)
output = ms.ops.div(input, value, rounding_mode='trunc')
if torch.__version__ >= '1.13.0':
zoulq commented 1 year ago
这里判断torch版本没有意义,用户使用adapter就是用mindspore不再用torch
lzh commented 1 year ago
已修改
zoulq reviewed 1 year ago
ms_adapter/pytorch/tensor.py
@@ -3265,1 +3268,4 @@
output = ms.ops.div(input, value, rounding_mode='trunc')
if torch.__version__ >= '1.13.0':
floor_div = ms.ops.FloorDiv()
output = floor_div(input, value)
zoulq commented 1 year ago
功能只对标torch 1.12版本,可用加上注释说明和torch1.13版本的功能差异
lzh commented 1 year ago
已修改
zoulq merged commit a3a3d7ebd7 into master 1 year ago
lzh deleted branch lzh_floor_divide 1 year ago
The pull request has been merged as a3a3d7ebd7.
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.