Skip to content

Commit

Permalink
fixed test on simple net
Browse files Browse the repository at this point in the history
  • Loading branch information
masahi committed Jan 19, 2020
1 parent d32db39 commit 3dbce0f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tests/python/relay/test_pass_partition_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,11 +477,11 @@ def test_partition_conv_bias_relu():

def get_layers(prefix, data, in_channel, out_channel,
include_bn=True, include_sigmoid=False):
weight = relay.const(np.random.randn(out_channel, in_channel, 3, 3))
bn_gamma = relay.const(np.random.randn(out_channel))
bn_beta = relay.const(np.random.randn(out_channel))
bn_mmean = relay.const(np.random.randn(out_channel))
bn_mvar = relay.const(np.random.randn(out_channel))
weight = relay.var(prefix + "weight")
bn_gamma = relay.var(prefix + "bn_gamma")
bn_beta = relay.var(prefix + "bn_beta")
bn_mmean = relay.var(prefix + "bn_mean")
bn_mvar = relay.var(prefix + "bn_var")

layer = relay.nn.conv2d(data=data, weight=weight, kernel_size=(3, 3),
channels=out_channel, padding=(1, 1))
Expand Down Expand Up @@ -511,7 +511,7 @@ def pre_optimize(mod, params):
])

if params != {}:
# This is required for constant folding on mobilenet
# This is required for constant folding
mod["main"] = bind_params_by_name(mod["main"], params)

with relay.build_config(opt_level=3, disabled_pass=["AlterOpLayout"]):
Expand Down Expand Up @@ -572,7 +572,7 @@ def test_exec(mod, params, ref_mod, ref_params, out_shape):
net = get_net()
mod, params = tvm.relay.testing.create_workload(net)
ref_mod, ref_params = tvm.relay.testing.create_workload(net)
# test_exec(mod, params, ref_mod, ref_params, (1, 16, 224, 224))
test_exec(mod, params, ref_mod, ref_params, (1, 16, 224, 224))

mod, params = relay.testing.mobilenet.get_workload()
ref_mod, ref_params = relay.testing.mobilenet.get_workload()
Expand Down

0 comments on commit 3dbce0f

Please sign in to comment.