From a17d5e0c7fd0a9ebc8d7d1ce794f4aff84becd22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=BC=BA?= Date: Tue, 26 Aug 2025 20:15:10 +0800 Subject: [PATCH] af api modify --- tf_adapter/python/npu_bridge/estimator/npu/npu_scope.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tf_adapter/python/npu_bridge/estimator/npu/npu_scope.py b/tf_adapter/python/npu_bridge/estimator/npu/npu_scope.py index 20547f587..d85e373d4 100644 --- a/tf_adapter/python/npu_bridge/estimator/npu/npu_scope.py +++ b/tf_adapter/python/npu_bridge/estimator/npu/npu_scope.py @@ -223,16 +223,16 @@ def disable_autofuse(): @contextlib.contextmanager def limit_core_num_scope(op_aicore_num="0", op_vectorore_num="0"): """ - Limit the aic abd aiv core num of autofuse operators within the scope. + Limit the aic and aiv core num of autofuse operators within the scope, only support aiv core num now. """ if not isinstance(op_vectorore_num, str): raise ValueError("Param op_vectorore_num must be string.") try: int_vector_core_num = int(op_vectorore_num) except ValueError: - raise ValueError("Param op_vectorore_num can not be translated into a valid int number.") - if not (0 < int_vector_core_num < 48): - raise ValueError("Param op_vectorore_num must be in a valid range.") + raise ValueError("Param op_vectorore_num can not be converted into a valid int number.") + if int_vector_core_num <= 0: + raise ValueError("Param op_vectorore_num must be greater than zero.") attrs = { "_op_vectorcore_num": attr_value_pb2.AttrValue(s=compat.as_bytes(op_vectorore_num)) } -- Gitee