Coverage for /opt/cloud/slavespace/usr1/096471637100f3de0fcfc01072822a80/dttest/api/python/ge/ge/passes/_native.py: 100%

19 statements  

« prev     ^ index     » next       coverage.py v7.15.2, created at 2026-07-27 10:02 +0800

1#!/usr/bin/env python3 

2# -*- coding: utf-8 -*- 

3# ----------------------------------------------------------------------------------------------------------- 

4# Copyright (c) 2026 Huawei Technologies Co., Ltd. 

5# This program is free software, you can redistribute it and/or modify it under the terms and conditions of 

6# CANN Open Software License Agreement Version 2.0 (the "License"). 

7# Please refer to the License for details. You may not use this file except in compliance with the License. 

8# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, 

9# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. 

10# See LICENSE in the root of the software repository for the full text of the License. 

11# ----------------------------------------------------------------------------------------------------------- 

12 

13"""Load and re-export the selected Python pass native module.""" 

14 

15from __future__ import annotations 

16 

17__all__ = [ 

18 "MatchResult", 

19 "PassContext", 

20 "Pattern", 

21 "PatternMatcherConfig", 

22 "PatternMatcherConfigBuilder", 

23 "SubgraphInput", 

24 "SubgraphOutput", 

25 "SubgraphBoundary", 

26 "SubgraphRewriter", 

27 "borrow_match_result", 

28 "borrow_node", 

29 "can_fuse", 

30 "clone_pattern_matcher_config", 

31 "report_fuse", 

32 "release_graph", 

33] 

34 

35from .runtime import ensure_native_module 

36 

37_native = ensure_native_module() 

38 

39MatchResult = _native.MatchResult 

40PassContext = _native.PassContext 

41Pattern = _native.Pattern 

42PatternMatcherConfig = _native.PatternMatcherConfig 

43PatternMatcherConfigBuilder = _native.PatternMatcherConfigBuilder 

44SubgraphInput = _native.SubgraphInput 

45SubgraphOutput = _native.SubgraphOutput 

46SubgraphBoundary = _native.SubgraphBoundary 

47SubgraphRewriter = _native.SubgraphRewriter 

48borrow_match_result = _native.borrow_match_result 

49borrow_node = _native.borrow_node 

50can_fuse = _native.can_fuse 

51clone_pattern_matcher_config = _native.clone_pattern_matcher_config 

52report_fuse = _native.report_fuse 

53release_graph = _native.release_graph