提交 a270ae04 编写于 作者: J jiangjiajun

modify

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