projects
/
platform
/
core
/
ml
/
nntrainer.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1c0c8d2
)
[translayer] Fix for fc without bias
author
Parichay Kapoor
<pk.kapoor@samsung.com>
Wed, 1 Dec 2021 02:32:13 +0000
(11:32 +0900)
committer
Jijoong Moon
<jijoong.moon@samsung.com>
Fri, 3 Dec 2021 05:46:00 +0000
(14:46 +0900)
Bug fix to work with fc layer with disabled bias.
Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
test/input_gen/transLayer_v2.py
patch
|
blob
|
history
diff --git
a/test/input_gen/transLayer_v2.py
b/test/input_gen/transLayer_v2.py
index db1dc36ed534e01088bab71076614c0d4473b1ca..c16035fc6a9fff095ea9ea3fb933bfa7536b2229 100644
(file)
--- a/
test/input_gen/transLayer_v2.py
+++ b/
test/input_gen/transLayer_v2.py
@@
-43,7
+43,10
@@
def fc_translate(model):
params = [(name, tensor.detach()) for name, tensor in model.named_parameters()]
def transpose_(weight):
return (weight[0], weight[1].transpose(1, 0))
- new_params = [transpose_(params[0]), params[1]]
+ if len(params) == 2:
+ new_params = [transpose_(params[0]), params[1]]
+ else:
+ new_params = [transpose_(params[0])]
yield from new_params
@register_for_(torch.nn.BatchNorm1d)