Browse Source

add function wraps for parameter init function

tags/v1.6.0
lianliguang 4 years ago
parent
commit
a047ab4a8d
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      mindspore/ops/primitive.py

+ 2
- 0
mindspore/ops/primitive.py View File

@@ -14,6 +14,7 @@
# ============================================================================

"""primitive"""
import functools
import inspect
import copy
from mindspore.common.api import _wrap_func
@@ -606,6 +607,7 @@ def prim_attr_register(fn):
>>> matmul = MatMul()
"""

@functools.wraps(fn)
def deco(self, *args, **kwargs):
class_name = self.__class__.__name__
if hasattr(self.__class__, "substitute_name"):


Loading…
Cancel
Save