From c89a54eeaac8bea88192793a0f4337f2f9688966 Mon Sep 17 00:00:00 2001 From: fanjibin Date: Tue, 22 Jul 2025 14:45:46 +0800 Subject: [PATCH] fix compiler --- setup.py | 4 ++-- yaml/doc/add_doc.yaml | 10 ---------- yaml/doc/reshape_and_cache_doc.yaml | 5 ++++- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/setup.py b/setup.py index 4fd97f4..694844d 100644 --- a/setup.py +++ b/setup.py @@ -186,9 +186,9 @@ class CustomBuildExt(build_ext): for gen_file in generated_files: src_gen_path = os.path.join(auto_generate_dir, gen_file) if os.path.exists(src_gen_path): - dst_gen_path = os.path.join(python_package_path, gen_file) + dst_gen_path = os.path.join(package_path, gen_file) shutil.copy(src_gen_path, dst_gen_path) - replace_cmd = ["sed", "-i", "s/import ms_cusrom_ops/from . import ms_custom_ops/g", dst_gen_path] + replace_cmd = ["sed", "-i", "s/import ms_custom_ops/from . import ms_custom_ops/g", dst_gen_path] try: result = subprocess.run(replace_cmd, cwd=self.ROOT_DIR, text=True, shell=False) except subprocess.CalledProcessError as e: diff --git a/yaml/doc/add_doc.yaml b/yaml/doc/add_doc.yaml index 7a7b9b3..b3af129 100644 --- a/yaml/doc/add_doc.yaml +++ b/yaml/doc/add_doc.yaml @@ -31,13 +31,3 @@ add: >>> output = ms_custom_ops.add(x, y) >>> print(output) [5. 7. 9.] - >>> # case 2: x is a scalar and y is a tensor - >>> x = ms.tensor(1, ms.int32) - >>> y = ms.tensor([4., 5., 6.]) - >>> output = ms_custom_ops.add(x, y) - >>> print(output) - [5. 6. 7.] - >>> # the data type of x is int32, the data type of y is float32, - >>> # and the output is the data format of higher precision float32. - >>> print(output.dtype) - Float32 diff --git a/yaml/doc/reshape_and_cache_doc.yaml b/yaml/doc/reshape_and_cache_doc.yaml index 67b9925..51a235a 100644 --- a/yaml/doc/reshape_and_cache_doc.yaml +++ b/yaml/doc/reshape_and_cache_doc.yaml @@ -14,9 +14,12 @@ reshape_and_cache: slot_mapping (Tensor): The slot mapping tensor with data type of int32. :math:`(num\_tokens,)`. - Outputs: + Returns: With same data type and same shape as `key` tensor. + Supported Platforms: + ``Ascend`` + Examples: >>> from mindspore import Tensor, Parameter >>> import ms_custom_ops -- Gitee