Skip to content

Commit

Permalink
fix apache#4670: add bias for fc layer (apache#4801)
Browse files Browse the repository at this point in the history
  • Loading branch information
kshitij12345 authored and alexwong committed Feb 28, 2020
1 parent b3b29ff commit 66a9e9a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions python/tvm/relay/testing/mobilenet.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@ def mobile_net(num_classes=1000, data_shape=(1, 3, 224, 224),
pool = relay.nn.global_avg_pool2d(data=body, layout=layout)
flatten = relay.nn.batch_flatten(data=pool)
weight = relay.var('fc_weight')
bias = relay.var('fc_bias')
fc = relay.nn.dense(data=flatten, weight=weight, units=num_classes)
fc = relay.nn.bias_add(fc, bias)
softmax = relay.nn.softmax(data=fc)
return relay.Function(relay.analysis.free_vars(softmax), softmax)

Expand Down

0 comments on commit 66a9e9a

Please sign in to comment.