def tensor_product(x): a = x[0] b = x[1] y = K.batch_dot(a, b, axis=1) y = K.einsum('ijk, ikl->ijl', a, b) return y
def call(self, x): output = K.einsum('ak,ijk->aij', self.kernel, x) if self.use_bias: output = K.bias_add(output, self.bias, data_format='channels_last') return output