1.张量乘法
def f1(X,w):
c = tf.einsum('ijl,lk->ijk', X, w)
print c.shape
return c
def output(self, x):
batch_size = tf.shape(x)[0]
x = tf.reshape(x, [-1, self._shape[0]])
linear = tf.matmul(x, self._W)
return self._activation(tf.reshape(linear, [batch_size, -1]))