Oneflow-Inc / oneflow

OneFlow is a deep learning framework designed to be user-friendly, scalable and efficient.
http://www.oneflow.org
Apache License 2.0
5.88k stars 667 forks source link

core dumped occurs when an empty array is processed with oneflow.tensordot and the dims argument is 2 #10479

Open Redmept1on opened 6 months ago

Redmept1on commented 6 months ago

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)

image

System Information