Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/torch/nn.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsoumith <soumith@fb.com>2016-01-26 04:35:09 +0300
committersoumith <soumith@fb.com>2016-01-26 04:35:09 +0300
commit6617f526a2a6d3f201df8180f9d01a6124074ff6 (patch)
tree60032cb356216ead8e71f227bc7a04a8f1f0e0e1 /Bilinear.lua
parentc596493b5eb80e35599e7664790c849c8bdb8eb5 (diff)
fixing bilinear bias-free path
Diffstat (limited to 'Bilinear.lua')
-rw-r--r--Bilinear.lua8
1 files changed, 5 insertions, 3 deletions
diff --git a/Bilinear.lua b/Bilinear.lua
index 237e4b9..fe007c4 100644
--- a/Bilinear.lua
+++ b/Bilinear.lua
@@ -72,9 +72,11 @@ function Bilinear:updateOutput(input)
self.buff:cmul(input[2])
torch.sum(self.output:narrow(2, k, 1), self.buff, 2)
end
- self.output:add(
- self.bias:reshape(1, self.bias:nElement()):expandAs(self.output)
- )
+ if self.bias then
+ self.output:add(
+ self.bias:reshape(1, self.bias:nElement()):expandAs(self.output)
+ )
+ end
return self.output
end