Skip to content

Commit c192bea

Browse files
committed
2 parents 27dd1e9 + ab3ef3e commit c192bea

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

keras/layers/core.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -526,8 +526,8 @@ def get_output(self, train=False):
526526
return output
527527
elif self.mode == 'cos':
528528
if K._BACKEND != 'theano':
529-
raise Exception('"dot" merge mode will only work with Theano.')
530-
import theano
529+
raise Exception('"cos" merge mode will only work with Theano.')
530+
from theano import tensor as T
531531
l1 = self.layers[0].get_output(train)
532532
l2 = self.layers[1].get_output(train)
533533
output = T.batched_tensordot(l1, l2, self.dot_axes) / T.sqrt(T.batched_tensordot(l1, l1, self.dot_axes) * T.batched_tensordot(l2, l2, self.dot_axes))

0 commit comments

Comments
 (0)