diff --git a/mindnlp/core/__init__.py b/mindnlp/core/__init__.py index a75b3e39a..2680024e8 100644 --- a/mindnlp/core/__init__.py +++ b/mindnlp/core/__init__.py @@ -53,6 +53,7 @@ from ._bind import get_default_dtype, set_default_dtype, get_default_device from .amp import autocast, GradScaler from .func import vmap +from .configs import set_pyboost from . import profiler, cuda, optim, amp, compiler, jit, version, __future__, overrides, \ return_types, linalg, fx, backends, testing, nn, fft, _jit_internal, utils diff --git a/mindnlp/core/nn/functional.py b/mindnlp/core/nn/functional.py index feadb4240..2cef6b6b0 100644 --- a/mindnlp/core/nn/functional.py +++ b/mindnlp/core/nn/functional.py @@ -849,7 +849,7 @@ def conv3d(input, weight, bias=None, stride=1, padding=0, dilation=1, groups=1): mode=1, pad_mode=pad_mode, pad=pad, - stride=stride, + stride=tuple(stride), dilation=dilation, group=groups) output = conv3d_op(input, weight) diff --git a/mindnlp/core/ops/comparison.py b/mindnlp/core/ops/comparison.py index f402223b0..6025cd78e 100644 --- a/mindnlp/core/ops/comparison.py +++ b/mindnlp/core/ops/comparison.py @@ -183,7 +183,7 @@ def sort(input, *, dim=-1, descending=False, stable=False): # topk has_topk = hasattr(mindspore.mint, 'topk') def topk(input, k, dim=-1, largest=True, sorted=True): - if use_pyboost() and has_topk: + if use_pyboost() and has_topk and not ON_ORANGE_PI: out = mindspore.mint.topk(input, int(k), dim, largest, sorted) else: out = ops.topk(input, k, dim, largest, sorted) diff --git a/mindnlp/core/ops/pointwise.py b/mindnlp/core/ops/pointwise.py index fb5df41f2..322ef7e65 100644 --- a/mindnlp/core/ops/pointwise.py +++ b/mindnlp/core/ops/pointwise.py @@ -334,9 +334,9 @@ def erfc(input, *, out=None): def erfinv(input, *, out=None): + if ON_ORANGE_PI: + return erfinv_torch(input) if use_pyboost() and has_erfinv: - if ON_ORANGE_PI: - return erfinv_torch(input) return call_ms_func(mindspore.mint.erfinv, input, out=out) return call_ms_func(ops.erfinv, input, out=out)