Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flow.div 算子和 torch.div 没对齐 #242

Open
triple-Mu opened this issue Jun 30, 2022 · 0 comments
Open

flow.div 算子和 torch.div 没对齐 #242

triple-Mu opened this issue Jun 30, 2022 · 0 comments

Comments

@triple-Mu
Copy link
Contributor

image

import oneflow as flow
import torch
import numpy as np

a = np.random.randn(3,3).astype(np.float32)

b = 2

torch_a = torch.from_numpy(a)
flow_a = flow.from_numpy(a)

print(torch.div(torch_a,b,rounding_mode='floor'))
print(flow.div(flow_a,b).floor())
print(flow.div(flow_a,b,rounding_mode='floor'))
mergify bot added a commit to Oneflow-Inc/oneflow that referenced this issue Jan 17, 2023
给 `flow.div` 接口添加 rounding_mode keyword 参数

问题来源:Oneflow-Inc/vision#242

- [x] div(tensor x, tensor y, rounding_mode) 
- [x] div(scalar x, tensor y, rounding_mode) 
- [x] div(tensor x, scalar y, rounding_mode) 


![image](https://user-images.githubusercontent.com/3351623/197500696-7306afdc-b0aa-441b-9a6a-3ffbd70cd50d.png)

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Xiaoyu Zhang <35585791+BBuf@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant