Skip to content

Commit 0209d97

Browse files
authored
use lazymodule to load transformers submodules (#2057)
1 parent f99d082 commit 0209d97

File tree

9 files changed

+6553
-1264
lines changed

9 files changed

+6553
-1264
lines changed

mindnlp/core/nn/functional.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,9 @@ def relu(input, inplace=False):
2626
return execute('relu', input)
2727

2828
def tanh(input, inplace=False):
29-
if inplace:
30-
execute('inplace_tanh', input)
31-
return input
32-
return execute('tanh', input)
29+
if use_pyboost():
30+
return mint.nn.functional.tanh(input)
31+
return ops.tanh(input)
3332

3433

3534
def sigmoid(input):

0 commit comments

Comments
 (0)