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.79k stars 658 forks source link

when dim parameter is out of dimension, core dumped occurs with 'oneflow.var' #10450

Open Redmept1on opened 3 months ago

Redmept1on commented 3 months ago

Summary

I run a code to test oneflow.var, when I use it to a 2 dimensions tensor, and I set dim parameter equals to -3, core dumped occurs.

Code to reproduce bug

import oneflow as flow
import numpy as np

a = flow.tensor([[1,2,3],[1,2,3]],dtype=flow.float32)
print(a)

dim = -3

variance_a = flow.var(a, dim)
print(variance_a)

image

System Information