oneflow
oneflow copied to clipboard
broadcast_like op throw std::bad_alloc directly when x.dim > like.dim
Summary
broadcast_like op throw std::bad_alloc when x.dim > like.dim
Code to reproduce bug
import oneflow as flow
a = flow.randn(1, 1)
b = flow.randn(2, 2, 2)
c = flow.broadcast_like(b, a)
output:
Traceback (most recent call last):
File "/path/to/test.py", line 4, in <module>
c = flow.broadcast_like(b, a)
RuntimeError: std::bad_alloc
System Information
OneFlow version: version: 0.8.1.dev20220726+cu112