oneflow
oneflow copied to clipboard
core dumped occurs when an empty array is processed with oneflow.tensordot and the dims argument is 2
Summary
core dumped occurs when an empty array is processed with oneflow.tensordot and the dims argument is 2
Code to reproduce bug
import oneflow as flow
import numpy as np
x1 = flow.tensor(np.array([[], []], dtype=np.float32))
x1 = x1.cuda()
x2 = flow.tensor(np.array([[], []], dtype=np.float32))
x2 = x2.cuda()
y1 = flow.tensordot(x1,x2,dims=2)
print(y1)
x1 = flow.tensor(np.array([[], []], dtype=np.float32))
x1=x1.cpu()
x2 = flow.tensor(np.array([[], []], dtype=np.float32))
x2 = x2.cpu()
y2 = flow.tensordot(x1,x2,dims=2)
print(y2)
System Information
- What is your OneFlow installation :dockerhub
- OS:Linux
- OneFlow version (run python3 -m oneflow --doctor):0.9.1.dev20231024+cu117
- Python version: 3.8