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

21 statements  

« prev     ^ index     » next       coverage.py v7.15.4, created at 2026-08-18 20:49 +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"""Canonical IR type identifiers shared by custom op prototypes and execution.""" 

14 

15from enum import IntEnum 

16 

17 

18class InputType(IntEnum): 

19 REQUIRED = 0 

20 OPTIONAL = 1 

21 DYNAMIC = 2 

22 

23 

24class OutputType(IntEnum): 

25 REQUIRED = 0 

26 DYNAMIC = 1 

27 

28 

29class AttrType: 

30 INT = "VT_INT" 

31 FLOAT = "VT_FLOAT" 

32 BOOL = "VT_BOOL" 

33 STRING = "VT_STRING" 

34 DATA_TYPE = "VT_DATA_TYPE" 

35 TENSOR = "VT_TENSOR" 

36 LIST_INT = "VT_LIST_INT" 

37 LIST_FLOAT = "VT_LIST_FLOAT" 

38 LIST_BOOL = "VT_LIST_BOOL" 

39 LIST_STRING = "VT_LIST_STRING" 

40 LIST_DATA_TYPE = "VT_LIST_DATA_TYPE" 

41 LIST_LIST_INT = "VT_LIST_LIST_INT"