* Copyright (c) 2025 Huawei Technologies Co., Ltd.
* This program is free software, you can redistribute it and/or modify it under the terms and conditions of
* CANN Open Software License Agreement Version 2.0 (the "License").
* Please refer to the License for details. You may not use this file except in compliance with the License.
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
* See LICENSE in the root of the software repository for the full text of the License.
*/
syntax = "proto3";
package ge.mobile.proto;
enum DataType
{
DT_UNDEFINED = 0;
DT_FLOAT = 1;
DT_FLOAT16 = 2;
DT_INT8 = 3;
DT_UINT8 = 4;
DT_INT16 = 5;
DT_UINT16 = 6;
DT_INT32 = 7;
DT_INT64 = 8;
DT_UINT32 = 9;
DT_UINT64 = 10;
DT_BOOL = 11;
DT_DOUBLE = 12;
DT_FLOAT8_E4M3FN = 35;
}
message AttrDef
{
message ListValue
{
enum ListValueType{
VT_LIST_NONE = 0;
VT_LIST_STRING = 1;
VT_LIST_INT = 2;
VT_LIST_FLOAT = 3;
VT_LIST_BOOL = 4;
VT_LIST_BYTES = 5;
VT_LIST_TENSOR_DESC = 6;
VT_LIST_TENSOR = 7;
VT_LIST_GRAPH = 8;
VT_LIST_NAMED_ATTRS = 9;
}
repeated bytes s = 2;
repeated int64 i = 3;
repeated float f = 4;
repeated bool b = 5;
repeated bytes bt = 7;
repeated TensorDescriptor tf = 8;
repeated TensorDef t = 9;
repeated GraphDef g = 10;
repeated NamedAttrs na = 11;
ListValueType val_type = 20;
}
message ListListInt{
message ListInt{
repeated int64 list_i = 1;
}
repeated ListInt list_list_i = 1;
}
message ListListFloat{
message ListFloat{
repeated float list_f = 1;
}
repeated ListFloat list_list_f = 1;
}
oneof value
{
bytes s = 2;
int64 i = 3;
float f = 4;
bool b = 5;
bytes bt = 7;
ListValue list = 1;
NamedAttrs func = 10;
TensorDescriptor td = 11;
TensorDef t = 12;
GraphDef g = 13;
ListListInt list_list_int = 14;
ListListFloat list_list_float = 15;
}
}
message NamedAttrs
{
string name = 1;
map<string, AttrDef> attr = 2;
}
message ShapeDef
{
repeated int64 dim = 1;
}
message TensorDescriptor
{
string name = 1;
DataType dtype = 2;
ShapeDef shape = 3;
string layout = 4;
bool has_out_attr = 9;
int64 size = 10;
int64 weight_size = 11;
bool reuse_input = 12;
bool output_tensor = 13;
string device_type = 14;
bool input_tensor =15;
int64 real_dim_cnt = 16;
int64 reuse_input_index = 17;
int64 data_offset = 18;
int64 cmps_size = 19;
string cmps_tab = 20;
int64 cmps_tab_offset = 21;
map<string, AttrDef> attr = 5;
}
message TensorDef
{
TensorDescriptor desc = 1;
bytes data = 2;
}
message OpDef
{
string name = 1;
string type = 2;
repeated string input = 5;
map<string, AttrDef> attr = 10;
bool has_out_attr = 20;
int64 id = 21;
int64 stream_id =22;
repeated string input_name = 23;
repeated string src_name = 24;
repeated int64 src_index = 25;
repeated string dst_name = 26;
repeated int64 dst_index = 27;
repeated int64 input_i = 28;
repeated int64 output_i = 29;
repeated int64 workspace = 30;
repeated int64 workspace_bytes = 31;
repeated bool is_input_const = 32;
repeated TensorDescriptor input_desc = 33;
repeated TensorDescriptor output_desc = 34;
}
message GraphDef
{
string name = 1;
repeated string input = 4;
repeated string output = 5;
repeated OpDef op = 6;
map<string, AttrDef> attr = 11;
}
message ModelDef
{
string name = 1;
uint32 version = 2;
string custom_version = 3;
repeated GraphDef graph = 7;
map<string, AttrDef> attr = 11;
}