未验证 提交 3be2df56 编写于 作者: J Jason 提交者: GitHub

Merge pull request #76 from jiangjiajun/develop

modify
...@@ -43,23 +43,23 @@ class Graph(object): ...@@ -43,23 +43,23 @@ class Graph(object):
self.model = model self.model = model
def build(self): def build(self):
self._make_input_nodes() self.get_input_nodes()
self._make_output_nodes() self.get_output_nodes()
self._get_topo_sort() self.get_topo_sort()
def _make_input_nodes(self): def get_input_nodes(self):
for name, node in self.node_map.items(): for name, node in self.node_map.items():
name = name.replace('/', '_').replace('-', '_') name = name.replace('/', '_').replace('-', '_')
if len(node.inputs) == 0: if len(node.inputs) == 0:
self.input_nodes.append(name) self.input_nodes.append(name)
def _make_output_nodes(self): def get_output_nodes(self):
for name, node in self.node_map.items(): for name, node in self.node_map.items():
name = name.replace('/', '_').replace('-', '_') name = name.replace('/', '_').replace('-', '_')
if len(node.outputs) == 0: if len(node.outputs) == 0:
self.output_nodes.append(name) self.output_nodes.append(name)
def _get_topo_sort(self): def get_topo_sort(self):
num_inputs = dict() num_inputs = dict()
for name, node in self.node_map.items(): for name, node in self.node_map.items():
num_inputs[name] = len(node.inputs) num_inputs[name] = len(node.inputs)
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from paddle.fluid.proto import framework_pb2
from x2paddle.core.util import * from x2paddle.core.util import *
import inspect import inspect
import os import os
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from paddle.fluid.proto import framework_pb2
import paddle.fluid as fluid import paddle.fluid as fluid
import numpy import numpy
import math import math
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册