def build(self, input_shape):
# Used purely for shape validation.
if not isinstance(input_shape, list) or len(input_shape) != 2:
raise ValueError('A `Match` layer should be called '
'on a list of 2 inputs.')
self.shape1 = input_shape[0]
self.shape2 = input_shape[1]
if self.shape1[0] != self.shape2[0]:
raise ValueError(
'Dimension incompatibility '
'%s != %s. ' % (self.shape1[0], self.shape2[0]) +
'Layer shapes: %s, %s' % (self.shape1, self.shape2))
if self.shape1[2] != self.shape2[2]:
raise ValueError(
'Dimension incompatibility '
'%s != %s. ' % (self.shape1[2], self.shape2[2]) +
'Layer shapes: %s, %s' % (self.shape1, self.shape2))
评论列表
文章目录