diff --git a/mindinsight/domain/__init__.py b/mindinsight/domain/__init__.py new file mode 100644 index 00000000..6228b713 --- /dev/null +++ b/mindinsight/domain/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021 Huawei Technologies Co., Ltd +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================================ diff --git a/mindinsight/domain/graph/__init__.py b/mindinsight/domain/graph/__init__.py new file mode 100644 index 00000000..6228b713 --- /dev/null +++ b/mindinsight/domain/graph/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2021 Huawei Technologies Co., Ltd +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================================ diff --git a/mindinsight/domain/graph/base.py b/mindinsight/domain/graph/base.py new file mode 100644 index 00000000..59baa0b1 --- /dev/null +++ b/mindinsight/domain/graph/base.py @@ -0,0 +1,525 @@ +# Copyright 2021 Huawei Technologies Co., Ltd +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================================ +"""Base module.""" + +import os +import re +import enum +import collections + +import numpy as np + +from mindinsight.domain.graph.exceptions import UnknownTensorError + + +class MindSporeType(enum.Enum): + """MindSpore Type.""" + INT = 'int32' + UINT = 'uint' + FLOAT = 'float16' + TENSOR = 'tensor' + + +class DeviceType(enum.Enum): + """Device Type.""" + ASCEND = 'ascend' + GPU = 'gpu' + + +class DumpType(enum.Enum): + """Dump Type.""" + E2E = 'e2e' + ASYNC = 'async' + + +class Tensor: + """ + Tensor object of dump file. + + Args: + op_id (str): Operator ID. + index (int): Index of operator inputs/outputs. + file_path (str): Absolute file path of tensor file. + """ + + FEATURE = collections.namedtuple('Feature', ['type', 'id', 'io']) + VALUE = collections.namedtuple('Value', ['index', 'shape', 'dtype', 'path']) + + @classmethod + def extract_shape_from_str(cls, shape_str): + """ + Extract shape from tensor file. + + Args: + shape_str (str): Shape string. + + Returns: + tuple, shape of tensor file. + """ + shape = tuple([int(dim.strip()) for dim in shape_str.strip('_').split('_')]) + # The shape info in dump file name is (0,) which is inconsistent with the actual tensor shape. + # The shape needs to be converted to (1,). + if shape == (0,): + shape = (1,) + return shape + + @classmethod + def parse_tensor_file_name(cls, file_name): + """ + Parse tensor file name. + + Args: + file_name (str): Tensor file name. + + Returns: + bool, indicating if node is operator. + dict, tensor file info. + + Raises: + UnknownTensorError: If tensor file name can not be recognized. + """ + is_op = False + is_npy = file_name.endswith('.npy') + if re.search(r'-op\d+(_|(\.\d+\.\d+\.))(input|output)(_|\.)', file_name): + is_op = True + dump_type = DumpType.E2E + if re.search(r'-op(?P\d+)\.(?P\d+)\.(?P\d+)', file_name): + dump_type = DumpType.ASYNC + + if dump_type == DumpType.ASYNC: + file_name = file_name[file_name.find('.')+1:] + if is_npy: + regex = r'_(?P[A-Za-z0-9]+)-op(?P\d+)' \ + r'\.(?P\d+)\.(?P\d+)' \ + r'\.(?Pinput|output)' \ + r'\.(?P\d+)' \ + r'\.npy$' + else: + regex = r'_(?P[A-Za-z0-9]+)-op(?P\d+)' \ + r'\.(?P\d+)\.(?P\d+)' \ + r'\.(?Pinput|output)' \ + r'\.(?P\d+)' \ + r'\.(?P[0-9\_]+)' \ + r'\.(?Pbool|((uint|int|float)\d+))' \ + r'\.(?P[A-Za-z0-9\_]+)\.bin$' + + else: + regex = r'--(?P[A-Za-z0-9\_]+)-op(?P\d+)' \ + r'_(?Pinput|output)' \ + r'_(?P\d+)' \ + r'_shape_(?P[0-9\_]+)' \ + r'_.*(?PBool|((UInt|Int|Float)\d+))' \ + r'_(?P[A-Za-z0-9\_]+)\.bin$' + + else: + regex = r'^(?P[A-Za-z0-9\.\_]+)' \ + r'_(?Pinput|output)' \ + r'_(?P\d+)' \ + r'_shape_(?P[0-9\_]+)' \ + r'_.*(?PBool|((UInt|Int|Float)\d+))' \ + r'_(?P[A-Za-z0-9\_]+)\.bin$' + + pattern = re.search(regex, file_name) + if pattern is None: + raise UnknownTensorError(is_op, file_name) + + info = pattern.groupdict() + info['index'] = int(info['index']) + info['shape'] = None if is_npy else cls.extract_shape_from_str(info['shape']) + info['dtype'] = None if is_npy else info['dtype'].lower() + return is_op, info + + @classmethod + def scan_tensors(cls, tensor_dir): + """ + Scan tensors. + + Args: + tensor_dir (str): Directory path where holds the tensor files. + check (lambda): Function to check tensor values. + + Returns: + dict, tensor file mapping. + """ + tensor_mapping = {} + if not tensor_dir: + return tensor_mapping + + file_names = os.listdir(tensor_dir) + for file_name in file_names: + full_path = os.path.join(tensor_dir, file_name) + if not re.search(r'\.(bin|npy)$', file_name) or os.path.isdir(full_path): + continue + + try: + is_op, info = cls.parse_tensor_file_name(file_name) + except UnknownTensorError: + continue + + if is_op: + feature = cls.FEATURE(type=info['op_name'], id=info['op_id'], io=info['io']) + else: + feature = cls.FEATURE(type='', id=info['node_name'], io=info['io']) + + value = cls.VALUE(index=info['index'], shape=info['shape'], dtype=info['dtype'], path=full_path) + tensors = tensor_mapping.get(feature) + if tensors: + tensor_mapping[feature].append(value) + tensor_mapping[feature].sort(key=lambda x: x[0]) + else: + tensor_mapping[feature] = [value] + + return tensor_mapping + + def __init__(self, op_id, index, file_path): + self.op_id = op_id + self.index = index + self.file_path = file_path + + def load(self): + """ + Load tensor file. + + Returns: + ndarray, tensor data. + """ + if self.file_path.endswith('.npy'): + tensor = np.load(self.file_path) + return tensor + + metas = self.metas + if metas is None: + return None + dtype = getattr(np, metas['dtype']) + tensor = np.fromfile(self.file_path, dtype=dtype) + try: + tensor = tensor.reshape(metas['shape']) + except ValueError: + pass + return tensor + + @property + def metas(self): + """ + Metas property. + + Returns: + dict, metas extracted from tensor file name. + """ + file_name = os.path.basename(self.file_path) + try: + is_op, info = self.parse_tensor_file_name(file_name) + except UnknownTensorError: + return None + + if is_op: + info.pop('op_name') + info.pop('op_id') + else: + info.pop('node_name') + + if file_name.endswith('.npy'): + info.pop('dtype') + info.pop('shape') + + return info + + @property + def full_name(self): + """ + Full name property. + + Returns: + str, full name. + """ + full_name_str, _ = os.path.basename(self.file_path).split('_output_') + return full_name_str.replace('--', '/') + + @property + def scope(self): + """ + Scope property. + + Returns: + str, scope. + """ + return os.path.dirname(self.full_name) + + def __repr__(self): + return str({ + 'op_id': self.op_id, + 'index': self.index, + 'file_path': self.file_path, + }) + + +class NodeType(enum.Enum): + """Node Type.""" + OPERATOR = 'operator' + PARAMETER = 'parameter' + CONSTANT = 'constant' + + +class InputType(enum.Enum): + """Input Type.""" + OPERATOR = 'operator' + PARAMETER = 'parameter' + CONSTANT = 'constant' + TENSOR = 'tensor' + SCALAR = 'scalar' + REFERENCE = 'reference' + NONE = 'none' + + +class OutputType(enum.Enum): + """Output Type.""" + NONE = 'none' + BOOL = 'bool' + INT8 = 'int8' + INT16 = 'int16' + INT32 = 'int32' + INT64 = 'int64' + UINT8 = 'uint8' + UINT16 = 'uint16' + UINT32 = 'uint32' + UINT64 = 'uint64' + FLOAT16 = 'float16' + FLOAT32 = 'float32' + FLOAT64 = 'float64' + TENSOR = 'tensor' + TUPLE = 'tuple' + + +class Input: + """ + Graph node input. + + Args: + input_type (InputType): Input type. + input_name (str): Input name. + """ + + def __init__(self, input_type, input_name): + self.type = input_type + self.name = input_name + self.op_id = '' + self.info = None + + def __repr__(self): + return str({ + 'type': self.type, + 'name': self.name, + 'op_id': self.op_id, + 'info': self.info, + }) + + +class Output: + """ + Graph node output. + + Args: + output_type (OutputType): Output type. + """ + + SCALAR_TYPES = ( + OutputType.INT8, + OutputType.INT16, + OutputType.INT32, + OutputType.INT64, + OutputType.UINT8, + OutputType.UINT16, + OutputType.UINT32, + OutputType.UINT64, + OutputType.FLOAT16, + OutputType.FLOAT32, + ) + + def __init__(self, output_type): + self.type = output_type + if output_type == OutputType.NONE: + self.info = None + elif output_type == OutputType.BOOL: + self.info = dict(value=None) + elif output_type in self.SCALAR_TYPES: + self.info = dict(value=None) + elif output_type == OutputType.TENSOR: + self.info = dict(dtype='', shape=(), tensor=None) + elif output_type == OutputType.TUPLE: + self.info = dict(dtypes=[], shapes=[], tensors=[]) + + def __repr__(self): + return str({ + 'type': self.type, + 'info': self.info, + }) + + +class Source: + """ + Source address info. + + Args: + file_path (str): Absolute path of source file. + line_no (int): Line number of code line in source file. + code_line (int): Code line content. + """ + + def __init__(self, file_path, line_no, code_line): + self.file_path = file_path + self.line_no = line_no + self.code_line = code_line + + def to_dict(self): + """Parse to dict.""" + return { + 'file_path': self.file_path, + 'line_no': self.line_no, + 'code_line': self.code_line, + } + + def __repr__(self): + return str(self.to_dict()) + + @classmethod + def build_stack_from_source_address(cls, source_address): + """ + Build stack from source address. + + Args: + source_address (str): Source address content. + + Returns: + list, list of Source objects. + """ + stack = [] + for line in source_address.strip().split('\n'): + regex = r'#\sIn\sfile\s(?P.+)\((?P\d+)\)/(?P.+)/' + pattern = re.search(regex, line.strip()) + source = pattern.groupdict() + source['line_no'] = int(source['line_no']) + source['code_line'] = source['code_line'].strip() + stack.append(cls(**source)) + + return stack + + +class Node: + """ + Graph node. + + Args: + name (str): Node name. + """ + + def __init__(self, name): + self.name = name + self.output = None + self.downstream = [] + self.raw = '' + + +class Constant(Node): + """Constant node within graph.""" + + def __repr__(self): + return str({ + 'name': self.name, + 'output': self.output, + 'downstream': self.downstream, + }) + + +class Parameter(Node): + """Parameter node within graph.""" + + def __repr__(self): + return str({ + 'name': self.name, + 'output': self.output, + 'downstream': self.downstream, + }) + + +class Operator(Node): + """ + Operator node within graph. + + Args: + op_name (str): Operator name. + op_type (str): Operator type. + """ + + def __init__(self, op_name, op_type): + super().__init__(op_name) + self.type = op_type + self.inputs = [] + self.attrs = {} + self.full_name = '' + self.stack = [] + + @property + def scope(self): + """ + Scope property. + + Returns: + str, scope. + """ + return os.path.dirname(self.full_name) + + @property + def op_id(self): + """ + Op ID property. + + Returns: + str, op ID. + """ + pattern = re.search(r'-op(?P\d+)$', self.full_name) + if not pattern: + return self.full_name + + info = pattern.groupdict() + return info['op_id'] + + def __repr__(self): + return str({ + 'name': self.name, + 'type': self.type, + 'inputs': self.inputs, + 'output': self.output, + 'downstream': self.downstream, + 'attrs': self.attrs, + 'full_name': self.full_name, + 'op_id': self.op_id, + }) + + +class Parser: + """Graph file parser.""" + + def __init__(self, graph_data=None, tensor_dir=''): + self.graph_data = graph_data + self.tensor_dir = os.path.realpath(tensor_dir) if tensor_dir else '' + + self.constants = [] + self.parameters = [] + self.operators = [] + self.tensor_mapping = {} + + def parse(self): + """Parse.""" + raise NotImplementedError diff --git a/mindinsight/domain/graph/exceptions.py b/mindinsight/domain/graph/exceptions.py new file mode 100644 index 00000000..e41ad4c6 --- /dev/null +++ b/mindinsight/domain/graph/exceptions.py @@ -0,0 +1,45 @@ +# Copyright 2021 Huawei Technologies Co., Ltd +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================================ +"""Parse exceptions module.""" + +from mindinsight.utils.exceptions import MindInsightException +from mindinsight.utils.constant import GraphDomainErrors + + +class UnknownDataTypeError(MindInsightException): + """Unknwn data type error.""" + + def __init__(self, proto_type): + super().__init__( + error=GraphDomainErrors.UNKNOWN_DATA_TYPE_ERROR, + message=str(proto_type)) + + +class TupleGetitemIndexError(MindInsightException): + """Tuple getitem index error.""" + + def __init__(self, op_name, index_name): + super().__init__( + error=GraphDomainErrors.TUPLE_GETITEM_INDEX_ERROR, + message=f'op : {op_name}, index: {index_name}') + + +class UnknownTensorError(MindInsightException): + """Unknwn tensor error.""" + + def __init__(self, is_op, file_name): + super().__init__( + error=GraphDomainErrors.UNKNOWN_TENSOR_ERROR, + message=f'is_op : {is_op}, file_name: {file_name}') diff --git a/mindinsight/domain/graph/proto/ms_graph.proto b/mindinsight/domain/graph/proto/ms_graph.proto new file mode 100644 index 00000000..0c8a321a --- /dev/null +++ b/mindinsight/domain/graph/proto/ms_graph.proto @@ -0,0 +1,325 @@ +/** + * Copyright 2021 Huawei Technologies Co., Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +syntax = "proto2"; + +package mindinsight.domain.graph; + +// Versioning +enum Version { + // unknown version + UNKNOWWN_VERSION = 0; + + // Initial version (IR VERSION 1), published on Sep 23, 2019 + IR_VERSION = 0x0000000000000001; +} + +// Data type definition +enum DataType { + DT_UNDEFINED = 0; + // Basic types. + DT_BOOL = 1; // bool + + DT_INT8 = 2; // int8_t + DT_INT16 = 3; // int16_t + DT_INT32 = 4; // int32_t + DT_INT64 = 5; // int64_t + + DT_UINT8 = 6; // uint8_t + DT_UINT16 = 7; // uint16_t + DT_UINT32 = 8; // uint32_t + DT_UINT64 = 9; // uint64_t + + DT_FLOAT16 = 10; // float 16 + DT_FLOAT32 = 11; // float 32 + DT_FLOAT64 = 12; // float 64 + + DT_STRING = 13; // string + DT_TENSOR = 14; // tensor + DT_GRAPH = 15; // graph + + // list type + DT_BOOLS = 16; // list of bool + + DT_INTS8 = 17; // list of int8_t + DT_INTS16 = 18; // list of int16_t + DT_INTS32 = 19; // list of int32_t + DT_INTS64 = 20; // list of int64_t + + DT_UINTS8 = 21; // list of uint8_t + DT_UINTS16 = 22; // list of uint16_t + DT_UINTS32 = 23; // list of uint32_t + DT_UINTS64 = 24; // list of uint64_t + + DT_FLOATS16 = 25; // list of float16 + DT_FLOATS32 = 26; // list of float32 + DT_FLOATS64 = 27; // list of float64 + + DT_STRINGS = 28; // list of string + DT_TENSORS = 29; // list of tensor + DT_GRAPHS = 30; // list of graph + + DT_TUPLE = 31; // tuple + DT_LIST = 32; // list + DT_DICT = 33; // dictionary + + // other types + DT_NONE = 34; // None + DT_SYM_INST = 35; // Symbolic Key Instance + + // type related type + DT_BASE_INT = 36; // type generic int + DT_BASE_UINT = 37; // type generate unsigned int + DT_BASE_FLOAT = 38; // type generate float + DT_TYPE = 39; // type type + DT_ANYTHING = 40; // type anything + DT_REFKEY = 41; // type refkey + DT_REF = 42; // type ref +} + +// Value definition for attribute value or parameter default value +message ValueProto { + // data type of value + optional DataType dtype = 1; // discriminator that indicates which field below is in use + + // Exactly ONE of the following fields must be present for this version of the IR + optional bool bool_val = 2; // bool + optional int64 int_val = 3; // int + optional uint64 uint_val = 4; // uint + optional float float_val = 5; // float + optional double double_val = 6; // double + optional string str_val = 7; // string + optional TensorProto tensor_val = 8; // tensor value + optional GraphProto graph = 9; // graph + + repeated bool bool_vals = 10; // list of bool + repeated int64 int_vals = 11; // list of int + repeated uint64 uint_vals = 12; // list of uint + repeated float float_vals = 13; // list of float + repeated double double_vals = 14; // list of double + repeated string str_vals = 15; // list of string + repeated TensorProto tensor_vals = 16; // list of tensor value + repeated GraphProto graphs = 17; // list of graph + + // tuple or list + repeated ValueProto values = 18; // tuple, list of value + + // dictionary + repeated NamedValueProto dict_val = 19; // dictionary info + + // filed for type type + optional TypeProto type_val = 20; // type type info +} + +message AttributeProto { + optional string name = 1; // attribute name + optional ValueProto value = 2; // attribute value +} + +message NamedValueProto { + optional string key = 1; // attribute name + optional ValueProto value = 2; // attribute value +} + +// Defines a tensor shape. +message TensorShapeProto { + // One dimension of the tensor. + message Dimension { + // Size of the tensor in that dimension. + // This value must be >= -1, but values of -1 are reserved for "unknown" + // shapes (values of -1 mean "unknown" dimension). + optional int64 size = 1; + + // Optional name of the tensor dimension. + optional string name = 2; + }; + + repeated Dimension dim = 1; +} + +// Types for graph input(parameter) and output +message TypeProto { + + message Tensor { + // This field MUST have a valid DataType value except DT_TENSOR + optional DataType elem_type = 1; + optional TensorShapeProto shape = 2; // for scalar, this field is not set + } + + // tuple type + message Sequence { + // The type and optional shape of elements of the tuple. + repeated TypeProto elem_types = 1; + }; + + // data type + optional DataType data_type = 1; + + oneof value { + // The type of a tensor. + Tensor tensor_type = 2; + + // The type of a tuple. + Sequence sequence_type = 3; + } +} + +// Defines information on graph parameters, including the name, the type, and +// the default value of parameter if exists. +message ParameterProto { + optional string name = 1; // parameter name + optional TypeProto type = 2; // parameter type + optional ValueProto default_val = 3; // default value of parameter if exists +} + +// Defines graph output information +message OutputProto { + optional string name = 1; // output node name + optional TypeProto type = 2; // output node type +} + +// Define node input information +message InputProto { + enum EdgeType { + DATA_EDGE = 0; // data edge + CONTROL_EDGE = 1; // control edge + } + + optional string name = 1; + optional EdgeType type = 2; +} + +// Nodes +// +// Computation graphs are made up of a DAG of nodes, which represent what is +// commonly called a "layer" or "pipeline stage" in machine learning frameworks. +// +// For example, it can be a node of type "Conv" that takes in an image, a filter +// tensor and a bias tensor, and produces the convolved output. +message NodeProto { + repeated InputProto input = 1; // namespace Value + optional string name = 2; // namespace Value + + // The symbolic identifier of the Operator to execute. + optional string op_type = 3; // namespace Operator + // The domain of the OperatorSet that specifies the operator named by op_type. + optional string scope = 4; // namespace Domain + + // Additional named attributes. + repeated AttributeProto attribute = 5; + + // Optional type info of this node + optional TypeProto output_type = 6; + + // other fields for debug + optional uint64 output_i = 7; + + // full name with scope + optional string full_name = 8; + + // The corresponding source code for this node. + optional string source_address = 9; +} + +// Models +// +// ModelProto is a top-level file/container format for bundling a ML model and +// associating its computation graph with metadata. +// +// The semantics of the model are described by the associated GraphProto. +message ModelProto { + // ir version + optional int64 ir_version = 1; + + // Domain name of the model. + // We use reverse domain names as name space indicators. For example: + // `com.facebook.fair` or `com.microsoft.cognitiveservices` + // + // Together with `model_version` and GraphProto.name, this forms the unique identity of + // the graph. + optional string domain = 2; + + // The version of the graph encoded. See Version enum below. + optional int64 model_version = 3; + + // The parameterized graph that is evaluated to execute the model. + optional GraphProto graph = 4; + + // metadata info of operators + optional OperatorSetProto metadata_operators = 5; +}; + +message OperatorProto { + optional string name = 1; // used as key, must be distinct + optional bytes config = 2; // operator config info + optional bytes obj_info = 3; // operator related object info, e.g. content of operator binary or name +}; + +message OperatorSetProto { + repeated OperatorProto operators = 1; + optional string summary = 2; // summary info of operators, e.g. file position of operators file +} + +// Graphs +// +// A graph defines the computational logic of a model and is comprised of a parameterized +// list of nodes that form a directed acyclic graph based on their inputs and outputs. +// This is the equivalent of the "network" or "graph" in many deep learning +// frameworks. +message GraphProto { + // The nodes in the graph, sorted topologically. + repeated NodeProto node = 1; + + // The name of the graph. + optional string name = 2; // namespace Graph + + // The parameters(inputs) and outputs of the graph. + repeated ParameterProto parameters = 3; + repeated OutputProto outputs = 4; + + // Constants used in this graph + repeated NamedValueProto const_vals = 5; +} + +// Tensors +// +// A serialized tensor value. +message TensorProto { + // The node name of the tensor. + optional string node_name = 1; + + // The slot of the tensor in its node. + optional string slot = 2; + + // The serialized tensor content. + optional bytes tensor_content = 3; + + // The shape of the tensor. + repeated int64 dims = 4; + + // The data type of the tensor. + // This field MUST have a valid DataType value except DT_TENSOR + optional DataType data_type = 5; + + // If the tensor content transferring is finished. + optional bool finished = 6; + + // The iteration of the tensor. Supported: "prev" or leave empty. + optional string iter = 7; + + // If the tensor name should be truncated. + optional bool truncate = 8; +} diff --git a/mindinsight/domain/graph/proto/ms_graph_pb2.py b/mindinsight/domain/graph/proto/ms_graph_pb2.py new file mode 100644 index 00000000..ba73dbf6 --- /dev/null +++ b/mindinsight/domain/graph/proto/ms_graph_pb2.py @@ -0,0 +1,1400 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: mindinsight/domain/graph/proto/ms_graph.proto + +from google.protobuf.internal import enum_type_wrapper +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='mindinsight/domain/graph/proto/ms_graph.proto', + package='mindinsight.domain.graph', + syntax='proto2', + serialized_options=None, + serialized_pb=b'\n-mindinsight/domain/graph/proto/ms_graph.proto\x12\x18mindinsight.domain.graph\"\xab\x05\n\nValueProto\x12\x31\n\x05\x64type\x18\x01 \x01(\x0e\x32\".mindinsight.domain.graph.DataType\x12\x10\n\x08\x62ool_val\x18\x02 \x01(\x08\x12\x0f\n\x07int_val\x18\x03 \x01(\x03\x12\x10\n\x08uint_val\x18\x04 \x01(\x04\x12\x11\n\tfloat_val\x18\x05 \x01(\x02\x12\x12\n\ndouble_val\x18\x06 \x01(\x01\x12\x0f\n\x07str_val\x18\x07 \x01(\t\x12\x39\n\ntensor_val\x18\x08 \x01(\x0b\x32%.mindinsight.domain.graph.TensorProto\x12\x33\n\x05graph\x18\t \x01(\x0b\x32$.mindinsight.domain.graph.GraphProto\x12\x11\n\tbool_vals\x18\n \x03(\x08\x12\x10\n\x08int_vals\x18\x0b \x03(\x03\x12\x11\n\tuint_vals\x18\x0c \x03(\x04\x12\x12\n\nfloat_vals\x18\r \x03(\x02\x12\x13\n\x0b\x64ouble_vals\x18\x0e \x03(\x01\x12\x10\n\x08str_vals\x18\x0f \x03(\t\x12:\n\x0btensor_vals\x18\x10 \x03(\x0b\x32%.mindinsight.domain.graph.TensorProto\x12\x34\n\x06graphs\x18\x11 \x03(\x0b\x32$.mindinsight.domain.graph.GraphProto\x12\x34\n\x06values\x18\x12 \x03(\x0b\x32$.mindinsight.domain.graph.ValueProto\x12;\n\x08\x64ict_val\x18\x13 \x03(\x0b\x32).mindinsight.domain.graph.NamedValueProto\x12\x35\n\x08type_val\x18\x14 \x01(\x0b\x32#.mindinsight.domain.graph.TypeProto\"S\n\x0e\x41ttributeProto\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x33\n\x05value\x18\x02 \x01(\x0b\x32$.mindinsight.domain.graph.ValueProto\"S\n\x0fNamedValueProto\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x33\n\x05value\x18\x02 \x01(\x0b\x32$.mindinsight.domain.graph.ValueProto\"~\n\x10TensorShapeProto\x12\x41\n\x03\x64im\x18\x01 \x03(\x0b\x32\x34.mindinsight.domain.graph.TensorShapeProto.Dimension\x1a\'\n\tDimension\x12\x0c\n\x04size\x18\x01 \x01(\x03\x12\x0c\n\x04name\x18\x02 \x01(\t\"\x96\x03\n\tTypeProto\x12\x35\n\tdata_type\x18\x01 \x01(\x0e\x32\".mindinsight.domain.graph.DataType\x12\x41\n\x0btensor_type\x18\x02 \x01(\x0b\x32*.mindinsight.domain.graph.TypeProto.TensorH\x00\x12\x45\n\rsequence_type\x18\x03 \x01(\x0b\x32,.mindinsight.domain.graph.TypeProto.SequenceH\x00\x1az\n\x06Tensor\x12\x35\n\telem_type\x18\x01 \x01(\x0e\x32\".mindinsight.domain.graph.DataType\x12\x39\n\x05shape\x18\x02 \x01(\x0b\x32*.mindinsight.domain.graph.TensorShapeProto\x1a\x43\n\x08Sequence\x12\x37\n\nelem_types\x18\x01 \x03(\x0b\x32#.mindinsight.domain.graph.TypeProtoB\x07\n\x05value\"\x8c\x01\n\x0eParameterProto\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x31\n\x04type\x18\x02 \x01(\x0b\x32#.mindinsight.domain.graph.TypeProto\x12\x39\n\x0b\x64\x65\x66\x61ult_val\x18\x03 \x01(\x0b\x32$.mindinsight.domain.graph.ValueProto\"N\n\x0bOutputProto\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x31\n\x04type\x18\x02 \x01(\x0b\x32#.mindinsight.domain.graph.TypeProto\"\x84\x01\n\nInputProto\x12\x0c\n\x04name\x18\x01 \x01(\t\x12;\n\x04type\x18\x02 \x01(\x0e\x32-.mindinsight.domain.graph.InputProto.EdgeType\"+\n\x08\x45\x64geType\x12\r\n\tDATA_EDGE\x10\x00\x12\x10\n\x0c\x43ONTROL_EDGE\x10\x01\"\xa2\x02\n\tNodeProto\x12\x33\n\x05input\x18\x01 \x03(\x0b\x32$.mindinsight.domain.graph.InputProto\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x0f\n\x07op_type\x18\x03 \x01(\t\x12\r\n\x05scope\x18\x04 \x01(\t\x12;\n\tattribute\x18\x05 \x03(\x0b\x32(.mindinsight.domain.graph.AttributeProto\x12\x38\n\x0boutput_type\x18\x06 \x01(\x0b\x32#.mindinsight.domain.graph.TypeProto\x12\x10\n\x08output_i\x18\x07 \x01(\x04\x12\x11\n\tfull_name\x18\x08 \x01(\t\x12\x16\n\x0esource_address\x18\t \x01(\t\"\xc4\x01\n\nModelProto\x12\x12\n\nir_version\x18\x01 \x01(\x03\x12\x0e\n\x06\x64omain\x18\x02 \x01(\t\x12\x15\n\rmodel_version\x18\x03 \x01(\x03\x12\x33\n\x05graph\x18\x04 \x01(\x0b\x32$.mindinsight.domain.graph.GraphProto\x12\x46\n\x12metadata_operators\x18\x05 \x01(\x0b\x32*.mindinsight.domain.graph.OperatorSetProto\"?\n\rOperatorProto\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0e\n\x06\x63onfig\x18\x02 \x01(\x0c\x12\x10\n\x08obj_info\x18\x03 \x01(\x0c\"_\n\x10OperatorSetProto\x12:\n\toperators\x18\x01 \x03(\x0b\x32\'.mindinsight.domain.graph.OperatorProto\x12\x0f\n\x07summary\x18\x02 \x01(\t\"\x82\x02\n\nGraphProto\x12\x31\n\x04node\x18\x01 \x03(\x0b\x32#.mindinsight.domain.graph.NodeProto\x12\x0c\n\x04name\x18\x02 \x01(\t\x12<\n\nparameters\x18\x03 \x03(\x0b\x32(.mindinsight.domain.graph.ParameterProto\x12\x36\n\x07outputs\x18\x04 \x03(\x0b\x32%.mindinsight.domain.graph.OutputProto\x12=\n\nconst_vals\x18\x05 \x03(\x0b\x32).mindinsight.domain.graph.NamedValueProto\"\xbd\x01\n\x0bTensorProto\x12\x11\n\tnode_name\x18\x01 \x01(\t\x12\x0c\n\x04slot\x18\x02 \x01(\t\x12\x16\n\x0etensor_content\x18\x03 \x01(\x0c\x12\x0c\n\x04\x64ims\x18\x04 \x03(\x03\x12\x35\n\tdata_type\x18\x05 \x01(\x0e\x32\".mindinsight.domain.graph.DataType\x12\x10\n\x08\x66inished\x18\x06 \x01(\x08\x12\x0c\n\x04iter\x18\x07 \x01(\t\x12\x10\n\x08truncate\x18\x08 \x01(\x08*/\n\x07Version\x12\x14\n\x10UNKNOWWN_VERSION\x10\x00\x12\x0e\n\nIR_VERSION\x10\x01*\x96\x05\n\x08\x44\x61taType\x12\x10\n\x0c\x44T_UNDEFINED\x10\x00\x12\x0b\n\x07\x44T_BOOL\x10\x01\x12\x0b\n\x07\x44T_INT8\x10\x02\x12\x0c\n\x08\x44T_INT16\x10\x03\x12\x0c\n\x08\x44T_INT32\x10\x04\x12\x0c\n\x08\x44T_INT64\x10\x05\x12\x0c\n\x08\x44T_UINT8\x10\x06\x12\r\n\tDT_UINT16\x10\x07\x12\r\n\tDT_UINT32\x10\x08\x12\r\n\tDT_UINT64\x10\t\x12\x0e\n\nDT_FLOAT16\x10\n\x12\x0e\n\nDT_FLOAT32\x10\x0b\x12\x0e\n\nDT_FLOAT64\x10\x0c\x12\r\n\tDT_STRING\x10\r\x12\r\n\tDT_TENSOR\x10\x0e\x12\x0c\n\x08\x44T_GRAPH\x10\x0f\x12\x0c\n\x08\x44T_BOOLS\x10\x10\x12\x0c\n\x08\x44T_INTS8\x10\x11\x12\r\n\tDT_INTS16\x10\x12\x12\r\n\tDT_INTS32\x10\x13\x12\r\n\tDT_INTS64\x10\x14\x12\r\n\tDT_UINTS8\x10\x15\x12\x0e\n\nDT_UINTS16\x10\x16\x12\x0e\n\nDT_UINTS32\x10\x17\x12\x0e\n\nDT_UINTS64\x10\x18\x12\x0f\n\x0b\x44T_FLOATS16\x10\x19\x12\x0f\n\x0b\x44T_FLOATS32\x10\x1a\x12\x0f\n\x0b\x44T_FLOATS64\x10\x1b\x12\x0e\n\nDT_STRINGS\x10\x1c\x12\x0e\n\nDT_TENSORS\x10\x1d\x12\r\n\tDT_GRAPHS\x10\x1e\x12\x0c\n\x08\x44T_TUPLE\x10\x1f\x12\x0b\n\x07\x44T_LIST\x10 \x12\x0b\n\x07\x44T_DICT\x10!\x12\x0b\n\x07\x44T_NONE\x10\"\x12\x0f\n\x0b\x44T_SYM_INST\x10#\x12\x0f\n\x0b\x44T_BASE_INT\x10$\x12\x10\n\x0c\x44T_BASE_UINT\x10%\x12\x11\n\rDT_BASE_FLOAT\x10&\x12\x0b\n\x07\x44T_TYPE\x10\'\x12\x0f\n\x0b\x44T_ANYTHING\x10(\x12\r\n\tDT_REFKEY\x10)\x12\n\n\x06\x44T_REF\x10*' +) + +_VERSION = _descriptor.EnumDescriptor( + name='Version', + full_name='mindinsight.domain.graph.Version', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='UNKNOWWN_VERSION', index=0, number=0, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='IR_VERSION', index=1, number=1, + serialized_options=None, + type=None), + ], + containing_type=None, + serialized_options=None, + serialized_start=2933, + serialized_end=2980, +) +_sym_db.RegisterEnumDescriptor(_VERSION) + +Version = enum_type_wrapper.EnumTypeWrapper(_VERSION) +_DATATYPE = _descriptor.EnumDescriptor( + name='DataType', + full_name='mindinsight.domain.graph.DataType', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='DT_UNDEFINED', index=0, number=0, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_BOOL', index=1, number=1, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_INT8', index=2, number=2, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_INT16', index=3, number=3, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_INT32', index=4, number=4, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_INT64', index=5, number=5, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_UINT8', index=6, number=6, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_UINT16', index=7, number=7, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_UINT32', index=8, number=8, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_UINT64', index=9, number=9, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_FLOAT16', index=10, number=10, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_FLOAT32', index=11, number=11, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_FLOAT64', index=12, number=12, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_STRING', index=13, number=13, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_TENSOR', index=14, number=14, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_GRAPH', index=15, number=15, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_BOOLS', index=16, number=16, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_INTS8', index=17, number=17, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_INTS16', index=18, number=18, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_INTS32', index=19, number=19, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_INTS64', index=20, number=20, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_UINTS8', index=21, number=21, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_UINTS16', index=22, number=22, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_UINTS32', index=23, number=23, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_UINTS64', index=24, number=24, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_FLOATS16', index=25, number=25, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_FLOATS32', index=26, number=26, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_FLOATS64', index=27, number=27, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_STRINGS', index=28, number=28, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_TENSORS', index=29, number=29, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_GRAPHS', index=30, number=30, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_TUPLE', index=31, number=31, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_LIST', index=32, number=32, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_DICT', index=33, number=33, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_NONE', index=34, number=34, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_SYM_INST', index=35, number=35, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_BASE_INT', index=36, number=36, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_BASE_UINT', index=37, number=37, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_BASE_FLOAT', index=38, number=38, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_TYPE', index=39, number=39, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_ANYTHING', index=40, number=40, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_REFKEY', index=41, number=41, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_REF', index=42, number=42, + serialized_options=None, + type=None), + ], + containing_type=None, + serialized_options=None, + serialized_start=2983, + serialized_end=3645, +) +_sym_db.RegisterEnumDescriptor(_DATATYPE) + +DataType = enum_type_wrapper.EnumTypeWrapper(_DATATYPE) +UNKNOWWN_VERSION = 0 +IR_VERSION = 1 +DT_UNDEFINED = 0 +DT_BOOL = 1 +DT_INT8 = 2 +DT_INT16 = 3 +DT_INT32 = 4 +DT_INT64 = 5 +DT_UINT8 = 6 +DT_UINT16 = 7 +DT_UINT32 = 8 +DT_UINT64 = 9 +DT_FLOAT16 = 10 +DT_FLOAT32 = 11 +DT_FLOAT64 = 12 +DT_STRING = 13 +DT_TENSOR = 14 +DT_GRAPH = 15 +DT_BOOLS = 16 +DT_INTS8 = 17 +DT_INTS16 = 18 +DT_INTS32 = 19 +DT_INTS64 = 20 +DT_UINTS8 = 21 +DT_UINTS16 = 22 +DT_UINTS32 = 23 +DT_UINTS64 = 24 +DT_FLOATS16 = 25 +DT_FLOATS32 = 26 +DT_FLOATS64 = 27 +DT_STRINGS = 28 +DT_TENSORS = 29 +DT_GRAPHS = 30 +DT_TUPLE = 31 +DT_LIST = 32 +DT_DICT = 33 +DT_NONE = 34 +DT_SYM_INST = 35 +DT_BASE_INT = 36 +DT_BASE_UINT = 37 +DT_BASE_FLOAT = 38 +DT_TYPE = 39 +DT_ANYTHING = 40 +DT_REFKEY = 41 +DT_REF = 42 + + +_INPUTPROTO_EDGETYPE = _descriptor.EnumDescriptor( + name='EdgeType', + full_name='mindinsight.domain.graph.InputProto.EdgeType', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='DATA_EDGE', index=0, number=0, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='CONTROL_EDGE', index=1, number=1, + serialized_options=None, + type=None), + ], + containing_type=None, + serialized_options=None, + serialized_start=1781, + serialized_end=1824, +) +_sym_db.RegisterEnumDescriptor(_INPUTPROTO_EDGETYPE) + + +_VALUEPROTO = _descriptor.Descriptor( + name='ValueProto', + full_name='mindinsight.domain.graph.ValueProto', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='dtype', full_name='mindinsight.domain.graph.ValueProto.dtype', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='bool_val', full_name='mindinsight.domain.graph.ValueProto.bool_val', index=1, + number=2, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='int_val', full_name='mindinsight.domain.graph.ValueProto.int_val', index=2, + number=3, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='uint_val', full_name='mindinsight.domain.graph.ValueProto.uint_val', index=3, + number=4, type=4, cpp_type=4, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='float_val', full_name='mindinsight.domain.graph.ValueProto.float_val', index=4, + number=5, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='double_val', full_name='mindinsight.domain.graph.ValueProto.double_val', index=5, + number=6, type=1, cpp_type=5, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='str_val', full_name='mindinsight.domain.graph.ValueProto.str_val', index=6, + number=7, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='tensor_val', full_name='mindinsight.domain.graph.ValueProto.tensor_val', index=7, + number=8, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='graph', full_name='mindinsight.domain.graph.ValueProto.graph', index=8, + number=9, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='bool_vals', full_name='mindinsight.domain.graph.ValueProto.bool_vals', index=9, + number=10, type=8, cpp_type=7, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='int_vals', full_name='mindinsight.domain.graph.ValueProto.int_vals', index=10, + number=11, type=3, cpp_type=2, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='uint_vals', full_name='mindinsight.domain.graph.ValueProto.uint_vals', index=11, + number=12, type=4, cpp_type=4, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='float_vals', full_name='mindinsight.domain.graph.ValueProto.float_vals', index=12, + number=13, type=2, cpp_type=6, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='double_vals', full_name='mindinsight.domain.graph.ValueProto.double_vals', index=13, + number=14, type=1, cpp_type=5, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='str_vals', full_name='mindinsight.domain.graph.ValueProto.str_vals', index=14, + number=15, type=9, cpp_type=9, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='tensor_vals', full_name='mindinsight.domain.graph.ValueProto.tensor_vals', index=15, + number=16, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='graphs', full_name='mindinsight.domain.graph.ValueProto.graphs', index=16, + number=17, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='values', full_name='mindinsight.domain.graph.ValueProto.values', index=17, + number=18, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='dict_val', full_name='mindinsight.domain.graph.ValueProto.dict_val', index=18, + number=19, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='type_val', full_name='mindinsight.domain.graph.ValueProto.type_val', index=19, + number=20, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=76, + serialized_end=759, +) + + +_ATTRIBUTEPROTO = _descriptor.Descriptor( + name='AttributeProto', + full_name='mindinsight.domain.graph.AttributeProto', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='name', full_name='mindinsight.domain.graph.AttributeProto.name', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='value', full_name='mindinsight.domain.graph.AttributeProto.value', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=761, + serialized_end=844, +) + + +_NAMEDVALUEPROTO = _descriptor.Descriptor( + name='NamedValueProto', + full_name='mindinsight.domain.graph.NamedValueProto', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='mindinsight.domain.graph.NamedValueProto.key', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='value', full_name='mindinsight.domain.graph.NamedValueProto.value', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=846, + serialized_end=929, +) + + +_TENSORSHAPEPROTO_DIMENSION = _descriptor.Descriptor( + name='Dimension', + full_name='mindinsight.domain.graph.TensorShapeProto.Dimension', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='size', full_name='mindinsight.domain.graph.TensorShapeProto.Dimension.size', index=0, + number=1, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='name', full_name='mindinsight.domain.graph.TensorShapeProto.Dimension.name', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1018, + serialized_end=1057, +) + +_TENSORSHAPEPROTO = _descriptor.Descriptor( + name='TensorShapeProto', + full_name='mindinsight.domain.graph.TensorShapeProto', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='dim', full_name='mindinsight.domain.graph.TensorShapeProto.dim', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_TENSORSHAPEPROTO_DIMENSION, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=931, + serialized_end=1057, +) + + +_TYPEPROTO_TENSOR = _descriptor.Descriptor( + name='Tensor', + full_name='mindinsight.domain.graph.TypeProto.Tensor', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='elem_type', full_name='mindinsight.domain.graph.TypeProto.Tensor.elem_type', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='shape', full_name='mindinsight.domain.graph.TypeProto.Tensor.shape', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1266, + serialized_end=1388, +) + +_TYPEPROTO_SEQUENCE = _descriptor.Descriptor( + name='Sequence', + full_name='mindinsight.domain.graph.TypeProto.Sequence', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='elem_types', full_name='mindinsight.domain.graph.TypeProto.Sequence.elem_types', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1390, + serialized_end=1457, +) + +_TYPEPROTO = _descriptor.Descriptor( + name='TypeProto', + full_name='mindinsight.domain.graph.TypeProto', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='data_type', full_name='mindinsight.domain.graph.TypeProto.data_type', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='tensor_type', full_name='mindinsight.domain.graph.TypeProto.tensor_type', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='sequence_type', full_name='mindinsight.domain.graph.TypeProto.sequence_type', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_TYPEPROTO_TENSOR, _TYPEPROTO_SEQUENCE, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='value', full_name='mindinsight.domain.graph.TypeProto.value', + index=0, containing_type=None, fields=[]), + ], + serialized_start=1060, + serialized_end=1466, +) + + +_PARAMETERPROTO = _descriptor.Descriptor( + name='ParameterProto', + full_name='mindinsight.domain.graph.ParameterProto', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='name', full_name='mindinsight.domain.graph.ParameterProto.name', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='type', full_name='mindinsight.domain.graph.ParameterProto.type', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='default_val', full_name='mindinsight.domain.graph.ParameterProto.default_val', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1469, + serialized_end=1609, +) + + +_OUTPUTPROTO = _descriptor.Descriptor( + name='OutputProto', + full_name='mindinsight.domain.graph.OutputProto', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='name', full_name='mindinsight.domain.graph.OutputProto.name', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='type', full_name='mindinsight.domain.graph.OutputProto.type', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1611, + serialized_end=1689, +) + + +_INPUTPROTO = _descriptor.Descriptor( + name='InputProto', + full_name='mindinsight.domain.graph.InputProto', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='name', full_name='mindinsight.domain.graph.InputProto.name', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='type', full_name='mindinsight.domain.graph.InputProto.type', index=1, + number=2, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + _INPUTPROTO_EDGETYPE, + ], + serialized_options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1692, + serialized_end=1824, +) + + +_NODEPROTO = _descriptor.Descriptor( + name='NodeProto', + full_name='mindinsight.domain.graph.NodeProto', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='input', full_name='mindinsight.domain.graph.NodeProto.input', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='name', full_name='mindinsight.domain.graph.NodeProto.name', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='op_type', full_name='mindinsight.domain.graph.NodeProto.op_type', index=2, + number=3, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='scope', full_name='mindinsight.domain.graph.NodeProto.scope', index=3, + number=4, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='attribute', full_name='mindinsight.domain.graph.NodeProto.attribute', index=4, + number=5, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='output_type', full_name='mindinsight.domain.graph.NodeProto.output_type', index=5, + number=6, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='output_i', full_name='mindinsight.domain.graph.NodeProto.output_i', index=6, + number=7, type=4, cpp_type=4, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='full_name', full_name='mindinsight.domain.graph.NodeProto.full_name', index=7, + number=8, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='source_address', full_name='mindinsight.domain.graph.NodeProto.source_address', index=8, + number=9, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1827, + serialized_end=2117, +) + + +_MODELPROTO = _descriptor.Descriptor( + name='ModelProto', + full_name='mindinsight.domain.graph.ModelProto', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='ir_version', full_name='mindinsight.domain.graph.ModelProto.ir_version', index=0, + number=1, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='domain', full_name='mindinsight.domain.graph.ModelProto.domain', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='model_version', full_name='mindinsight.domain.graph.ModelProto.model_version', index=2, + number=3, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='graph', full_name='mindinsight.domain.graph.ModelProto.graph', index=3, + number=4, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='metadata_operators', full_name='mindinsight.domain.graph.ModelProto.metadata_operators', index=4, + number=5, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2120, + serialized_end=2316, +) + + +_OPERATORPROTO = _descriptor.Descriptor( + name='OperatorProto', + full_name='mindinsight.domain.graph.OperatorProto', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='name', full_name='mindinsight.domain.graph.OperatorProto.name', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='config', full_name='mindinsight.domain.graph.OperatorProto.config', index=1, + number=2, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=b"", + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='obj_info', full_name='mindinsight.domain.graph.OperatorProto.obj_info', index=2, + number=3, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=b"", + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2318, + serialized_end=2381, +) + + +_OPERATORSETPROTO = _descriptor.Descriptor( + name='OperatorSetProto', + full_name='mindinsight.domain.graph.OperatorSetProto', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='operators', full_name='mindinsight.domain.graph.OperatorSetProto.operators', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='summary', full_name='mindinsight.domain.graph.OperatorSetProto.summary', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2383, + serialized_end=2478, +) + + +_GRAPHPROTO = _descriptor.Descriptor( + name='GraphProto', + full_name='mindinsight.domain.graph.GraphProto', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='node', full_name='mindinsight.domain.graph.GraphProto.node', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='name', full_name='mindinsight.domain.graph.GraphProto.name', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='parameters', full_name='mindinsight.domain.graph.GraphProto.parameters', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='outputs', full_name='mindinsight.domain.graph.GraphProto.outputs', index=3, + number=4, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='const_vals', full_name='mindinsight.domain.graph.GraphProto.const_vals', index=4, + number=5, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2481, + serialized_end=2739, +) + + +_TENSORPROTO = _descriptor.Descriptor( + name='TensorProto', + full_name='mindinsight.domain.graph.TensorProto', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='node_name', full_name='mindinsight.domain.graph.TensorProto.node_name', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='slot', full_name='mindinsight.domain.graph.TensorProto.slot', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='tensor_content', full_name='mindinsight.domain.graph.TensorProto.tensor_content', index=2, + number=3, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=b"", + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='dims', full_name='mindinsight.domain.graph.TensorProto.dims', index=3, + number=4, type=3, cpp_type=2, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='data_type', full_name='mindinsight.domain.graph.TensorProto.data_type', index=4, + number=5, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='finished', full_name='mindinsight.domain.graph.TensorProto.finished', index=5, + number=6, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='iter', full_name='mindinsight.domain.graph.TensorProto.iter', index=6, + number=7, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=b"".decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='truncate', full_name='mindinsight.domain.graph.TensorProto.truncate', index=7, + number=8, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2742, + serialized_end=2931, +) + +_VALUEPROTO.fields_by_name['dtype'].enum_type = _DATATYPE +_VALUEPROTO.fields_by_name['tensor_val'].message_type = _TENSORPROTO +_VALUEPROTO.fields_by_name['graph'].message_type = _GRAPHPROTO +_VALUEPROTO.fields_by_name['tensor_vals'].message_type = _TENSORPROTO +_VALUEPROTO.fields_by_name['graphs'].message_type = _GRAPHPROTO +_VALUEPROTO.fields_by_name['values'].message_type = _VALUEPROTO +_VALUEPROTO.fields_by_name['dict_val'].message_type = _NAMEDVALUEPROTO +_VALUEPROTO.fields_by_name['type_val'].message_type = _TYPEPROTO +_ATTRIBUTEPROTO.fields_by_name['value'].message_type = _VALUEPROTO +_NAMEDVALUEPROTO.fields_by_name['value'].message_type = _VALUEPROTO +_TENSORSHAPEPROTO_DIMENSION.containing_type = _TENSORSHAPEPROTO +_TENSORSHAPEPROTO.fields_by_name['dim'].message_type = _TENSORSHAPEPROTO_DIMENSION +_TYPEPROTO_TENSOR.fields_by_name['elem_type'].enum_type = _DATATYPE +_TYPEPROTO_TENSOR.fields_by_name['shape'].message_type = _TENSORSHAPEPROTO +_TYPEPROTO_TENSOR.containing_type = _TYPEPROTO +_TYPEPROTO_SEQUENCE.fields_by_name['elem_types'].message_type = _TYPEPROTO +_TYPEPROTO_SEQUENCE.containing_type = _TYPEPROTO +_TYPEPROTO.fields_by_name['data_type'].enum_type = _DATATYPE +_TYPEPROTO.fields_by_name['tensor_type'].message_type = _TYPEPROTO_TENSOR +_TYPEPROTO.fields_by_name['sequence_type'].message_type = _TYPEPROTO_SEQUENCE +_TYPEPROTO.oneofs_by_name['value'].fields.append( + _TYPEPROTO.fields_by_name['tensor_type']) +_TYPEPROTO.fields_by_name['tensor_type'].containing_oneof = _TYPEPROTO.oneofs_by_name['value'] +_TYPEPROTO.oneofs_by_name['value'].fields.append( + _TYPEPROTO.fields_by_name['sequence_type']) +_TYPEPROTO.fields_by_name['sequence_type'].containing_oneof = _TYPEPROTO.oneofs_by_name['value'] +_PARAMETERPROTO.fields_by_name['type'].message_type = _TYPEPROTO +_PARAMETERPROTO.fields_by_name['default_val'].message_type = _VALUEPROTO +_OUTPUTPROTO.fields_by_name['type'].message_type = _TYPEPROTO +_INPUTPROTO.fields_by_name['type'].enum_type = _INPUTPROTO_EDGETYPE +_INPUTPROTO_EDGETYPE.containing_type = _INPUTPROTO +_NODEPROTO.fields_by_name['input'].message_type = _INPUTPROTO +_NODEPROTO.fields_by_name['attribute'].message_type = _ATTRIBUTEPROTO +_NODEPROTO.fields_by_name['output_type'].message_type = _TYPEPROTO +_MODELPROTO.fields_by_name['graph'].message_type = _GRAPHPROTO +_MODELPROTO.fields_by_name['metadata_operators'].message_type = _OPERATORSETPROTO +_OPERATORSETPROTO.fields_by_name['operators'].message_type = _OPERATORPROTO +_GRAPHPROTO.fields_by_name['node'].message_type = _NODEPROTO +_GRAPHPROTO.fields_by_name['parameters'].message_type = _PARAMETERPROTO +_GRAPHPROTO.fields_by_name['outputs'].message_type = _OUTPUTPROTO +_GRAPHPROTO.fields_by_name['const_vals'].message_type = _NAMEDVALUEPROTO +_TENSORPROTO.fields_by_name['data_type'].enum_type = _DATATYPE +DESCRIPTOR.message_types_by_name['ValueProto'] = _VALUEPROTO +DESCRIPTOR.message_types_by_name['AttributeProto'] = _ATTRIBUTEPROTO +DESCRIPTOR.message_types_by_name['NamedValueProto'] = _NAMEDVALUEPROTO +DESCRIPTOR.message_types_by_name['TensorShapeProto'] = _TENSORSHAPEPROTO +DESCRIPTOR.message_types_by_name['TypeProto'] = _TYPEPROTO +DESCRIPTOR.message_types_by_name['ParameterProto'] = _PARAMETERPROTO +DESCRIPTOR.message_types_by_name['OutputProto'] = _OUTPUTPROTO +DESCRIPTOR.message_types_by_name['InputProto'] = _INPUTPROTO +DESCRIPTOR.message_types_by_name['NodeProto'] = _NODEPROTO +DESCRIPTOR.message_types_by_name['ModelProto'] = _MODELPROTO +DESCRIPTOR.message_types_by_name['OperatorProto'] = _OPERATORPROTO +DESCRIPTOR.message_types_by_name['OperatorSetProto'] = _OPERATORSETPROTO +DESCRIPTOR.message_types_by_name['GraphProto'] = _GRAPHPROTO +DESCRIPTOR.message_types_by_name['TensorProto'] = _TENSORPROTO +DESCRIPTOR.enum_types_by_name['Version'] = _VERSION +DESCRIPTOR.enum_types_by_name['DataType'] = _DATATYPE +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +ValueProto = _reflection.GeneratedProtocolMessageType('ValueProto', (_message.Message,), { + 'DESCRIPTOR' : _VALUEPROTO, + '__module__' : 'mindinsight.domain.graph.proto.ms_graph_pb2' + # @@protoc_insertion_point(class_scope:mindinsight.domain.graph.ValueProto) + }) +_sym_db.RegisterMessage(ValueProto) + +AttributeProto = _reflection.GeneratedProtocolMessageType('AttributeProto', (_message.Message,), { + 'DESCRIPTOR' : _ATTRIBUTEPROTO, + '__module__' : 'mindinsight.domain.graph.proto.ms_graph_pb2' + # @@protoc_insertion_point(class_scope:mindinsight.domain.graph.AttributeProto) + }) +_sym_db.RegisterMessage(AttributeProto) + +NamedValueProto = _reflection.GeneratedProtocolMessageType('NamedValueProto', (_message.Message,), { + 'DESCRIPTOR' : _NAMEDVALUEPROTO, + '__module__' : 'mindinsight.domain.graph.proto.ms_graph_pb2' + # @@protoc_insertion_point(class_scope:mindinsight.domain.graph.NamedValueProto) + }) +_sym_db.RegisterMessage(NamedValueProto) + +TensorShapeProto = _reflection.GeneratedProtocolMessageType('TensorShapeProto', (_message.Message,), { + + 'Dimension' : _reflection.GeneratedProtocolMessageType('Dimension', (_message.Message,), { + 'DESCRIPTOR' : _TENSORSHAPEPROTO_DIMENSION, + '__module__' : 'mindinsight.domain.graph.proto.ms_graph_pb2' + # @@protoc_insertion_point(class_scope:mindinsight.domain.graph.TensorShapeProto.Dimension) + }) + , + 'DESCRIPTOR' : _TENSORSHAPEPROTO, + '__module__' : 'mindinsight.domain.graph.proto.ms_graph_pb2' + # @@protoc_insertion_point(class_scope:mindinsight.domain.graph.TensorShapeProto) + }) +_sym_db.RegisterMessage(TensorShapeProto) +_sym_db.RegisterMessage(TensorShapeProto.Dimension) + +TypeProto = _reflection.GeneratedProtocolMessageType('TypeProto', (_message.Message,), { + + 'Tensor' : _reflection.GeneratedProtocolMessageType('Tensor', (_message.Message,), { + 'DESCRIPTOR' : _TYPEPROTO_TENSOR, + '__module__' : 'mindinsight.domain.graph.proto.ms_graph_pb2' + # @@protoc_insertion_point(class_scope:mindinsight.domain.graph.TypeProto.Tensor) + }) + , + + 'Sequence' : _reflection.GeneratedProtocolMessageType('Sequence', (_message.Message,), { + 'DESCRIPTOR' : _TYPEPROTO_SEQUENCE, + '__module__' : 'mindinsight.domain.graph.proto.ms_graph_pb2' + # @@protoc_insertion_point(class_scope:mindinsight.domain.graph.TypeProto.Sequence) + }) + , + 'DESCRIPTOR' : _TYPEPROTO, + '__module__' : 'mindinsight.domain.graph.proto.ms_graph_pb2' + # @@protoc_insertion_point(class_scope:mindinsight.domain.graph.TypeProto) + }) +_sym_db.RegisterMessage(TypeProto) +_sym_db.RegisterMessage(TypeProto.Tensor) +_sym_db.RegisterMessage(TypeProto.Sequence) + +ParameterProto = _reflection.GeneratedProtocolMessageType('ParameterProto', (_message.Message,), { + 'DESCRIPTOR' : _PARAMETERPROTO, + '__module__' : 'mindinsight.domain.graph.proto.ms_graph_pb2' + # @@protoc_insertion_point(class_scope:mindinsight.domain.graph.ParameterProto) + }) +_sym_db.RegisterMessage(ParameterProto) + +OutputProto = _reflection.GeneratedProtocolMessageType('OutputProto', (_message.Message,), { + 'DESCRIPTOR' : _OUTPUTPROTO, + '__module__' : 'mindinsight.domain.graph.proto.ms_graph_pb2' + # @@protoc_insertion_point(class_scope:mindinsight.domain.graph.OutputProto) + }) +_sym_db.RegisterMessage(OutputProto) + +InputProto = _reflection.GeneratedProtocolMessageType('InputProto', (_message.Message,), { + 'DESCRIPTOR' : _INPUTPROTO, + '__module__' : 'mindinsight.domain.graph.proto.ms_graph_pb2' + # @@protoc_insertion_point(class_scope:mindinsight.domain.graph.InputProto) + }) +_sym_db.RegisterMessage(InputProto) + +NodeProto = _reflection.GeneratedProtocolMessageType('NodeProto', (_message.Message,), { + 'DESCRIPTOR' : _NODEPROTO, + '__module__' : 'mindinsight.domain.graph.proto.ms_graph_pb2' + # @@protoc_insertion_point(class_scope:mindinsight.domain.graph.NodeProto) + }) +_sym_db.RegisterMessage(NodeProto) + +ModelProto = _reflection.GeneratedProtocolMessageType('ModelProto', (_message.Message,), { + 'DESCRIPTOR' : _MODELPROTO, + '__module__' : 'mindinsight.domain.graph.proto.ms_graph_pb2' + # @@protoc_insertion_point(class_scope:mindinsight.domain.graph.ModelProto) + }) +_sym_db.RegisterMessage(ModelProto) + +OperatorProto = _reflection.GeneratedProtocolMessageType('OperatorProto', (_message.Message,), { + 'DESCRIPTOR' : _OPERATORPROTO, + '__module__' : 'mindinsight.domain.graph.proto.ms_graph_pb2' + # @@protoc_insertion_point(class_scope:mindinsight.domain.graph.OperatorProto) + }) +_sym_db.RegisterMessage(OperatorProto) + +OperatorSetProto = _reflection.GeneratedProtocolMessageType('OperatorSetProto', (_message.Message,), { + 'DESCRIPTOR' : _OPERATORSETPROTO, + '__module__' : 'mindinsight.domain.graph.proto.ms_graph_pb2' + # @@protoc_insertion_point(class_scope:mindinsight.domain.graph.OperatorSetProto) + }) +_sym_db.RegisterMessage(OperatorSetProto) + +GraphProto = _reflection.GeneratedProtocolMessageType('GraphProto', (_message.Message,), { + 'DESCRIPTOR' : _GRAPHPROTO, + '__module__' : 'mindinsight.domain.graph.proto.ms_graph_pb2' + # @@protoc_insertion_point(class_scope:mindinsight.domain.graph.GraphProto) + }) +_sym_db.RegisterMessage(GraphProto) + +TensorProto = _reflection.GeneratedProtocolMessageType('TensorProto', (_message.Message,), { + 'DESCRIPTOR' : _TENSORPROTO, + '__module__' : 'mindinsight.domain.graph.proto.ms_graph_pb2' + # @@protoc_insertion_point(class_scope:mindinsight.domain.graph.TensorProto) + }) +_sym_db.RegisterMessage(TensorProto) + + +# @@protoc_insertion_point(module_scope) diff --git a/mindinsight/utils/constant.py b/mindinsight/utils/constant.py index e0b8d6ee..3af025f3 100644 --- a/mindinsight/utils/constant.py +++ b/mindinsight/utils/constant.py @@ -102,3 +102,10 @@ class OptimizerErrors(Enum): OPTIMIZER_TERMINATE = 4 CONFIG_PARAM_ERROR = 5 HYPER_CONFIG_ENV_ERROR = 6 + + +class GraphDomainErrors(Enum): + """Enum definition for graph domain errors.""" + UNKNOWN_DATA_TYPE_ERROR = 1 + TUPLE_GETITEM_INDEX_ERROR = 2 + UNKNOWN_TENSOR_ERROR = 3