Browse Source

!949 Fix CI scan

From: @liuchongming74
Reviewed-by: @ouwenchang,@scukzz
Signed-off-by: @scukzz
tags/v1.1.0
mindspore-ci-bot Gitee 5 years ago
parent
commit
29abb4635c
5 changed files with 11 additions and 22 deletions
  1. +2
    -2
      mindinsight/mindconverter/graph_based_converter/__init__.py
  2. +2
    -4
      mindinsight/mindconverter/graph_based_converter/hierarchical_tree/__init__.py
  3. +3
    -4
      mindinsight/mindconverter/graph_based_converter/mapper/__init__.py
  4. +1
    -6
      mindinsight/mindconverter/graph_based_converter/sub_graph_searcher/search_path.py
  5. +3
    -6
      mindinsight/mindconverter/graph_based_converter/third_party_graph/__init__.py

+ 2
- 2
mindinsight/mindconverter/graph_based_converter/__init__.py View File

@@ -13,7 +13,7 @@
# limitations under the License.
# ==============================================================================
"""Graph based scripts converter definition."""
__all__ = ["graph_based_converter_pytorch_to_ms", "graph_based_converter_tf_to_ms"]

from .framework import graph_based_converter_pytorch_to_ms
from .framework import graph_based_converter_tf_to_ms

__all__ = ["graph_based_converter_pytorch_to_ms", "graph_based_converter_tf_to_ms"]

+ 2
- 4
mindinsight/mindconverter/graph_based_converter/hierarchical_tree/__init__.py View File

@@ -13,16 +13,14 @@
# limitations under the License.
# ==============================================================================
"""Hierarchical tree module."""
__all__ = ["HierarchicalTreeFactory"]

import re

from mindinsight.mindconverter.common.log import logger as log
from .hierarchical_tree import HierarchicalTree
from ..third_party_graph.onnx_graph_node import OnnxGraphNode

__all__ = [
"HierarchicalTreeFactory"
]

from ...common.exceptions import NodeInputMissing, TreeNodeInsertFail




+ 3
- 4
mindinsight/mindconverter/graph_based_converter/mapper/__init__.py View File

@@ -13,8 +13,7 @@
# limitations under the License.
# ==============================================================================
"""Mapper module."""
from .base import ONNXToMindSporeMapper

__all__ = [
"ONNXToMindSporeMapper"
]
__all__ = ["ONNXToMindSporeMapper"]
from .base import ONNXToMindSporeMapper

+ 1
- 6
mindinsight/mindconverter/graph_based_converter/sub_graph_searcher/search_path.py View File

@@ -577,12 +577,7 @@ class SearchPath:
self.graph.precursor_table[s_nd] = p_nodes

def evaluate_score(self):
"""
Evaluate path score.

Expression = 0.7 * (0.1 * bonus + 0.9 * repl_ratio) + 0.3 * H
= 0.07 * bonus + 0.63 * repl_ratio + 0.3 * H
"""
"""Evaluate path score."""
return .7 * self.actual_v + .3 * self.heuristic_v

def _cal_merged_module_length(self, ptn):


+ 3
- 6
mindinsight/mindconverter/graph_based_converter/third_party_graph/__init__.py View File

@@ -13,6 +13,9 @@
# limitations under the License.
# ==============================================================================
"""Graph associated definition module."""

__all__ = ["GraphFactory", "PyTorchGraphNode"]

from .base import Graph
from .pytorch_graph import PyTorchGraph
from .pytorch_graph_node import PyTorchGraphNode
@@ -44,9 +47,3 @@ class GraphFactory:
output_nodes=output_nodes, sample_shape=sample_shape)

return PyTorchGraph.load(model_path=graph_path, sample_shape=sample_shape)


__all__ = [
"GraphFactory",
"PyTorchGraphNode",
]

Loading…
Cancel
Save