openmlsys-zh icon indicating copy to clipboard operation
openmlsys-zh copied to clipboard

generation_of_computational_graph ms_function code indent issue

Open nope8 opened this issue 2 years ago • 0 comments

@ms_function #mindspore中基于源码转换的函数装饰器,可以将该函数转换为静态图 def add_and_relu(Y, b): Y = Y + b Y = relu(Y) return Y

def model(X, flag): if flag>0: Y = matmul(W1, X) else: Y = matmul(W2, X) Y = add_and_relu(Y, b) //code indent error return Y

should change to:

@ms_function #mindspore中基于源码转换的函数装饰器,可以将该函数转换为静态图 def add_and_relu(Y, b): Y = Y + b Y = relu(Y) return Y

def model(X, flag): if flag>0: Y = matmul(W1, X) else: Y = matmul(W2, X) Y = add_and_relu(Y, b) return Y

nope8 avatar May 14 '23 04:05 nope8