Browse Source

fix(mge/sdk): fix comp_node bug in dump_with_testcast_mge

GitOrigin-RevId: 26a8dc50b8
tags/v0.5.0
Megvii Engine Team Xu Xinran 5 years ago
parent
commit
62753c4d30
2 changed files with 3 additions and 3 deletions
  1. +1
    -0
      python_module/megengine/_internal/__init__.py
  2. +2
    -3
      sdk/load-and-run/dump_with_testcase_mge.py

+ 1
- 0
python_module/megengine/_internal/__init__.py View File

@@ -172,6 +172,7 @@ def make_arg(
infer would be deferred to first graph execution
:param enable_static_infer: whether to enable static inference for this var
"""
comp_node = _detail.as_comp_node(comp_node)
host_val = mgb._HostSharedND(comp_node, dtype)

if value is not None:


+ 2
- 3
sdk/load-and-run/dump_with_testcase_mge.py View File

@@ -232,9 +232,8 @@ def make_feeds(args):
outputs_new = []
for i in outputs:
get = mgb.make_arg(
mge.core.graph.get_default_device(),
i.comp_node,
cg,
shape=expect_shp(i),
dtype=i.dtype,
name=expect_name(i)
)
@@ -463,7 +462,7 @@ def main():
for testcase in feeds['testcases']:
assert isinstance(testcase, dict)
cg = mgb.comp_graph()
cn = mgb.comp_node('cpux')
cn = mgb.comp_node('xpux')
output_mgbvars = []
for name, dtype in inputs:
output_mgbvars.append(


Loading…
Cancel
Save